ErMaC's Guide to All Things Video - Part 5

DVDs: What They Are and How To Use Them

Continued from the first page.

How is working with VOB files in Premiere possible? Well, it's a very complicated process which has taken me MONTHS to get working correctly (I first tried doing it back in Summer of 2000, but the software wasn't then available to make it possible). I needed to get it to do this because in order to convert to my DV500's DV format, I have to be able to open the file in Premiere since the only way to create the AVI files correctly is using the Premiere Export plugin that comes with my DV500 software (which doesn't work attached to FlasKMPEG, BTW).

Note: The following will be very heavy on technical details, so follow very closely.

I. Installing Necessary Software

Go to Doom9's great site and download the following software:

1)

Smart Ripper or DVD Decrypter

These are for decrypting the MPEG2 data on your DVDs and copying unencrypted versions to your hard drive. Note that while it is possible to do the decryption in realtime using the OpenDVD plugin for DVD2AVI (the next piece of software needed) I do NOT recommend doing this! It will substantially decrease the speed at which you can work, and puts a lot more stress on your system. Besides, unless you have multiple DVD-ROM drives, you can't do what might be very useful - edit VOB files from multiple DVDs at once.

I personally use SmartRipper, but from what I've heard both of these programs work and do the same thing.

2)

DVD2AVI v1.76

DVD2AVI is a VOB conversion/frameserver tool. Some people use FlaskMPEG, however it's inferior in quality to this tool, and is definately not useful for what we're going to be doing.

The archive comes with both the actual program and the VFAPI plugin, which both are very important to what we're doing. Just unzip them to a directory.

3)

AVISynth 1.0 beta 6 or later and MPEG2DEC.DLL

To install AVISynth, make sure you get the 1.0 beta 3 version, then copy the DLL file to your \Windows\System directory if you're in Windows 95/98/Me, or copy it to \Winnt\System32 if you're in Windows NT/2000/XP. Then double click on the Install.reg file. Also make sure to get the AVISynth Premiere Plugins at this page and copy all the files in the archive to the Plugins directory in your Adobe Premiere folder. After doing all of this, reboot your computer.

Then unzip the MPEG2DEC zip file into any directory without spaces and just remember where you put it.

4)

HuffYUV video compressor

This is needed because Premiere will have trouble opening the AVS files unless you have a YUV->RGB converting codec installed. Installing this will fix problems you may have.

II. Ripping the VOB files

This step is pretty easy. Just follow the instructions for your ripping program.

Both ripping programs will allow you to do somethign called "Stream Processing" which essentially will rip out all the parts of the VOB you don't need. When I rip footage, I rip out only the video stream and leave the audio, subtitles, and anything else out of the files I rip to save space. I recommend you do the same. These programs should have help files, and if you still can't figure them out check out Doom9's site for guides on how to rip DVDs.

III. Creating the DVD2AVI project file

Now that you've ripped the VOB files, open up DVD2AVI version 1.76 and select Open from the File menu. Select the first VOB file in whatever series you'll be converting/editing with (i.e. the VOB that ends with 1). It should the automatically add all the rest of the VOBs in the series.

After you select all the video files, click OK. Then open the Audio menu and under the Track submenu, select "None".

Set the Field Options in the Video menu to "Swap Fields". I find this fixes problems with some capture cards (namely the DV500) outputting swapped fields later.

Once you've got all these settings right, select "Save Project" from the File Menu, or just hit f4. Save your project somewhere and then let it go for a while.

IV. Opening VOB files with Frame-Accuracy in Premiere

First create a file with any name, as long as it ends in the extension AVS. This is an AVISynth Scripting file with which we will read the DVD2AVI project file. For those who don't understand this part, what I do is in explorer I say "Next Text Document". This should create a file called "New Text Document.txt". If you do not see the TXT at the end, then you need to go to Tools->Folder Options in Explorer and turn off "Hide File Extensions for Known Types" under the View tab. Then rename this blank file to blahblah.avs, then open it in notepad.

Put the following 2 lines in it:

LoadPlugin("ABOSLUTE PATH TO MPEG2DEC.DLL\MPEG2DEC.DLL")
MPEG2Source("ABSOLUTE PATH TO THE DVD2AVI PROJECT FILE\PROJECT FILENAME.d2v")

Note that you of course must replace the all caps sentences with the proper strings. For instance, an example file for me would be:

LoadPlugin("D:\MPEG2DEC.DLL")
MPEG2Source("D:\Lain\lain_discs_1-4.d2v")

Do NOT have any spaces in the directory paths! For some reason AVISynth with barf and fail to work if there are spaces in the path or filenames!

