This was originally posted in the Tech.help forum, but I was asked to re-post it here since it might be more useful in this forum.
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 (My native OS is UNIX - I only use windoze when necessary), this method serves me well, and is extremely fast compared to other methods I've used.
This will work in either Linux or in Windows with Cygwin. I suppose it'll work on Macs too, as long as ffmpeg is available for it.
Prerequisites:
- Bash-shell environment under linux, cygwin, or similar.
- ffmpeg with aac support (libfaac) compiled in.
- Optional: megp4ip package (for mp4tags) to insert embedded .png artwork.
I wrote the following quick-n-dirty 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