Posted this elsewhere, but it is applicable here.
I still need to add some error checking and perhaps user input for sub-directory naming; but for now, copy this script to a directory containing .avi's you wish to convert and simply run it. It will grab all avi's and convert to .mp4 files capable of being viewed on a blackberry (tested on 8130 pearl). A pearl folder will be created and all the mp4 files will be in this directory. Seems to take about 10 minutes for a 170 Mbit avi. Once done, the file size should be a little less than half of what it was.
Code:
#!/bin/bash
VAR="files.txt"
ls *.avi | sort > $VAR
mkdir pearl
cat $VAR | while read line; do
INPUT=$(echo ${line})
OUTPUT="pearl/"
OUTPUT+=${INPUT%.avi}
OUTPUT+=".mp4"
mencoder "$INPUT" -oac lavc -ovc lavc -of lavf -lavcopts global=1:vglobal=1:vcodec=mpeg4:vbitrate=500:acodec=libfaac -af lavcresample=24000 -vf scale=240:180,harddup -ofps 30000/1001 -o "$OUTPUT"
done
rm $VAR
Please post any suggestions to maintain quality yet decrease size, or anything else that may be sueful
Bookmarks