Hi all,
I haven't seen anyone discuss this method for converting avi files to mp4 for sharing to the xbox 360 here - As an old command-line junkie, this method serves me well, and is very fast. This will work in either linux or in Windows under Cygwin. I suppose it'll work on Macs as well as long as ffmpeg is available for it.
Prerequisites:
Bash-shell environment under linux, cygwin, or similar.
ffmpeg with aac support compiled in.
Optional: megp4ip package (for mp4tags) to insert embedded .png artwork.
I wrote the following little shell script (avi2zune) to facilitate the conversion. I hope someone finds it useful:
Code:
#!/bin/sh
if [ ! "$1" -o ! "$2" ]; then
echo "Usage: avi2zune filename.avi 4:3|16:9 [artwork.png]"
exit
fi
if [ "$2" = "4:3" ]; then
RES="512x384"
elif [ "$2" = "16:9" ]; then
RES="640x360"
else
echo "Aspect Ratio must be 4:3 or 16:9"
exit
fi
mp4name=`basename $1 .avi`.mp4
ffmpeg -i $1 -f mp4 -vcodec mpeg4 -b 1000k -r 23.976 -s $RES -aspect $2 -acodec libfaac -ab 128k -ar 48000 -ac 2 $mp4name
if [ "$3" ]; then
mp4tags -P $3 $mp4name
else
exit
fi