I had some spare time this week so I decided to continue following the steps for the DVD to XviD Conversion Thread. The link is over at https://forum.videohelp.com/threads/166235-DVD-to-XviD-Conversion if you are wondering. OK, so the thread is from 6 years ago. I followed it to the best of my ability with today's applications, but I still have some questions. Here I go...
I clicked on the link for MPEG2DEC3 and it lead me to DGMPGDec. I looked inside the zip folder of this program and there was no MPEG2DEC3.DLL. I tried to get a copy off the internet, but later on in the guide, all the programs had problems opening my script with
as my instructions. So I deleted the useless file I downloaded and tried again. It worked. I do notice I have DGDecode.dll inside the Plugins folder of AVISynth. My question: Do I need MPEG2DEC3.DLL if my programs can read the script without it?Code:MPEG2Source("dvd2avi.d2v")
I have DGIndex 1.5.7. For the Field Option Menu, I get: Honor Pulldown Flags, Ignore Pulldown Flages, and Forced Film. The guide says to select None, but there is no None option. I just selected Honor Pulldown Flags. Is this right?
And for Color Space, where do you get that from? I can't find it.
And that's it. Thanks for anybody who tries to help.
+ Reply to Thread
Results 1 to 5 of 5
You don't need Mpeg2Dec.dll if you're using Mpeg2Source().
Which Field mode you want to use depends on the nature of your source. If the Video is all progressive use Forced Film. If it's interlaced use Honor Pulldown Flags. If it's a mix of soft and hard pulldown use Honor Pulldown Flags and use TFM().TDecimate() to restore 23.976 film frames.
Mpeg2Source() will output YV12 by default. VirtualDub doesn't handle interlaced YV12 properly so you should use YUY2 instead. You can force this in Mpeg2Source() with the upConv option:
Mpeg2Source("filename.d2v", UpConv=1) # UpConv=1 gives YUY2, UpConv=2 gives RGB
VirtualDubMod and I don't think there are any problems so far. It's still encoding though. Is it a problem if VirtualDubMod handles interlaced YV12? I can't see any problems... so I am just checking.
Thanks for the help so far, jagabo, and anybody who has tried.
VirtualDubMod's internal MPEG 2 decoder handles interlaced YV12 correctly. But if you feed it interlaced YV12 from AviSynth it will not be handled correctly. The problem can be subtle with real world video or video with little motion (slightly blurry colors) but it can be very obvious with animated content or real world video with large motions of colored objects:
On the top left is a crop from an interlaced YV12 frame with proper interlaced YV12 chroma handling. You can see that in the black and red area of the wing the comb lines are exactly one line thick and alternate between black and red. On the top right is the same frame after deinterlacing by discarding one field -- there are no comb artifacts left.
On the bottom left is a crop showing VirtualDub's improper handling of interlaced YV12. The red and black comb lines are no longer nice alternating, 1 line thick, black and red lines. At the bottom right you can see that the discard field deinterlace does not leave a clean comb line free result.
First you have to fully understand what interlaced video is. When you watch interlaced NTSC video on an interlaced display you see one field at a time. A field is every other scanline on the face of the CRT. If you number the scanlines from 0 (at the top) to 479 (at the bottom) one field consists of all the even numbered scan lines (called the top field because it contains the topmost scanline), the other consists of all the odd numbered scanlines (called the bottom field because it includes the bottom most scanline -- or because each line is one scanline below the scanlines of the top field). By the time one field is being drawn the other has faded away. So you see 60 (really 59.94 but I'll use 60 as shorthand, I will also use 24 instead of 23.976 later) separate fields per second. The picture always alternates between top and bottom fields and you always see 60 fields per second. This is the only thing you ever see on a standard definition NTSC CRT TV.
When 24 fps film is displayed on an interlaced TV it must be converted from 24 frames per second to 60 fields per second. This is done by pulling fields out of the frames in a 3:2 repeat pattern (3:2 is shorthand for 3,2,3,2,3,2,3,2...) -- ie, the first film frame is displayed for the duration of three fields, the next film frame is repeated for the duration of two fields, the next for three fields, the next for two fields, etc. So what you see on the face of the CRT (using numbers for the film frame numbers, and t/b to represent top and bottom fields from those frames) is:
1t 1b 1t 2b 2t 3b 3t 3b 4t 4b...
Note that the sequence always alternates between top and bottom fields, the fields always repeat in a 3:2 pattern, and the frame numbers are always in order. Since each field lasts for 1/60 of a second, and on average each film frame is displayed for 2.5 fields, the average time each film frame is displayed is 1/60 * 2.5 seconds -- which is 1/24 of a second. So the runtime of the movie doesn't change.
NTSC DVDs can be encoded in two basic ways. Each film frame can be stored as a progressive image and flags inserted into the data to instruct the DVD player how to pull fields out of those frames to send them to the TV at 60 fields per second. Or the film frames can be pulled down first then combined into 29.97 interlaced frames per second. This is often refered to as "hard telecined". It works looks like this:
Film frames: 1, 2, 3, 4....
after 3:2 pulldown: 1t 1b 1t 2b 2t 3b 3t 3b 4t 4b...
fields combined into frames: (1t 1b) (1t 2b) (2t 3b) (3t 3b) (4t 4b)...
Every 4 film frames has become 5 interlaced video frames. 3 of those frames look progressive because both fields come from the same film frame. But two of them look interlaced because the two fields come from different film frames. When the DVD player plays these frames it simply peels each frame apart into two fields and sends one field at a time to the TV.
Now DgIndex... The first case, 24 fps progressive frames with 3:2 pulldown flags, is what DgIndex's Forced Film setting is for. It assumes all the frames are encoded progressively, and there are 24 frames per second. It simply ignores the pulldown flags and returns each frame as encoded.
Unfortunately, the MPEG 2 video on DVDs can switch between the two methods at any time. Very often you'll see that the bulk of a movie is 24 fps progressive but the studio logo at the beginning is hard telecined. Or a bunch of black frames in a fade in/out transistion are encoded interlaced instead of progressive. And sometimes it just switches from progressive to interlaced randomly. In these cases it's best to use Honor Pulldown Flags (the results will always be 30 interlaced frames per second, as if the entire video went through normal 3:2 pulldown) and let the software reconstruct the original film frames (eg. TFM() and TDecimate() in AviSynth).
Another complication is that the pulldown technique can be used for any base frame rate from 20 to 30 fps. In these cases you need further processing to get the original film frames. For example, 25 fps PAL video can be stored at 30 fps interlaced after 3:2:3:2:2 pulldown (every five frames becomes 12 fields, 25 frames become 60 fields, 25 frames per second becomes 60 fields per second).
Yet a further complication is that some DVDs may include full 60 fields per second video (stored as 30 interlace frames per second). DVDs made from camcorders, live sporting events shot on video rather than film, etc. are examples of this. These can't be inverse telecined back to 24 fps because they were never 24 fps to begin with. Attempting to do so will give you jerky video with comb artifacts.
I see. Thanks for the help, jagabo! I appreciate the help you have given.