DVD-to-Zune Conversion

Disclaimer - The process of using DVDFab HD Decrypter will not be covered here to avoid legal issues. :-)

Software
DVDFab HD Decrypter
DGMPGDec
AviSynth
AviSynth plugin - dgdecode.dll (included with DGMPGDec)
AviSynth plugin - nicaudio
VirtualDubMOD
Windows Media Encoder
Windows Media Encoder Command Line Script Utility

Procedure
Install everything above and reboot your PC about 9 times. :-) Of course, the first thing you want to do is “backup” your legally purchased DVD to your hard drive. I use one of two different apps depending on the DVD. Sony’s ARcoSS protection found on newer Sony releases can choke DVD Decrypter as it’s no longer being developed.
After the DVD rip has finished, launch DGIndex from the DGMPGDec download. Open the folder where the rip is located and identify the larger VOB files. This part will require some trial-and-error, especially if the DVD’s special features were also backed up. In my example below the movie-only content, excluding special features and menus, is the VOB’s that are circled.

Select the VOB’s and drag-and-drop them into DGIndex. Hit F6 on your keyboard. The movie will begin playing and you will see an information window attached to the right side of the main window. What’s most important here is Frame Size, Aspect Ratio, Frame Rate, Video Type, and Frame Type. Write all of this down or memorize it. After a couple of minutes, hit ESC on your keyboard.

In DGIndex’s main window, pull down the Audio menu and select Demux All Tracks unless you are absolutely certain you know which one you want to use, in which case select Demux Tracks and then Select Tracks. Next, pull down the Video menu and select Field Operation. Here we’ll reference what we found earlier. If the Video Type and Frame Rate are Film and Progressive, we’ll select Forced Film. This will be typical for standard-issue Hollywood DVD releases. Alternative findings will be on episodic TV show DVD’s, where sometimes the Frame Rate will be 29.97, Video Type will be Video, and Frame Type will be Interlaced. Frame Size will not change in order to comply with NTSC standards. Actually, all of this is to comply with the NTSC. Anywho…I digress. Next, pull down the File menu and select Save Project. Give the D2V file a name and a location and a-way we go! DGIndex will scan the entire movie in just a few minutes. When it’s done close DGIndex. You now have a D2V file.

Next, you’ll need an AviSynth script (AVS). Open a new Notepad file and save it as “my_movie.avs” without the quote marks. You can name it anything you’d like. Your AVS will look like an uncompressed AVI to Windows Media Encoder but to you and me it’s just a text file created in Notepad. A sample AVS will look like this:

loadplugin(”c:\..dgdecode.dll”)
loadplugin(”c:\..nicaudio.dll”)
v=mpeg2source(”c:\..my_movie.d2v”).lanczosresize(320,240)
a=nicac3source(”c:\..my_movie.ac3″,2).ssrc(44100)
audiodub(v,a)

This is as basic as it gets. The script above - provided you put in the correct paths to your D2V and AC3 files - will produce a passable WMV for your Zune. AviSynth is a fruitful landscape. There are a ton of filters to enhance your results i.e. sharpening filters, color correction, etc. There is little that AviSynth cannot do, but the learning curve is steep. I will not go through all of that now. Check out http://www.avisynth.org/mediawiki/Main_Page

Test your script. Open in either Windows Media Player, VirtualDubMOD, or Media Player Classic. If all is well, it will play the movie at a 320×240 resolution. If you get an error, take note. AviSynth is very good about telling you exactly which line and column of the script the error occurs in. Usually, it’s just a spelling or syntax error.

Now it’s time to create a batch file. This is an optional step, but I find that using a batch file makes it alot easier to layout and edit your command-line arguments before letting the encoder loose on it. Open another new Notepad file and save it as “batch_file.bat” without the quote marks. Again, you can name it whatever you want to. Take from the example below.

cscript wmcmd.vbs -input e:\scripts\my_movie.avs -a_codec wmastd -a_setting 48_44_2 -a_mode 0 -v_codec wmv9 -v_bitrate 500000 -v_buffer 5000 -v_mode 0 -v_complexity 2 -output e:\test\video\my_movie.wmv

The command-line interface is invoked with “cscript” and the encoder is invoked with “wmcmd.vbs”. If these two files are not in the same directory then you’ll need to provide the full path to each. But as I remember they are both together after a normal installation of the encoder; typically C:\Program Files\Windows Media Components\Encoder. Everything else in the batch file can be in any order. Notice that the INPUT file is our AVS, not the DVD VOB’s. “-v_” indicates a video stream argument. “-a_” indicates an audio stream argument. The “-a_setting” argument variables are bitrate_samplingrate_channels; in our example that would be a bitrate of 48kbps, a sampling frequency of 44.1 kHz, and stereo (2 channels). The “-v_bitrate” parameter is another that you can alter for desired results. The best balance between quality and battery life is anywhere between 400000 and 800000; notated as bits per second. After the parameters are set, save the changes (CTRL-S), open a DOS box (cmd.exe) and navigate to the Windows Media Encoder folder (usually C:\Program Files\Windows Media Components\Encoder). Now just simply invoke your batch file by typing the full path and filename of the batch file. Windows Media Encoder will begin reading your batch file and invoke the encoding process. If you get an error, it’s most likely due to an incorrect path to a file somewhere, either in the AVS or the batch file. If the AVS plays fine in Media Player then look at your batch file and double-check all the arguments and paths.

Just remember to change directory paths to your particular system. The examples are paths on my machine. I’ll be in the ZuneScene forums or VideoHelp forums for additional help.



Posted in Uncategorized. Tags: , , , .

Leave a Reply