AnimeMusicVideos.org > Guide Index

Making DGIndex Project Files

Now that you've ripped the VOB files, you need a way to access them. Some editing software can edit mpeg2 natively but this is often slow and inaccurate. So, to access our vob footage we are going to first index it with DGIndex.

This is a program that was previously known as DVD2AVI but due to various updates and a change of focus the programs previously associated with this method have been collected and renamed into a package called DGMPGDec. This package (supplied with the AMVapp) includes the program DGIndex which indexes mpeg2 files for use in programs like avisynth and DGDecode.dll which is the avisynth plugin that reads the DGIndex project files.

What DGIndex does

Let me take a minute to explain what we're going to be doing as it may not be instantly obvious. We are going to make DGIndex project files (*.d2v). These files can be read by other things and they help programs access DVD footage with greater speed and accuracy.

When DGIndex makes a project file, it indexes the mpeg2 data. It looks at the footage and records information about it so that it is easier for software to find a certain frame in the stream. It's the video equivalent of writing an index in a history book to help you find the page about Davy Crockett.

This allows a greater amount of stability than you will find in more direct ways of accessing the DVD footage.


collapse control A video tutorial is available for this topic

The player will show in this paragraph

Loading your Vob Files

Open DGIndex and go to the 'File' menu. Choose Open [F2], select all the vobs you want to open and click ok. If they have loaded in the wrong order you can move them around using the Move Up and Move Down buttons.

When you have opened a series of vobs you can add extra vobs to the end as you see fit but it is recommended to try and not mix vobs from different Titles as they may be encoded differently. Appending extra episodes is usually fine but keep extras seperate if you can.

It is up to you to decide how many vob files you load into a single project. I personally like to have one project file for each dvd - other people rip their vobs by episode and choose to have one project file per episode. You can even have one project file per vob if you really like. It doesn't matter as long as you remember how you created the project so, if you need to, you can easily do it again another time. One piece of advice I will give is that the fewer project files the better when editing vob footage directly in programs like Premiere.

Once you have all the vob files you want for this project listed and they are in the order you need, press ok. You should be able to use the bar at the bottom to browse your footage.

The frame seeking in the DGIndex interface only searches through keyframes so you will not be able to find exact frames. Like VirtualDub, you can select an In and an Out point using the [ and ] buttons but you normally should not do this. As I've said previously, one benefit of using dvd files is being able to reconstruct the footage later. You cannot do this if you select an area because it is incredibly hard to recreate later.

Now that you have your footage loaded, let's have a preview of the footage. Press F5

Footage Properties

DGIndex Preview Information Pressing F5 shows a preview of the footage and gives you all sorts of useful information about your mpeg2 stream. The items listed below will be important, so you may wish to write their values down somewhere.

Aspect Ratio: This can either be 4:3 or 16:9. If the aspect ratio is 16:9 then the DVD is anamorphic.

Frame Rate: This can be 29.97fps (for NTSC), 23.976fps (for FILM) and 25fps (for PAL). It can actually be anything depending on the way the mpeg2 source is encoded but these are the conventional standards. DGIndex actually displays much more accurate framerates, as shown in the image. Because its impractical to write or even remember the framerate with such accuracy, people generally just refer to them as 29.97, 23.976, and 25 fps (well, 25 fps is perfectly accurate, actually).

Video Type: This can be NTSC, PAL, FILM or VIDEO. It is very important if you get a DVD that is 95% or more FILM as I will explain later. DGindex can only check this value for each frame as it processes it, so you can't know what percentage film something is until the whole video has been processed. In order to check the whole video, you can just save a project file (as described later on this page) and check the value here once that is completed.

Frame Type: This is a flag on the footage which gives us info on how it is being stored and hence how to decode the video. Interlaced means the footage is probably encoded a field at a time instead of a frame at a time. Progressive means that the footage is encoded a frame at a time. You may find some sources change because of the way they have the flags set - I will explain these when we analyze the footage later.


Before telling you what settings you will need to put into DGIndex it is important that you understand about some of the basic video types you will come across when doing this preview.

16:9 'Anamorphic' Footage

Anamorphic dvd encoding is designed to squish the footage horizontally to fit a regular 4:3 image size. Most dvds within a standard are encoded with the same resolution (720x480 for NTSC and 720x576 for PAL). This resolution is chosen to show a 4:3 image on a TV (as TVs have 'rectangular' pixels). When a movie is anamorphically encoded, a 16:9 image is squished in order to fit into 720x480 or 720x576. What happens later is that this image is then fed to a Widescreen TV and it is displayed to fill the screen, restoring its aspect ratio. This avoids having to use letterboxing (adding black borders) on a DVD and hence improves image quality. However, as it makes everyone look squished you need to fix this somewhere down the line if you want to use this footage (unless you want to produce an ananmorphic dvd).

