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.


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?

Adobe Air in Ubuntu Hardy Herron

I had recently started using Twitter as suggested by a friend and it seems pretty cool. But, because of its fast and lite nature I needed some “pretty” way of posting and tracking my friends on it. I did the usual thing of searching the net for gnome packages and some were ok, but most were lacking and average. Anyway, I had a look for a similar thing on my windows machine, and came across spaz. This is a “widget” type install for the new Adobe Air . The adobe air suite allows widgets like spaz and analytics reporting suite to sit on the desktop, similar to the new vista style widgets.

Anyway, enough crapping on… The cool part is that, Adobe has released a package for linux :) . This is sweet news that they have taken the time to develop for linux, it is only in the Alpha atm but should be in beta very shortly. Here is a pic that shows the Analytics plugin and the Spaz one :

The install is pretty straightforward:

  • Download the deb package from adobe
  • Run these commands on the downloaded file :
  • chmod +x adobeair_linux_a1_033108.bin
    sudo ./adobeair_linux_a1_033108.bin

The package management system should take over from here, and .air packages should be installed with a double click from then on.

The plugins that I think are pretty sweet are here :