My solution to the XBOX 360 streaming video problem

After a lot of time futzing around I found a solution to my problem and thought I would share it. It’s still not as simple as I thought it should be.

First the background:

What I wanted was to watch my movies on the xbox 360 with little to no quality loss. Also, I did not want the conversion process to be painful (read time consuming or too many processes). I am currently in process of ripping all of my DVDs to hard disk. My current method is to rip the vobs as a DVD VIDEO_TS folder so I can watch them through TheaterTek. The problem is, in their infinite wisdom, Microsoft decided that the XBOX 360 should not stream DVD video, what a bunch of idiots.

They are worried about DRM etc… Well, dammit these are my DVD’s I purchased every one of them, if I want to go and play Frisbee with them I can. If I want to melt them onto my forehead I can. If I want to rip it to my hard drive to protect my property (the source media) then dammit I can. If I upload the rip or burn it and give it to my friends that’s breaking the law.

Like many people I have kids, most movies survive being put into the DVD player 3 times by kids. When I watch the kids put a DVD that I just paid $30 for I cringe. They get it close to the tray and then kind of scoot it around until it falls into the slot. Anyone with kids and DVD player will recognize this. As evidence of this wonderful treatment, rent a kids movie from Netflix (I am talking about videos for kids under 12). 1 in 3 will not play.

On top of this is storage, I have close to 2000 DVD’s in my house. They take up two bookshelves upstairs, two downstairs and many are in boxes around the house. In my last post, I said 1000 but this weekend I really took a look around and did some averaging math, 50 per shelf, 150 per box and the number is closer to 2000.

Now, why do I want to stream them to the XBOX? Because I can put the Media Center PC in the basement and only have one little XBOX 360 sitting on my rack with the AMP. It’s very tidy. I only have one TV so this would be perfect. Okay, off of my soapbox and onto the meat of this post.

Here is my criteria, the video and audio have to be DVD quality or damn close. I cannot stand pixelated backgrounds or choppy action sequences. I have a 5.1 home theater system and I want to use all of it. The ripping process has to be fast, the math is simple, if it takes 3 hours to burn a movie then thats too long. 3*2000 = 6000 hours. I need to do it in less than 1 hour per movie to have any hope of getting it done in this lifetime.

I tried several of the one click solutions, in this group is TMPGEnc, ImToo, Womble, Encode 360 and many many others. They all took too long (remember I need less than 1hr a movie) and most did not produce satisfactory results. If I had a lot fewer movies and was looking for total simplicity I would choose Encode 360, its easy to understand and produces good quality video.

I tried the two streaming solutions that I found TVersity and Transcode 360. I ruled TVersity out very quickly because it does not support 5.1 Audio, its too bad because it really is a good solution. Neither solution supports forced subs which is why Transcode 360 would not work. Its worth a note that Transcode 360 requires Media Center, but since it uses VLC for the Transcode it does not support forced subs either.

I tried AVISynth and DGMPGDec, they turned out to be too slow and complex. Each movie has to be set up individually. Putting the video out to mpeg2 requires some extra work. If you are going to AVI though this is a great solution.

Out of frustration I started writing my own application. After I coded the .net library to parse VTS_xx_nn.IFO files I decided that this was just going to be a pain the backside.

I did a little research, and as everyone knows the XBOX 360 can accept WMV video and not DVD (ifo) files. However, it can also accept mpeg2 streams with AC3 audio streams. This is when it clicked for me, a DVD VOB is just a sort of MPEG 2 stream. It has extra header information and a few other things, but in the end its just a mpeg 2 stream. This means I can simply repackage my Main video and audio streams into an mpeg container and I’m done. This works for most of my movies. It still leaves the subtitle problem. I will cover my solution for that here as well.

My test movies were The Davinci Code, While You Were Sleeping and Anger Management. I chose The Davinci Code because it is dark, has action sequences and most importantly has forced subtitles. I chose While You Were Sleeping because it is 16:9 on a 4:3 screen and has poor quality video and two channel audio on the source DVD. I chose Anger Management because it is sort of a standard movie, nothing unusual about it.

For this process you will need:

Video Lan Client (VLC)

Subtitle Creator

VobSub

PgcDeumx

My VBS Files

Here is what I do for most of my movies. I use AnyDVD to decrypt the DVD. Then I DVD Shrink the movie extracting only the main movie, one audio stream and english subtitles with no compression. You can find this process explained at Doom 9 which is a very informative site.

Burning the video to a mpeg with no quality loss

Start VLC. Click on File->Open File. At the bottom of the the dialog box you will see an advanced options section. click on the check box that says Stream/Save. In the text box that says customize, type in your movie directory as follows: dvdsimple://\\Media01\DVD\ANGER_MANAGEMENT
VLC stream to file

the \\Media01\DVD\ANGER_MANAGEMENT is the path to my DVD rip. This is where you type in your movie location, or the path to your ifo files. Make sure it does not end with a backslash or VLC will not open the directory. To be really clear:

This is valid:
dvdsimple://\\Media01\DVD\ANGER_MANAGEMENT

This is not - notice the last character
dvdsimple://\\Media01\DVD\ANGER_MANAGEMENT\

I point this out because VLC will give you no indication as to whats wrong, it just won’t open. The error messages indicate that it could not find a decoder.

Okay, I have entered in my source file, now I click on the settings button which will open the stream window.

Click settings button

