DGMPGDec Quick Start Guide


This document is intended to help newcomers to DGMPGDec to quickly understand the process and become productive. It is intentionally short and to the point, and is not intended to be a complete users manual or tutorial.


What is DGMPGDec?

DGMPGDec is an MPEG2 decoder suite. It is used to decode MPEG2 streams from such sources as DVD VOBs, captured transport streams, *.mpg/*.m2v files, etc. Perhaps its most common use is in decoding VOBs from DVDs.


What Do I Need to Use It?

You need the DGMPGDec package and Avisynth. First get Avisynth 2.5 (or better) and install it:

Avisynth 2.5

You are going to use DGIndex.exe and DGDecode.dll from the DGMPGDec package, so extract them from the ZIP file and put them together in a directory.

Also get VirtualDub as we will use that to view the decoded video:

VirtualDub Web Site

We'll assume you have a VOB that you have obtained from a DVD (possibly using Smart Ripper, or other such tool).


OK. Now What?

Fire up DGIndex. Using File/Open, open your VOB. You should see the video.

Now select File/Save Project and enter a name for the index file (D2V file) that is going to be generated. Suppose your VOB is called 'myvob.vob'; you might choose the name 'myvob' to enter here, because DGIndex will automatically append '.d2v'. Good. Hit Save. The indexing process will start and you'll see the indicator moving along the time line to indicate the progress. Be patient if your video is large. When the process finishes, you'll get a popup. Dismiss the popup and exit DGIndex.


What is This Index File and What Do I Do with It?

DGIndex created an index file called *.d2v. It is read by DGDecode, which actually decodes the MPEG and delivers the video. The index file just contains information that tells DGDecode where each frame is located and some information about each frame.

But you can't just execute DGDecode directly! It has to be done through Avisynth. We'll make a script file called myvob.avs using a text editor. Later in this document I'll show you how to configure DGIndex to make the script automatically, but for now, you need to know the old-fashioned way. So put this text into a new text file you make called 'myvob.avs':

  loadplugin("...\DGDecode.dll")
  mpeg2source("myvob.d2v")

Replace the path '...' in the first line with the path to the location where you placed DGDecode.dll.

Finally, use VirtualDub to open the 'myvob.avs' script file just as if it was an AVI file. That's it! You have your video and can navigate randomly on the VirtualDub timeline. Does life get much sweeter than this?


Yeah, But How Do I Do That Automatic Script File Thing?

Ahh, you have to pay extra for that! No, not really.

Let's suppose you have a script that you use all the time. Maybe like this:

  loadplugin("...\DGDecode.dll")
  loadplugin("...\Decomb.dll")
  mpeg2source("myvob.d2v",cpu=6)
  fielddeinterlace()

Copy this file to the same directory where DGIndex is located, and call it 'template.avs'. Then edit it to replace the D2V file name with __src__. It should then look like this:

  loadplugin("...\DGDecode.dll")
  loadplugin("...\Decomb.dll")
  mpeg2source("__src__",cpu=6)
  fielddeinterlace()

You see, DGIndex is going to use this as a template and insert the right file name whenever it sees __src__. Slick, eh?

OK, all you have to do now is fire up DGIndex and do a Save Project. If the *.avs file does not already exist, DGIndex will make one for you based on the template!


Sure, Sure, But What About My Audio

Hey, I told you this was a quick start! You have to use the Audio menu in DGIndex to extract the audio to a "demultiplexed" file. Then you can process it as you wish and re-add it back in VirtualDub when you do your postprocessing. A good place to learn about all this is the DVD2AVI forum at the Doom9 web site. (DGIndex is an evolution of DVD2AVI.) Here is the link. I hope to see you there!

Doom9 Forums


Cool. One Last Question...

Shoot!


Why the Two-Step Tango? Why Can't I Do Everything Right in DGIndex?

Good question! We want to make our video available to any application that we might find useful. Surely we can't put every possible function into DGIndex. So instead we create a way to 'serve' the video into all these other applications. Avisynth is an AVI file server. It creates a 'fake AVI' and tricks applications into thinking they have a real AVI when they open the *.avs file.

If you just want to make an AVI out of your video, it's easy. Open the AVS in VirtualDub, set your compression, and do Save AVI.

There's another way to serve called 'VFAPI' that is also supported, but you get the idea: we are just setting up serving of the decoded MPEG2 video with DGMPGDec. The receiving application then does its thing without even knowing it has been tricked.


Copyright (C) 2004, 2005 Donald A. Graft, All Rights Reserved