Encoding AVI's for Zaurus Playback
From OESF
Return to PdaXrom index page.
If you're familiar with Bash scripts, the long script below is good to go!
If not, here's a little explanation:
The script provided allows you to convert any regular AVI video file into a size and format ideal for playback on the Zaurus using mencoder. The default resolution of 448x336 plays quite nicely on a Zaurus SL-C3100. If you require a different resolution (ie. Different Zaurus module, or wide screen video) simply specify the resolution you would like on the command line.
The usage of this script is:
./nameofscript.sh INPUT.avi OUTPUT.avi
If you wish a different resolution than the default:
./nameofscript.sh INPUT.avi OUTPUT.avi WIDTH HEIGHT
Example:
Work $ ./vrejakti_mencoder.sh '[Eclipse]Cool_Anime_Episode[D8A5E233\] 10.avi' CA_ep10.avi 563 317
Note: Single quotes allow you to enter funky file names.
#!/bin/sh # # Encoding anime and other small AVI # files for playback on the Zaurus. # Script by Vrejakti # http://kane.servebeer.com # INFILE=$1 OUTFILE=$2 WIDTH=448 HEIGHT=336 # if [ -n "$3" ] then WIDTH=$3 fi if [ -n "$4" ] then HEIGHT=$4 fi # echo "Default resolution is: 448x336" echo "Recommended 4:3 resolution is: 448x336" echo "Recommended 16:9 resolution is: 563x317" echo echo " Input: $1" echo " Output: $2" echo " Width: $WIDTH" echo " Height: $HEIGHT" echo echo "Is this correct?" # echo "Type \"8\" to begin encoding or \"NOT 8\" to exit: " read answer if [ $answer == 8 ] # then mencoder "$INFILE" -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300:vpass=1 -lameopts cbr:br=64:mode=3 -vf scale=$WIDTH:$HEIGHT -oac mp3lame -o $OUTFILE mencoder "$INFILE" -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300:vpass=2 -lameopts cbr:br=64:mode=3 -vf scale=$WIDTH:$HEIGHT -oac mp3lame -o $OUTFILE echo "Converted file is $OUTFILE" fi # if [ $answer != "8" ] then echo "Encoding canceled!!!" fi
Lastly, and possibly most important is optimized playback. You've got a nice quality video for the Zaurus now, but what good is it if your frame rate is only half what it could be?
I've heard the Cacko MPlayer version is great by default. But, if you're like me using the pdaXrom MPlayer, the following will increase your frame rate by 50%!
mplayer -ac mad -ao oss -framedrop -really-quiet -fs -vo bvdd $1
Save the above code, then use it like so from the command line:
./play.sh VIDEO.avi
Enjoy!
Future additions: How to install mencoder on Ubuntu.
--Vrejakti 17:10, 31 Mar 2006 (PST)

