Go Back   Zune Boards > Help Forum > Tutorials

Tutorials A collection of tutorials to help you with various programs.

Closed Thread
 
LinkBack Thread Tools
Old 07-31-2009, 09:07 AM   #1 (permalink)
Zewbie
 
Join Date: Jul 2009
Posts: 3
unixTechie is on a distinguished road
Default Using ffmpeg to convert avi to mp4 for xbox 360

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



unixTechie is offline  

Advertisement [Remove Advertisement]
Old 07-31-2009, 05:12 PM   #2 (permalink)
Zune Freak
 
roebeet's Avatar
 
Join Date: Sep 2008
Location: Pennsylvania, USA
Posts: 1,023
roebeet is just really niceroebeet is just really niceroebeet is just really nice
Send a message via Yahoo to roebeet
Default

FYI, there's a gui front-end for ffmpeg called "WinFF", which I use on Ubuntu (and also has a Windows port). It's a nice alternative to the command line, although I'll admit that I find myself going to back to command line more and more for my transcoding needs.
__________________





roebeet is offline  
Old 08-05-2009, 01:13 PM   #3 (permalink)
Zewbie
 
Join Date: Jul 2009
Posts: 3
unixTechie is on a distinguished road
Default

Yes, I'm aware of the various front-end GUI's for ffmpeg, but I personally hate GUI's. I guess I'm "old-school"... You can do so much more from a shell prompt.



unixTechie is offline  
Closed Thread

Bookmarks

Thread Tools