Convert Video for Xbox 360

This is just a walk through on how I have managed to convert video for playback on the 360 from my Ubuntu Hardy install. Basically, I could not be bothered setting up the whole media center and all of that type of stuff. I did gave uShare a “very” quick go but could not get the xbox to connect so I gave up. Pretty soft of me wasnt it 😛 .

Anyway, after that effort I went searching for what the xbox will actualy support in the way of codecs and found some usefull information on the support site. This had me thinking “sweet” considering most of my shows are already in avi. But, as usual it was not going to be this simple. I spent ages trying all of the different codecs and kept getting nothing. The xbox would either show the red cross of death, play audio and no video or the other way round. I spent ages trying all of the different converstion, including video codecs and audio codec combinations. However, after all that stuffing about I noticed on the support site that the video/audio and extenstion information had to match, as well as the container. Now, I am not sure if this is something that everyone knows but I personally had no idea about the container??

Armed with this new information I tried the H.264 codec with the AAC audio and MPEG4 container  but to no avail. So, I just went straight for the wmv+wma+asf combination and omg it worked. Now I know I should have tried the other combinations, as they are better. But after hours of frustration I was totally over the whole process and not even remotely interested in watching the show that this was all in aid of :( . Ok, so I will show you the command that I came up with and it “should” convert any format over to the required xbox format:

mencoder "BBC-Planets_9.avi" -o "BBC-Planets_9.wmv" -of lavf -lavfopts format=asf -ovc lavc -lavcopts vcodec=wmv2 -oac lavc -lavcopts acodec=wmav2

You should already have mencoder installed but if not just :

sudo apt-get update
sudo apt-get install mencoder

Well just a brief description of the code is :

mencoder "BBC-Planets_9.avi" -o "BBC-Planets_9.wmv"

This section will take the input file of type avi and output to file type wmv. However, just remember this is only a name and does not have any smarts based on the extension. The next section is to do with the container that I was talking about earlier :

-of lavf -lavfopts format=asf
  • The “-of” stands for output format
  • The “lavf” is the codec you have chosen to do the conversion for you
  • “-lavfopts” is the options command specific to that codec “lavf”
  • “format=asf” and this is creating the video using the container asf

Next is the output video codec information :

-ovc lavc -lavcopts vcodec=wmv2
  • “-ovc” stands for output video codec
  • “lavc” is the library you have chosen to transcode you video, This is chosen based on the format you need.
  • “-lavcopts” the options command specific to lavc
  • “vcodec=wmv2” use lavc’s wmv2 library to convert the video to wmv

The final part is the audio codec information :

-oac lavc -lavcopts acodec=wmav2
  • “-oac” stands for output audio codec
  • “lavc” is the library used for transcoding to this audio type
  • “-lavcopts” is the options param for lavc
  • “acodec=wmav2” tells the transcoder to convert the audio to the type wma

Now that is pretty much it. I did spend a lot of time looking though the forums but most of the solutions did not work. All of the information needed was from using the man page of mencoder and the xbox format requirements on the page listed earlier. At some stage I would like to have a go at getting some of the other formats to work as well as having a look at vpass=2 which should make the video a lot better. When I do I will list the new command on the page for you guys.

Update:

Hey Again, this is just an update that might be useful for getting a little better resolution on the files

For first pass run this one:

mencoder -noskip "BBC-Planets_7.avi" -o "BBC-Planets_7_1.wmv" -of lavf -lavfopts format=asf -ovc lavc -lavcopts vcodec=wmv2:vbitrate=5000:vpass=1 -passlogfile "libvcodecstats.txt" -oac lavc -lavcopts acodec=wmav2

For second pass run this one:

mencoder -noskip "BBC-Planets_7.avi" -o "BBC-Planets_7_1.wmv" -of lavf -lavfopts format=asf -ovc lavc -lavcopts vcodec=wmv2:vpass=2 -passlogfile "libvcodecstats.txt" -oac lavc -lavcopts acodec=wmav2

Note, you might also want to check out different vbitrate settings?

16 thoughts on “Convert Video for Xbox 360”

  1. Hi,

    Thank for this help! … You can increase quality using something like vcodec=wmv2:vbitrate=5000 …

    Now, i’m trying to understand how to use vpass ….

    Have a good day/night.

    Mickael.

  2. Hello. I convert my movies perfect to xbox with this sistem, but there is a problem, the audio is de-timed, de-interlaced when converting from avi, i think mencoder try to correct it. Any manner for deactivate audio correction?

    thanks

  3. Hey Alvaro,

    Have you tried using the vpass options because this will assist in the encoding process and might fix the sync issues. If this does not work you can try this :

    Using “harddup” at the end of the filter chain will help A/V sync. It will copy frames when in the original there is nothing to stay in sync with the original. It results in a slightly bigger file, but improves demuxing and remuxing.

    NOT using -ofps (the option that sets the output frame rate) prevents the output result to have artifacts during the first seconds of the video (to be exact it will have artifacts (grey pixels) until it reaches the first keyframe)

    Keeping an audio track during the video pass fixes pretty much all sync issues exept for wmv, h264 and any other codec that allows variable frame rate. In those cases using “-mc 0” fixes the sound sync. ‘(adding “-mc 0” for non variable frame rate codecs screws up some contents !)’

    let me know if that works for you?

  4. Thanks for the tip, best one so far. Showed 2 seconds of the movie with sound before making the annoying error code. :-(

    Anyone help would be greatly appriciated.

  5. You can try Cucusoft DVD and Video Converters Suite which includes Cucusoft Ultimate DVD and Video Converter Suite. It is the best all-in-one DVD and video conversion software converts DVDs and videos to play on almost any portable device including iPod, iPhone, Zune, PSP, video capable MP3 players, video capable mobile phones, and Pocket P.C., etc.

Leave a Reply

Your email address will not be published. Required fields are marked *