I’ve had this script lingering around for a bit to convert almost any video file that MPlayer can read to one that can be played on a Sony Playstation Portable (PSP).
First, you have to ensure that you’ve got the latest PSP system software (I’ve got version 3.72 installed, at time of blogging, version 3.90 is the latest one).
Then, install mplayer and mencoder. If you’re using Ubuntu, this is as simple as:
$ sudo apt-get install mplayer mencoder
Finally, copy and paste the following script to a file. Lets call the file ‘convert_psp’:
#!/bin/bash
if [ -z "$1" ]; then
echo "Please specify movie filename"
echo "$0 [-n] "
echo "where -n is for 4:3 mode"
exit 1
fi
scale=368:208
while getopts n: o
do
case "$o" in
n) scale=320:240;;
[?]) print >&2 "Usage: $0 [-n] file ..."
exit 1;;
esac
done
let "x=$OPTIND-2"
if [ $x -gt 0 ]; then
shift $x
fi
src="$1"
title=`basename "$1"`
title=${title// /_}
title=${title%.*}
out=${src%.*}
out=${out}.MP4
echo Converting $src with title $title using scale $scale to output file $out
mencoder -ofps 30000/1001 -af lavcresample=24000 -vf harddup,scale=$scale -of lavf \
-oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac \
-lavfopts format=psp \
-info name="$title" "$src" -o "$out" 2> /dev/null
Do remember to chmox +x the file:
$ chmod +x convert_psp
Using it is pretty simple, just run the script and pass in the video filename:
./convert_psp <filename>
The script will generate a video file with an extension .MP4. Transfer this file to your PSP’s ‘VIDEO’ folder and you’re done!
One thing, I can’t and won’t claim all the credit for this script. It was not me who did all the work, and I remember copying the initial script from somewhere and I’ve retro fitted it for my needs.


Posts RSS Feed