If you want to edit in Progressive frames, you can use the Decomb Plugin for AVISynth. This is a fantastic plugin for AVISynth that will do what TMPGEnc takes a huge amount of time to do on the fly! However it will significantly slow down your editing, but you will get progressive frames. To utilize Decomb, add the following lines to the AVS file:

LoadPlugin("ABSOLUTE PATH TO DECOMB.DLL")
Telecide()
Decimate(5)

Then in Premiere, open up the AVS file (you did install the AVISynth plugins, right?) and do whatever you want with it. Feel free to create as many AVS files as you want - since we're using a Plugin built directly into AVISynth so it won't get confused.

Please note that for this method to work you need to be working in Premiere at 720x480 or you'll end up with a black video stream (this is a limitation of the AVISynth Premiere Import Plugin). If you want to resize the video, you must do so in the AVS file by adding a line at the very end like this:

BicubicResize(360,480)

If you wanted to resize the video to half the pixels in the horizontal direction. Note you'd have to do deinterlacing if you wanted to resize to any other resolution, and I highly recommend against that so don't do it. =) If you feel that you must you can figure it out yourself by reading the AVISynth documentation.

One thing to be careful about, editing this way take a lot of RAM! Make sure that you have a very very large swap file if you plan on doing this a lot. I'm currently editing a project that has 26 AVS files (one for each episode of the series) and just opening them all causes Premiere to take up 500MB of Virtual Memory (note this is not Physical memory...)! I had to increase my swap space by another Gigabyte, and even then, I periodically save and close Premiere, then reopen it and continue working (as this flushes the cache which is created for the decoding of every single frame that you seek to in the AVS file)!

A word of warning to Premiere 6.0 users!

If you are getting a black screen when you open AVISynth files even when you've maximized the window, it's probably because Premiere 6 thinks you want to work with it in its proper aspect ratio. Since the resolution's 720x480 it automatically applies a 0.900 ratio modifier, making it square again. However, since we cannot resize AVISynth video, this is bad. In the forums, rhoda_b came up with the following solution:

After importing the .avs file into your premiere project. Select the file and from the Clip menu choose Advanced Options -> Pixel Aspect Ratio and choose Square Pixels (1.0) from the drop down box. Then stretch the clip window until it's the full 720 x 480. The picture should magically appear :)

To view the clips in the monitor for preview purposes etc. Choose: Project -> Video Settings and change the pixel aspect ratio to square pixels there as well and make sure the Frame Size is 720x480 or else you'll see nothing ... once again wrangle the monitor window until you have the full frame size.

To export the final project video settings for the frame size and pixel aspect ratio have to be set to 720x480 and square pixels once again. Unfortunately this means you can't export your project from premiere at a different size, but you can then just send the resulting file through VirtualDub.

Frequently Asked Questions

Q: When I try to open the AVISynth file in Premiere, it tells me it can't find a driver for the codec. What's wrong?

A: If you can successfully open the AVISynth file in Windows Media Player or VirtualDub, then you need to install HuffYUV. If none of them will open it, then you have installed AVISynth incorrectly. If you install HuffYUV and it still doesn't work, reinstall Premiere.

Q: When I try to open the file the video stream is this text saying "I don't know what LoadPlugin means" or something.

A: You've installed the wrong version of AVISynth. Go download the latest from VideoTools.

Q: I get a black screen when I'm in Premiere.

A: Make sure the Clip is set to Square Pixel Aspect Ratio if you're in Premiere 6. Also make sure the Project settings themselves are set to Square Pixels. Then make sure the Project's settings are 720x480 resolution. Finally, make sure your Monitor/clip window is enlarged completely to 720x480.

Q: I'm getting some weird discoloration on certain scenes. What's wrong?

A: See this forum thread.

Q: When I try to make the AVI in DVD2AVI it takes forever or doesn't work!

A: That's because you're not supposed to make the AVI file in DVD2AVI, you make a Project File.

Q: I'm getting these weird horizontal lines in my video. What's wrong?

A: That's called interlacing. Read my earlier guides for an explanation of what it is and how do deal with it.

Q: AVISynth says there's an unrecognized exception on Line something or other. What's wrong?

A: You either have the path to your D2V file wrong, there are spaces in the path to the D2V file, or your D2V file is corrupt.

Q: When I try working with the video in Premiere it's all choppy and slow.

A: That's normal. You should preview all of your clips in a different codec like DV or MJPEG. You will not be able to play back AVISynth files in real time.

Next Time - How to do Awesome MPEG Encodes with TMPGEnc