Interlaced NTSC and Progressive FILM Video

Interlaced video (when done right) is encoded on DVDs as fields instead of as frames. Each field is encoded seperately and then weaved together to make the interlaced video - if you have read the Theory Guides this will make some sense. Progressive footage, however, does not have interlacing and so it can be encoded one entire frame at a time.

Progressive footage is usually found on FILM sources. When I say FILM I mean that the footage on the dvd has been taken and encoded directly from a movie film source (24fps - converted to 23.976fps). This is the a high quality way to encode video. The only problem is that NTSC needs 29.97fps - which is why progressive FILM encoded dvds have the ability to Telecine (do 3:2 Pulldown) during playback which interlaces them to 29.97fps so that the video looks correct on a TV. The actual video isn't interlaced, the dvd player interlaces it during decoding using a fixed telecine pattern. Again, the theory guides will make some sense of this. This telecine process is completely optional during decoding and if we wish we can Force FILM on these sources in order to get the original progressively encoded frames at 23.976fps. This is perfect for digital video editing. If you have a progressive source, be happy.

Progressive FILM encoding is usually only to be found dvds of movies produced for cinema. There are some anime dvds that are truly progressive but if you are working from TV shows then they are more likely to be plain NTSC. You can definitely use force film on Princess Mononoke, Spirited Away (and many other Disney-released Ghibli movies) but Adolescence of Utena is not progressive. You should always check by pressing F5 or even better scrolling to the middle of a source and pressing F6 to see what the pattern is in the middle (as some studio bumpers are interlaced when the movies themselves are actually progressive).

DGIndex Settings

Video Menu

iDCT Algorithm: This selects the accuracy of the decoding... but it's a level of accuracy that you are unlikely to notice visually - it's actually hard to notice it mathematically. Skal SSE MMX is default and the best option for most people's processors.

Field Operation: This is an important option and what you choose here will depend entirely upon the Video Type you observed when you previewed with F5 as there is a chance that your video is progressive, as already discussed. If you have a source which is more than 95% or so FILM then you can choose Force FILM in order to return the original progressive frames. However, be careful with this option as it can sometimes be inaccurate especially if it is not perfect 100% FILM. Never choose this if it is obvious that you have a hybrid source with a large amount of NTSC. PAL users will never want to set Force FILM. If your source was NOT more than 95% FILM then you should choose Honor Pulldown Flags, which happens to be the default setting.
Now, this 95% value is not some magic number, it is just a rough guideline. If your source is 94% or maybe even as little as 90% film, you might still want to enable force film. The reason the entire movie isn't film is because things like the studio bumpers at the beginning, or the credits at the end are often encoded interlaced.
Each time you start up DGindex, it is very important that you check and make sure Field Operation is set to Honor Pulldown Flags. If it is set to forced film when you press F5 to get your video info, it will cause incorrect info to be displayed.

YUV -> RGB: PC Scale is the default option, and is what should be chosen here.

HD Display: If you loaded a High Definition video, DGindex will make the video preview smaller so it doesn't take as much space on your screen.

Luminance Filter: This is to increase brightness. Out of date an unnecessary. The same thing can be done in avisynth.

Cropping Filter: This is another function that should not be used as Avisynth can do exactly the same thing and is easily reconfigurable. Doing it here will not speed up the cropping, so do it in avisynth so you can change the settings later.

Audio Menu

The audio menu is to set up how (if at all) you want to decode any audio streams that are part of these vobs. Remember, if you don't plan to use audio from the DVD, then you won't be needing the audio!
Output Method: If you don't want to use any of the audio then select Disable. It will be much quicker to process that way. Otherwise there are a few things you can do. Demux (which is best quality) or Decode to Wav which isn't as good quality for AC3 but is just like demuxing for Wav.

Select Tracks:
The audio track you want to process. DVDs can have any amount of audio tracks but generally only a few are used. Unfortuantely DGIndex has no way of knowing which language is on which track. Sometimes Japanese is first and English second, sometimes it's the other way around - so to be certain of getting the track you want, you should select 'demux all tracks' in the output method.

Dolby Digital Decode:
Dolby Digital audio should be should be demuxed and decoded externally if you want the best quality - see the Audio Guides. You wont need these options.

