NTSC Interlaced Sources - A Simple Guide
The following is a very simple guide on dealing with NTSC Interlaced sources. At this time, I am not covering such topics as PAL sources, NTSC to PAL conversions (or vice versa), or hybrid interlaced sources. My goal is to provide a very basic step-by-step guide on this topic. My apologies if I "plagerize" from other people, but I'll try my best not to!
At this time this guide does
not get into any heavy definitions nor does it have any screencaps. There are a number of great sites for those, and frankly the topic gets so complicated that reading too much of it can might just make you more confused!
However I would like to provide two links (previously mentioned in this thread) which have provided me with a lot of insight. If you are at all confused about what I write in this guide, I strongly suggest you check out these links for your further edification:
1) Incredible's post
Interlaced / Progressive ... and what it means
2) Doom9's tutorial
Force Film, IVTC, and Deinterlacing
So now, onto the guide!
Step 1: Loading your source
This portion assumes your source is DVD. If you are using DV or VHS capture, I believe the steps are the same (but I can't be certain!)
1. Load your source into DVD2AVI and press [F5] to Preview source
2. Take a look at what is displayed in the Information window on the right. If it says NTSC under Video Type and Interlaced under Frame Type, then this is the guide for you! Otherwise you should probably go somewhere else
3. Under Video -> Field Operation, make sure Force Film is
not selected but instead select None.
4. Press [F4] to save your project as a .d2v file
Step 2: Checking your source
1. Create a simple .avs file loading your .d2v file. The result should look like this:
Code:
MpegSource("clip.d2v")
2. Load your .avs file into VirtualDub and move the trackbar at the bottom of the screen to a point in the film where there is movement. Advance frame-by-frame by using the right arrow key on your keyboard. What you are looking for are occurances of "interlaced" frames, which have a characteristic "combing" effect. For more accurate descriptions and pictures, please go to the links provided above! Depending on what you see, you should hopefully fall into one of the following categories:
1) Telecined NTSC FILM material
This type of film source was originally shot at 23.976fps, but has been "telecined" to 29.970fps. In simple terms, that means a certain number of frames have been repeated in order to stretch (or telecine) the material to fill a longer framerate. If you have this type of source, you will notice when advancing frame-by-frame a pattern of 3 progressive frames (non-interlaced) followed by 2 interlaced frames. If this is the case, you will want to reverse the telecine process to restore the original 23.976fps film material by doing what is called an Inverse Telecine, or IVTC.
To do this, we will start off with the following avs file. Please remember to place a copy of decomb.dll in your Avisynth / Plugins subfolder (if you are using Avs 2.5x) or load the decomb_legacy.dll file in your script if you are using Avs 2.0x. Both filters may be downloaded
here.
Code:
Telecide(Guide=1,Post=false)
Decimate(Cycle=5)
The Post=fale argument turns off post-processing deinterlacer, which will speed up encoding but is only recommended on very "clean" telecined sources. To check this, load your new script into VirtualDub and move to a high action scene, again checking frame-by-frame for any interlaced frames. Here's what you might see:
- If all is good, you will see no more interlaced frames and you are good to go!
- If you see a few stray interlaced frames, then you have two options. First, you can leave things as is since a couple sparse interlaced frames will hardly be noticeable in the final encode. If however you are not satisfied with that, then change the argument to Post=true and you should see no more interlaced frames with the tradeoff of a slightly longer encoding time
2) Pure NTSC VIDEO interlaced material
This type of material is shot at 29.970fps and is 100% interlaced, which means that in our avs script of MpegSource("clip.d2v") we would see in VirtualDub that every single frame is interlaced. One of the best ways to deal with this source is a special form of deinterlacing called convert60ito24p. What this does is it converts the interlaced 29.970fps source to progressive 23.976fps, similar to an inverse telecine. However, note that we are
not dealing with a
telecined 29.970fps source, so what we are doing is not considered IVTC but is actually a form of deinterlacing.
The following script for convert60ito24p was created by scharfis_brain, whose site is
here:
Code:
Mpeg2Source("interlaced_source.d2v")
converttoyuy2() # this line may not be needed, so you can try commenting it out.
# However if you receive the avisynth error "Layer only support
# RGB32 and YUY2 formats" then put it back in!
bob() # or even better "Smoothdeinterlace(doublerate=true, blend=false)"
convert60ito24p(2,0)
# converttoyv12() # Normally I keep this commented out, but if you are having
# problems when encoding in CCE then put it back in
# insert any resizers, filters, and addborders as needed
#
############### the function #############
#
function convert60ito24p (clip video, int mode, int offset)
{
work = assumefieldbased(video)
out = (mode==2) ? interleave(
\selectevery(
\layer(trim(work, 1, 0),
\layer(work, trim(work, 2, 0), "fast"),
\"fast"), 5, 0 + offset),
\selectevery(
\layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\ (mode==1) ? interleave(
\selectevery(trim(work, 1, 0), 5, 0 + offset),
\selectevery(layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\ (mode==0) ? selectevery(work, 5, 1 + offset, 4 + offset) : work
assumeframebased(out)
}
#################################
The above script uses the filter Bob which is built into Avisynth. I found it does an excellent and quick job here, but as suggested by Incredible you might want to try SmoothDeinterlace for higher quality. That filter may be downloaded
here.
3) Progressive NTSC FILM material
With this type of material, you will notice no interlaced frames when using the simple script MpegSource("clip.d2v"). If this is the case, then you are in luck! What you have is actually a progressive NTSC FILM material shot at 23.976fps, but DVD2AVI has
incorrectly recognized it as interlaced. Personally I've never come across this situation but all you have to do is load your VOB back up in DVD2AVI and create a new .d2v project file, but this time enable Force Film. Ta da, this will give you back your original progressive 23.976fps material!
Step 3: Encoding
Before encoding your video, make a final check of either your IVTC or deinterlacing script in Virtualdub and cofirm that your script is free of any avisynth errors and that there are no longer any more interlaced frames. If there are, then either I have made a mistake in this guide, or you have made a mistake in this guide, OR you have a more complicated source that is currently beyond the scope of this guide!
In any event, once you are ready to encode you are safe to add any resizing or motion adaptive filters you want, as long as they are after the IVTC or deinterlacing lines. I have found
Kwag's MA script does an excellent job, but of course there are a multitude of others.