DGMPGDecNV Quick Start Guide

Version 1.0.2


This document is intended to help newcomers to DGMPGDecNV 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 DGMPGDecNV?

DGMPGDecNV is an MPEG2 decoder suite. It is used to decode MPEG2 streams from such sources as Blu-Ray M2TS files, captured transport streams, MKV files, *.m2v files, etc. Note that currently only elementary streams, transport streams, program streams, and MKV files are supported, so if you have a different container type, such as PVA files or MP4 files, you will have to demultiplex the raw MPEG2 stream from its container before processing it with DGMPGDecNV.

This version is designed to run on Nvidia graphics cards that support DXVA video decoding.


What Do I Need to Use It?

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

Avisynth 2.5

You are going to use DGMPGIndexNV.exe and DGDecodeNV.dll from the DGMPGDecNV 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

In addition to the above programs, you must have Nvidia drivers installed that support CUDA decoding on the graphics card. That means you need to install version 178.13 or later of the Nvidia graphics drivers.

You also need to copy the nvcuvid.dll DLL that ships with DGMPGDecNV into your Windows System32 directory. Alternatively, if you don't want to do that, put a copy of nvcuvid.dll in the same directory as DGMPGIndex.exe, and another copy of nvcuvid.dll into the same directory as CUVIDServer.exe.


OK. Now What?

We'll assume you have an MPEG2 elementary file. Fire up DGMPGIndexNV. Using File/Open, open your MPEG2 file. You should see the video.

Now select File/Save Project and enter a name for the index file (DGM file) that is going to be generated. Suppose your source file is called 'mystream.m2v'; you might choose the name 'mystream' to enter here, because DGMPGIndexNV will automatically append '.dgm'. 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, exit DGMPGIndexNV.


Start the CUVID Server

The CUVID Server is a small application that handles the decoding. It must be running to execute the Avisynth script as described next. Just double click the CUVIDServer.exe file that comes with DGMPGDecNV and leave its small window open during the following steps.


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

DGMPGIndexNV created an index file called *.dgm. It is read by DGDecodeNV, which actually decodes the MPEG2 and delivers the video. The index file just contains information that tells DGDecodeNV where each frame is located and some information about each frame.

But you can't just execute DGDecodeNV directly! It has to be done through Avisynth. We'll make a script file called mystream.avs using a text editor. Later in this document I'll show you how to configure DGMPGIndexNV 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 'mystream.avs':

  LoadPlugin("...\DGDecodeNV.dll")
  DGSource("mystream.dgm")

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

Finally, use VirtualDub to open the 'mystream.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?


Sure, Sure, But What About My Audio

DGMPGIndexNV saved your audio in a file(s). It will have an extension like ".wav", ".ac3", "aac", "dts", or ".mpa". For example, if you have a ".wav" file, you can load that directly in VirtualDub. But you can also use Avisynth, which gives you access to powerful audio filtering.

Suppose we have a ".wav" file. Our Avisynth script will be like this:

  LoadPlugin("...\DGDecodeNV.dll")
  video=DGSource("myvob.dgm")
  audio=WAVSource("myvob.wav")
  AudioDub(video,audio)

Now when you open this script in VirtualDub, you will have video and audio.

We saw processing for a ".wav" audio file above. You need the corresponding source filter for the type of audio you have. Use WAVSource() for ".wav", MPASource() for ".mpa", AC3Source() for ".ac3", etc. WAVSource() is built into Avisynth. The others can be found here: Avisynth Filter Collection.

Don't forget to use LoadPlugin() to load your audio source filter. And read the Avisynth documentation to learn about how to adjust the audio/video synchronization using DelayAudio(), and other useful things.


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("...\DGDecodeNV.dll")
  loadplugin("...\Decomb.dll")
  DGSource("mystream.dgm")
  FieldDeinterlace()

Copy this to a file and call it 'template.avs'. Then edit it to replace the DGM file name with __vid__ (that's two underscores before "vid" and two after). template.avs should then look like this:

  loadplugin("...\DGDecodeNV.dll")
  loadplugin("...\Decomb.dll")
  DGSource("__vid__")
  FieldDeinterlace()

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

OK, all you have to do now is fire up DGMPGIndexNV, select your template file with the Options/AVS Template menu item, and then do a Save Project. If the *.avs file does not already exist, DGMPGIndexNV will make one for you based on the template! Of course, the template has to be created only once, while you'll get an automatically generated AVS script every time you save a DGMPGIndexNV project.


Cool. One Last Question...

Shoot!


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

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 DGMPGIndexNV. 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.


Copyright (C) 2007-2009 Donald A. Graft, All Rights Reserved