Tuesday, September 28, 2010

XVid - the best overall format

I have recently setup a Windows Media Center....and I have a Samsung Blu-Ray player that has a ethernet port and supports DLNA....and I have a XBox 360 - which can act as a Media Center Extender.

The problem is that I was having trouble getting movie files to play in the best quality and with 5.1 surround sound on all units.

If I use WMV-HD, then it works fine on the XBox 360, but the Media Center and the Samsung give me only stereo.

If I use MKV, then it works fine on the Media Center and Samsung, but the XBox 360 won't play at all.

I finally found that using XVid with AC3 sound is the format that is compatible all the way around. It was actually a complete fluke that I found this.

I happened to have a hi-res copy of Terminator 2 in a .AVI file and it played fine on all 3 units, so I used GSPOT to find out exactly what format it was.


What I found was this:

As you can see in the highlighted areas - the Stream Type is using OpenDML (very important), the codec is xvid, the resolution is high-def (basically 1080p or close to it), the audio is AC3 (5.1 surround sound) with 6 channels at 48Khz and recorded at 640kbit/sec (good audio), and it looks like Virtual Dub was used to create this.
So....that gave me the info I needed to make this happen.


So...to convert a WMV or MKV, you first use VirtualDubMod (you have to create a .AVS text file so you can open either one - this file just has the path and name of the file like this: DirectShowSource("C:\yourfile.wmv") ) and open the .AVS file. Then go to Streams and click the Save WAV button. You will have to wait a while (maybe up to an hour) and you will need lots of disk space as it is creating a RAW WAV that contains the 5.1 audio.

Next, you use eac3to (Google it) to convert the WAV to AC3 audio - this part is pretty quick.
eac3to input.wav output.ac3

Next, you go back to VirtualDubMod and in the Streams section you Add the .AC3 file you just created. Also...Disable the original audio that was contained in the file.

Next...use the File->Save option and change the compression to Xvid codec - I set my quality to 3 - seems to make a decently sized file while retaining quality.

Then let it run for 3-4 hours.

Voila! You now have a HD Xvid that will play on just about everything with 5.1 audio.

I don't know why more movies aren't being posted as 1080p XVids...this format seems to be great! With a quality comparable to MKVs. You can't do DTS - and subtitles are a bit more problematic - so maybe that is why. I see a lot of 720p XVids, but not 1080p.