/* 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 "---------------------------------------------------------------------------"