Ollie
{ MODERATOR }
posts: 8
last: 26-Mar-2008
TITLE: Convert movies into PSP Format using ffmpeg
DESCRIPTION: Convert movies into PSP Format using ffmpeg
Submitted: 09-Feb-2008 21:48:46 ( 47w 2d 12h ago ) Language: BASH (*.sh)
Views: 288 Lines of Code: 41 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Intermediate
Bookmark
/* Author: http://gentoo-wiki.com/HOWTO_PSP
   Date: 09-02-2008
   Filename: make_psp_movie.sh
   Usage: find /home/ollie/Porn/ -type f -exec ./make_psp_movie.sh {} \;
   Required: ffmpeg with h.264/AVC for the PSP - http://can.homeunix.org/sw/psp/ffmpeg_psp/
*/
#!/bin/bash
#script name: make_psp_movie.sh
if [ $# == 0 ]
then
    echo "Use: make_psp_movie video1 video2 video3 ..."
fi
target="/tmp/`echo $LOGNAME`/pspmovies/MP_ROOT/100MNV01"
mkdir -p "$target"
for m in "$@"
do
    echo "-------------------"
    echo "Start converting $m"
    echo "-------------------"
    output="10001"
    while [ -f "$target/M4V${output}.MP4" ]
    do
        let "output += 1"
    done
    #generate video
    #If "-r 29.97" does NOT work try "-r 14.985"
    ffmpeg -i "$m" -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 320x240  "${target}/M4V${output}.MP4"
    #generate thumbnail
    ffmpeg -y -i "$m" -f image2 -ss 5 -vframes 1 -s 160x120 -an "${target}/M4V${output}.THM"
    #list the files that were just generated
    ls -l "${target}/M4V${output}.MP4" "${target}/M4V${output}.THM"
done
echo
echo "---------------------------------------------------------------------------"
echo "You will find any newly generated PSP videos in:"
echo "     ${target}"
echo
echo "Please copy them to your PSP's 'MP_ROOT/100MNV01/' folder."
echo
echo "Note: if that folder doesn't already exist, just create the folders first."
echo "---------------------------------------------------------------------------"