48 -> 44.1Khz: This converts dvd's native 48Khz audio to 44.1Khz which is that used by CDs. The only reason you would want to do this is incase you have a very old soundcard that cannot play 48Khz audio. In such a case you could probably do with a new soundcard :)

Normalization: When decoding, this will boost the audio so it is as loud as it can be without clipping. This is a useful feature when decoding PCM wav audio but does not apply when demuxing.

Making a Project File

Once you've got all these settings right, you are ready to save a DGIndex project file. So, select "Save Project" from the File Menu, or just hit F4. Make sure you save your project file somewhere sensible. When it is done you should hear a nice ping sound and have a .d2v file to play with. If you have processed audio it will be in the same folder.

One final piece of advice is that DGIndex project files refer to the drive and folder that the footage is stored. If you move your vob files at any point then you will need to remake the project file. The project file, however can be moved or copied anywhere you like.

Demuxing Clips

Ok, so now what if you don't really want to index the entire video? Maybe you are making an AMV with lots of different sources, and you only need a very short clip from this DVD? You don't want to keep those multiple gigabytes worth of vobs sitting around if you only need a 10 second clip, right? Well what you can do, is set the end and out points of the clip you want, using the [ and ] buttons (yes, we told you not to do this earlier, but this time... shall be different!) Sometimes a bit of distortion can happen at the points you cut at, so it is best to include a little bit extra on both sides. Once you've got it selected, go to the File menu, and choose Save Project and Demux Video. This setting will create both a .d2v file and a .m2v file on your hard drive. The m2v file is the actual video clip from the DVD. Once you have that, you can safely delete your VOB files, if you want to. The d2v file that was created along with the m2v is worthless though. What you need to do, is open up that .m2v file in DGindex, just like you opened your VOBs originally. Then save a new project file from it.

Illegal Field Order Transitions

Sometimes after you save your project file, DGIndex will alert you that it has detected an illegal field order transition, and ask you if you want to correct it. There is unfortunately no easy way to determine if the field order transition should be corrected or not. I recommend that you tell DGindex to correct it, because it will then give you both the corrected version, and the original uncorrected version as well. Later when you deal with performing IVTC on your footage, you can determine which is the proper version to use. Often, one version will IVTC very easily, while the other will exhibit problems.

Using the DGIndex Project in AVIsynth:

Just as DGIndex is the best way to index a dvd, Avisynth is the best way to access that index.

By this point you should be fairly familiar with Avisynth, having used it in both the Avisynth tutorial. What we need to do is make an Avisynth Script that imports our .d2v file.

Any AMVapp users are lucky, as they will already have an .avs file created for each .d2v file thanks to a template that DGIndex can use. If you are not using the amvapp, you will need to create your avs file manually. You can do this by using AvsP, as before, to make a .avs file that contains the following command:

MPEG2Source("C:\yourfolder\yourprojectfile.d2v")

Now just preview your script in AvsP or VirtualDub, to make sure everything is working properly.

With the right avs script and the AMVapp installed then everything should be working fine. If you have installed the software manually then you will need to make sure that Avisynth is correctly installed and you have DGDecode.dll in your default plugin folder.

Here is a quick summary of possible errors that you might get, just in case:

"avs is an unrecognized file type" - This error, or one similar to it, is what you can get if avisynth isn't installed correctly.

"MPEG2Source: unable to load file "somethingorother.d2v" in something.avs, line something" - This error will occur if your MPEG2Source command isn't pointing to a d2v file or you've made a typo.

"Unknown command MPEG2Source" - This will occur if you'd made a typo or if the plugin that the command is for hasn't been loaded - in this case the plugin is DGDecode.dll and should be in the Avisynth Plugins folder.

"MPEG2Source: couldn't open source file, or obsolete D2V file" - This one occurs if you have created a d2v file using a different version of DGindex than the one you have the plugin for. If you have installed DGindex manually, make sure you copied the DGDecode.dll file that came with it to your AviSynth plugins folder, and then try remaking your d2v file.

However, if all has gone well you should see your footage appear.

Before we analyse the footage that you have, there is one last thing to tell you about and that is the Post Processing setting in the MPEG2Source command.

MPEG2Source("C:\yourfolder\yourprojectfile.d2v", cpu=6)

This setting called cpu designates the strength of the post-processing. The values are from 1 to 6 with 6 being the strongest. Some people find that 6 blurs the material a little but most everyone would agree that a setting of 4 would simply improve quality. If you dont want any postprocessing to be done, then simply omit the cpu parameter, or set it to 0.