Check the file box and enter your output mpg. In this case I entered \\Media01\DVD\ANGER_MANAGEMENT\ANGER_MANAGEMENT.mpg. Click the MPEG PS radio button, this will make it output an MPEG Program Stream. Make sure everything else is unchecked.

Select the stream options

Click on OK which will close then screen.

Then click on Ok again. This will start the encoding process.

You will now have a dvd quality rip of your source material. When you checked no transcoding options on the settings screen, basically VLC just put the source streams into an mpeg2 container. No transcoding and zero loss of quality, the streams are exactly like they were on the DVD. They resulting mpg should be the same size minus some header information from the source vobs. You can now deliver this to your XBOX 360 with no problems

As a side note, you will need a pretty decent network and fast NAS. My Terrastation can stream one movie at a time with only minor hiccups here and there. My ReadyNas NV+ can deliver multiple streams with no hiccups for a considerably higher cost. I personally pay the extra for the ReadyNas NV+ because the drives are easier to maintain and I don’t get hiccups in my movies.

Adding forced subs:

Open up VobSub Configure (This should have been installed to your start menu) and open the ifo file. This process will take a while so be patient.

Click the open button

Select the ifo option

Now start up SubResync (Also in your start menu under VobSub) and open your idx file that you just created. If you see a “yes” in the forced column you have forced subs. If you don’t have forced subs you are done.
Look for forced subs

If you have forced subtitles you have a new problem. You have to burn the subtitles onto the movie so they are there permanently. I have found that even if I use the burned DVD’s to a video_ts type folder only TheaterTek will play the subs correctly. VLC won’t display them or if you turn subs on it will display them all the time (not just forced subs). Media Player 11 on the other hand will display them all the time. This is because the programming to display only the forced subs is contained in the main video_ts.ifo which I do not keep.

If you are lucky VobSub pulled the right times for your subtitles. If not you have some extra processing to do, here is how you find out. Start VLC open the mpg and add the subtitle file from the last step.

Preview in VLC for correct timing

Advance the video to a point where there should be forced subs and see if they are right. In my experimentation, The Davinci Code was never right. If they are right you can skip the next step.

Correcting the sub timing:

Start PgcDeumux and rip only the subtitle stream. Notice you are opening the ifo file again not the mpeg you output eariler. Once again be patient because this process has to rip the subs again.

Rip the subtitle stream

You will end up with a sup file (it will be named subpictures_xx.sup). Unfortunately, VLC does not support sup files so you will now use Subtitle Creator to convert your sup file to a VobSub format. Subtitle Creator is actually for creating subtitles or editing text subtitles. So its not real intuitive how to convert subtitles from sup format over to VobSub format. I have created a Visual Basic Script file that I use for this process. You drag the sup file onto the vbs file and it will convert it for you. Make sure you change the location of the Subtitle Creator executable to match your system. Fortunately, this process is very quick.

Correct the file path

You now have the correct timings for your subtitles, but guess what. You created a new problem, the sup format does not contain color information for the subtitles, it only contains the timings. So your subtitle colors will be the standard colors from subtitle creator. Unless you want to edit the colors (I don’t) you wont want these colors.

Here is what you have to do, copy all the timing information from the Subtitle Creator output over to the VobSub. This is pretty straight forward, you copy everything below the text that says # alt: English from the Subtitle Creator file and replace everything in the same place in the VobSub idx file.

Copy from subtitle creator file to vobsub idx file

Then make sure the file is configured to show only forced subs.

Forced subs on

Follow the process above to make sure the subtitles are timed correctly (open in VLC).

Outputting video with subtitles burned in:

You should now have an mpg video and an idx/sub file. Unfortunately, you cannot just burn the subtitles, you have to Transcode the video. I use another Visual Basic Script file to do this. It has the settings in it I use. All I have to do is change the names of the input and output files and run it.

Change source & destination names

It will write a log file for you to look at to see exactly what it did. If you want to tweak these settings, you can. There are two pages to help you with this, VLC Command Line Help and VLC Advanced streaming using the command line.

You may be wondering why I convert the video to mpeg and then transcode it. Firstly, the conversion is lossless, that is there is no quality degradation from the DVD to the video. Secondly, VLC seems to get confused sometimes when there are multiple streams. It won’t always burn the subtitles in, I have not figured out why but you can actually reproduce this using the dvdsimple method of opening a file. Open the dvd and add the subtitle file, you may or may not see the forced subs.

Conclusion:

This method may seem complex, however, its actually pretty simple. If there are no subs it takes me about 30 minutes to rip an entire movie to mpeg. About 15 minutes to rip it with DVD shrink and about 15 minutes to convert it with VLC. This is the process for the vast majority of my DVD’s.
If there are forced subs add another 30 mintues. Since I have the sub process semi-automated with Visual Basic Script files it only takes processing time, very little human interaction time. The most time consuming piece is when VobSub does not get the correct time codes, I have to rip the sub-stream twice. I have not spent a whole lot of time trying to figure out why VobSub does not pull the correct times or how to fix it quickly so there may be a better method. My guess is that its using the wrong frame rate to figure out the timing.

In my burning subtitle process, I encode the movie at 4 megabits. I have found this pretty satisfactory for my movies I don’t see pixelation or any stutter. The output file is considerably smaller than the input files though so there is definitely some loss of quality. The Transcode script I use can do either a video with a sub or a video without a sub if you want to compress those movies as well. Just clear the text for the subtitle file.

I still think it is possible to just overlay the subtitles without the messing with video compression but I have not worked down that path yet.

Leave a Reply