Note
This page contains text in code colour that can be copied to create AVISynth scripts for dealing with the various types
of interlaced video. Due to a limitation of the website software, each line needs to be copied individually because the
hard return/Enter at the end of each line is not copied.
Introduction
Interlacing-What is it?
This is interlacing: the jaggies:
and this is the same file deinterlaced in Virtual Dub:
and deinterlaced with AVISynth using QTGMC in basic mode:
Interlaced video is video where a frame is made up of two fields. Each field is displayed with a very slight time delay
but gives the impression of a single frame because the short time delay cannot be detected by the human eye/brain.
Interlaced video was designed for early TV broadcasts and CRT TVs when the available bandwidth was low; sending
a frame split into two fields reduced the bandwidth required. With the advent of more available broadcast bandwidth
and modern, progressive computer displays, interlacing is no longer necessary. The vast majority of modern video,
including phones, is Progressive, meaning there are no fields. Each frame is separate and different from the one
before and the one after. An exception is DVDs, which use Interlaced video, which is decoded by the player to display
properly on screens.
The world of analogue video, however, is still interlaced. The output from VCRs and tape-based video cameras is all
Interlaced, either captured using a digitiser or transferred by Firewire. If not removed or processed correctly (called
“deinterlaicng”), this will result in jagged edges on moving objects. This processing can be done at the player point;
most software video players will have a deinterlacing function and modern TVs also have good inbuilt deinterlacers,
but some applications such as YouTube operate in the Progressive domain and it is considered better to upload
Progressive video.
While there are programs (eg the Elgato Video Capture software, OBS)/digitisers that allow “on the fly” deinterlacing
during capture, this is generally not recommended for the highest quality captures because of the load on the system.
Also, it is generally considered that the best deinterlacers are used after capture eg QTGMC (in AVISynth or it’s GUIs).
Furthermore, if the deinterlacing is done incorrectly or in the wrong sequence eg if you resize first, the jaggies can be
permanently burned into the video and cannot be perfectly corrected.
Field Order
The order of fields in an interlaced frame can only be one of two: either Top Field First (TFF) or Bottom Field First
(BFF). Generally speaking, analogue captures from VCRs and the like, using USB digitisers, are TFF. Digital Video
(DV) transfers from Digital 8 or MiniDV camcorders using FireWire are generally BFF. Determining the field order helps
various aspects of video restoration. On most occasions though, if you get the field order wrong in a setting, it will be
obvious because any motion will be forward-backward eg two steps forward, one step backward, then two steps
forward.
You can determine the field order of an interlaced file by easily doing a double-frame-rate deinterlace. This can be
done, as described below, in Virtual Dub with the Deinterlace filter and setting Yadif and Double Frame Rate Top Field
First. Check the motion; if it is forward-backward, you have the wrong field order set; it will be BFF.
To complicate matters, there are different types of interlacing, as described below.
Determining interlacing type
There are five common types of video files and they are all treated differently with respect to deinterlacing. So how do
you work out which one your video is? Fortunately, this is easy to work out by stepping through the file, firstly frame by
frame, to see if there are any interlacing artefacts (jaggies) visible in scenes with movement. The very nature of
interlacing, where each field is from a different point in time, means that jagged edges will show whenever there is
movement. In some videos, only some frames are interlaced (Pulldown). In other videos, even with movement, there
are no jaggies (PSF and Progressive).
This frame analysis must be done in a program that does not automatically deinterlace a file. Virtual Dub is good for
this purpose. VLC Player is not, because it will deinterlace most files.
To further examine a video, we can step through the video and observe each field by field (not frame by frame), and
note the motion. This can be achieved with Virtual Dub using the Deinterlace filter and setting the frame rate to double.
Set up the VDub Deinterlace filter like this:
Click OK and OK to exit the filter dialogue and step through the video.
The experts use AVISynth to analyse the structure of a video. Opening a file using the LWLibavVideoSource() filter will
reveal the true state of the file’s interlacing. For example, I have seen a file where VDub shows it to be telecined with
4:1 pulldown, whereas AVISynth shows it’s true state of 3:2 pulldown. It’s worth noting however that the “fix” for each
scenario is the same. so given that examining a file is easier in VDub, for normal analysis, it will be fine.
To Deinterlace… or Not
The $64,000 question has arguments for and against. I prefer to deinterlace my videos, which are predominately either
camcorder recordings or captured analogue video from VCRs. Double-framerate deinterlacing of these types of of
video means that the video’s motion is smoother because each field is converted into a frame and the motion is
therefore spread out over double the number of frames (shot at 25fps, deinterlaced to 50fps). There is also no chance
that a player will mess up the deinterlacing. I always deinterlace when uploading to YouTube or social media.
Interlacing Types and Processing
The following sections detail the various types of interlacing and what to do about them. Proceed down the page until
you find the type that corresponds to your video.
In this guide, “P” indicates a progressive frame, where no jaggies are present.
“I” indicates an Interlaced frame, where jaggies are present.
A sequence of numbers will be used to denote different frames. For example, 1234456788 indicates a pattern of 4
unique frames followed by one duplicate, then the cycle is repeated.
Full-Interlacing
Frame Pattern: IIIIIIIII with jaggies on every frame (where there’s movement).
When the video is double-rate deinterlaced, each field is obviously different.
Full-interlacing is found in almost all types of videotape, including from camcorders and captures from VHS and Beta
tapes. Full-interlacing can also be found on DVDs and is sometimes broadcast over the air for TVs. In these cases,
every frame is interlaced.
When deinterlacing fully-interlaced video, it is best to deinterlace to double frame rate because the video will appear
smoother; there will be effectively double the number of frames covering the same amount of motion after the
deinterlacing process. This results in noticeable improvement in the smoothness of movement of video from
camcorders and VCRs.
The best method of deinterlacing this is to use AVISynth/QTGMC. Other options include VDub (as described above)
and other programs such as Handbrake, which has a deinterlace function in the Filters tab. For full interlacing, your
video editor may well do a good job. For example, if Magix Video Deluxe or VPX is set up correctly, deinterlacing
comes out nicely, especially for DV-AVI.
To use QTGMC, you will first need to use or install AVISynth. There are various ways of doing this; I prefer the
“manual” method where I write my own scripts. This isn’t particularly difficult when you get the hang of it. I have a
comprehensive guide for installing and setting-up AVISynth, together with the dependencies required for QTGMC,
here.
A typical AVISynth script using QTGMC to deinterlace is:
Typical AVISynth+ script to run the QTGMC Deinterlacer
A typical AVISynth script which uses QTGMC to deinterlace an AVI video and double the framerate follows, with
explanatory comments following.
SetFilterMTMode ("QTGMC", 2)
AviSource("H:\racwa\aeroclub-int.avi")
ConvertToYV16(interlaced=true)
AssumeTFF()
QTGMC(preset="Fast", EdiThreads=8) # set EdiThreads to half the system cores you have
Prefetch(24) # set to the number of Logical Processors in your CPU
Explaining the various parts:
SetFilterMTMode ("QTGMC", 2)
Tells AVISynth what multi-threading mode to use.
AviSource("H:\racwa\aeroclub-int.avi")
Tells AVISynth what “source filter” to use to open the file, and it’s location. Always wrap the full name in quotes. If the
AVS file is saved in the same folder as the video file you’re processing, you don’t need the drive and parent folder in
the name.
Tip: use the Windows RC menu “Copy as Path” item to copy the complete file name, then paste it in.
There are other source filters for opening other types of files eg MPEGs, MOVs, MP4s. For example, you cannot use
“AVISource” to open an MP4. Other source filters are shown lower down this page.
ConvertToYV16(interlaced=true)
Converts file to the required colour space.
AssumeTFF()
Tells QTGMC what the interlace status of the file is. Almost all analogue captures are Top Field First; DV files from DV
camcorders are almost always Bottom Field First, so if you’re working on DV, use “BFF”. In any case, if you get it
wrong, you’ll notice forward-backward-forward movement when you step through the video frame by frame in VDub.
Simply change to the other option.
QTGMC(preset="Fast", EdiThreads=8)
Tells AVISynth to execute QTGMC using the “fast” preset and to use the extra threads in your CPU to speed up
processing. Set the EdiThreads to half the system cores you have (Task Manager>Performance has the number of
cores in your CPU). QTGMC defaults to double-framerate mode; it splits each field into a frame.
Prefetch(24)
Tells AVISynth to use the available cores in your CPU to speed up the process. Set it to the number of Logical
Processors in your CPU, available from Task Manager. If you have issues, reduce the number progressively.
Here are some sample full-interlaced files for you to experiment with (not all files have full-interlacing; for example,
converting telecined movies to progressive video require different treatment. See my page on Deinterlacing for
details).
AVI
•
f18
•
aeroclub
MPEG 2
•
aircraft MPEG2 (requires a different source-opening filter)
Open your AVS file in VDub and, fingers crossed, you’ll shortly be looking at a crisp, smooth, deinterlaced AVI.
You can now continue editing it, perhaps trimming and deleting parts, and/or exporting it in whatever format you wish
to either continue editing elsewhere or save as an MP4 for distribution.
Examples of fully-interlaced files:
•
aeroclub AVI
•
jet AVI
•
aircraft MPEG2
Full Interlacing-But Really Field-Shifted Progressive!
Frame pattern: IIIIIIII with jaggies, but when double-rate deinterlaced, you get duplicated frames eg 11223344556677
(with very slight differences).
This is very similar to Progressive Segmented Frame (PSF) mentioned below.
What looks like a fully interlaced file can actually be progressive, would you believe it. This would have been created
by a botched re-encode and is not normal.
To fix, the preference is to use AVISynth>TFM(), but practically, if you simply single-rate deinterlace it, the result will be
similar. Even if you double-rate deinterlace it, the overall effect will be the same, except that you’ll have duplicates,
which isn’t an issue because the frame rate has doubled.
Examples file of a Progressive file that looks interlaced:
•
Progessive with interlace jaggies
•
Band-Field-Shifted Progressive
Suggested code (from @sharc at VH):
AVISource("band-field_shifted_prog.avi")
TFM()
QTGMC(InputType=3)
Extra filter code for that particular band video to tidy it up (not needed for good quality FSP):
Spotless(RadT=3) # to remove the black spots
temporaldegrain2(degrainTR=3) # overall denoise
From this VH topic:
https://forum.videohelp.com/threads/419553-vhs-concert-anyway-to-fix#post2787817
Telecined Video
Telecine is the process of converting film (24fps) to video NTSC (29.97fps) or PAL (25fps) for broadcast over the TV
networks.
In most cases, telecined video should not be deinterlaced because only some frames are truly interlaced. Therefore,
do not use QTGMC on telecined video until the video has been de/inverse telecined.
Two “P” frames followed by three “I” frames
Frames pattern PPIII
aud=ffaudiosource("VTS_01_1.mpg",track=-1)
vid=ffvideosource("VTS_01_1.mpg", track=-1, seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
QTGMC(preset="fast")
srestore(frate=23.976)
Three “P” frames followed by two “I” frames
Frame pattern: PPPII PPPII PPPII
This is the classic film (24fps) to NTSC (29.97) telecine conversion.
A quirk of broadcasting film to NTSC TVs (over the air or from NTSC DVDs) is the need to change the framerate to
29.97. Because the film was originally shot at 24fps, a method called telecine is used to increase the frames per
second (from 24fps ~23.976 to 29.97). This is done by mixing frames to create the extras required. The practical effect
of this is that there is a mix of fully-frames and interlaced frames. One common technique is called 3:2 Pulldown and is
described in detail here. In a nutshell, you get frames running like this: PPPIIPPPII, meaning 3 progressive frames
(with no interlacing) then 2 interlaced frames, and the pattern repeats. This is shown in this image from Wiki:
The pulldown effect, as you would see it in VDub, is shown nicely on this Netflix tech page here.
To get the smoothest and crispest playback of the digital file after, for example, being captured from a VHS tape of the
movie, one needs to “inverse/reverse/de” telecine the file back to it’s original 23.976 (close to 24) fps. The technique to
do so is called IVTC, and can be done in Virtual Dub, AVISynth (via coding) and other programs.
24fps vs 23.976fps? 23.976 is easier to convert to and from 29.97, and is deemed to be so close to 24fps that nobody
would notice.
To de-telecine a 3:2 Pulldown video:
•
VDub, set up the IVTC filter like this:
This will remove the pulldown, clearing the interlacing at frames 3 and 4, and restore the video to the original (film)
frame rate of 23.976.
•
AVISynth, use the TIVTC filter:
aud=ffaudiosource("file.mkv",track=-1)
vid=ffvideosource("file.mkv", track=-1, seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
TFM()
Tdecimate()
Example of a 3:2 pulldown video:
•
hunters
Three “P” frames followed by three “I” frames
Original 25fps footage which has been converted to 29.97fps that needs to be put back to 25fps.
Frame pattern: PPPIII PPPIII PPPIII
TFM()
TDecimate(Cycle=6, CycleR=1)
The TDecimate parameters mean “in every 6 frames, remove 1”, the 1 frame being a duplicate generated after TFM.
This code will result in an fps of 24.975, because the original PAL file had to be set to that for the conversion to NTSC
to be correct. To speed it up to 25fps exactly, use this code after TDecimate (the “True” keeps the audio in sync):
AssumeFPS(25, True)
Example: this video is actually a combo PPPIII and PPPPII video:
•
33pulldown.mkv
Four “P” frames followed by two “I” frames
Frame pattern: PPPPII PPPPII PPPPII
This indicates a PAL source converted to NTSC. The solution is the same as for PPPIII above:
TFM()
TDecimate(Cycle=6, CycleR=1)
AssumeFPS(25,True)
Example file of a 4-2 File:
•
4-2elephants.mkv
This scenario is discussed in this VH topic:
https://forum.videohelp.com/threads/417016-Deinterlace-video-help#top
Every 5th frame is a Repeat
Frame pattern 12344 56788
This can occur if a 3:2 pulldown video is deinterlaced or if the 3:2 pulldown flag in the file header is not read properly. A
field pattern of 12344 56788 results (one duplicated frame after each 4, that is, frame 5 is the same as frame 4),
resulting in a slightly jerky video.
Options for removal of the 5th frame and restoration to the film frame rate of 23.976 include:
Note
This page contains text in code colour that can be
copied to create AVISynth scripts for dealing with
the various types of interlaced video. Due to a
limitation of the website software, each line needs to
be copied individually because the hard return/Enter
at the end of each line is not copied.
Introduction
Interlacing-What is it?
This is interlacing: the jaggies:
and this is the same file deinterlaced in Virtual Dub:
and deinterlaced with AVISynth using QTGMC in
basic mode:
Interlaced video is video where a frame is made up
of two fields. Each field is displayed with a very
slight time delay but gives the impression of a single
frame because the short time delay cannot be
detected by the human eye/brain. Interlaced video
was designed for early TV broadcasts and CRT TVs
when the available bandwidth was low; sending a
frame split into two fields reduced the bandwidth
required. With the advent of more available
broadcast bandwidth and modern, progressive
computer displays, interlacing is no longer
necessary. The vast majority of modern video,
including phones, is Progressive, meaning there are
no fields. Each frame is separate and different from
the one before and the one after. An exception is
DVDs, which use Interlaced video, which is
decoded by the player to display properly on
screens.
The world of analogue video, however, is still
interlaced. The output from VCRs and tape-based
video cameras is all Interlaced, either captured
using a digitiser or transferred by Firewire. If not
removed or processed correctly (called
“deinterlaicng”), this will result in jagged edges on
moving objects. This processing can be done at the
player point; most software video players will have a
deinterlacing function and modern TVs also have
good inbuilt deinterlacers, but some applications
such as YouTube operate in the Progressive domain
and it is considered better to upload Progressive
video.
While there are programs (eg the Elgato Video
Capture software, OBS)/digitisers that allow “on the
fly” deinterlacing during capture, this is generally not
recommended for the highest quality captures
because of the load on the system. Also, it is
generally considered that the best deinterlacers are
used after capture eg QTGMC (in AVISynth or it’s
GUIs).
Furthermore, if the deinterlacing is done incorrectly
or in the wrong sequence eg if you resize first, the
jaggies can be permanently burned into the video
and cannot be perfectly corrected.
Field Order
The order of fields in an interlaced frame can only
be one of two: either Top Field First (TFF) or Bottom
Field First (BFF). Generally speaking, analogue
captures from VCRs and the like, using USB
digitisers, are TFF. Digital Video (DV) transfers from
Digital 8 or MiniDV camcorders using FireWire are
generally BFF. Determining the field order helps
various aspects of video restoration. On most
occasions though, if you get the field order wrong in
a setting, it will be obvious because any motion will
be forward-backward eg two steps forward, one
step backward, then two steps forward.
You can determine the field order of an interlaced
file by easily doing a double-frame-rate deinterlace.
This can be done, as described below, in Virtual
Dub with the Deinterlace filter and setting Yadif and
Double Frame Rate Top Field First. Check the
motion; if it is forward-backward, you have the
wrong field order set; it will be BFF.
To complicate matters, there are different types of
interlacing, as described below.
Determining interlacing type
There are five common types of video files and they
are all treated differently with respect to
deinterlacing. So how do you work out which one
your video is? Fortunately, this is easy to work out
by stepping through the file, firstly frame by frame,
to see if there are any interlacing artefacts (jaggies)
visible in scenes with movement. The very nature of
interlacing, where each field is from a different point
in time, means that jagged edges will show
whenever there is movement. In some videos, only
some frames are interlaced (Pulldown). In other
videos, even with movement, there are no jaggies
(PSF and Progressive).
This frame analysis must be done in a program that
does not automatically deinterlace a file. Virtual Dub
is good for this purpose. VLC Player is not, because
it will deinterlace most files.
To further examine a video, we can step through the
video and observe each field by field (not frame by
frame), and note the motion. This can be achieved
with Virtual Dub using the Deinterlace filter and
setting the frame rate to double.
Set up the VDub Deinterlace filter like this:
Click OK and OK to exit the filter dialogue and step
through the video.
The experts use AVISynth to analyse the structure
of a video. Opening a file using the
LWLibavVideoSource() filter will reveal the true state
of the file’s interlacing. For example, I have seen a
file where VDub shows it to be telecined with 4:1
pulldown, whereas AVISynth shows it’s true state of
3:2 pulldown. It’s worth noting however that the “fix”
for each scenario is the same. so given that
examining a file is easier in VDub, for normal
analysis, it will be fine.
To Deinterlace… or Not
The $64,000 question has arguments for and
against. I prefer to deinterlace my videos, which are
predominately either camcorder recordings or
captured analogue video from VCRs. Double-
framerate deinterlacing of these types of of video
means that the video’s motion is smoother because
each field is converted into a frame and the motion
is therefore spread out over double the number of
frames (shot at 25fps, deinterlaced to 50fps). There
is also no chance that a player will mess up the
deinterlacing. I always deinterlace when uploading
to YouTube or social media.
Interlacing Types and Processing
The following sections detail the various types of
interlacing and what to do about them. Proceed
down the page until you find the type that
corresponds to your video.
In this guide, “P” indicates a progressive frame,
where no jaggies are present.
“I” indicates an Interlaced frame, where jaggies are
present.
A sequence of numbers will be used to denote
different frames. For example, 1234456788
indicates a pattern of 4 unique frames followed by
one duplicate, then the cycle is repeated.
Full-Interlacing
Frame Pattern: IIIIIIIII with jaggies on every frame
(where there’s movement).
When the video is double-rate deinterlaced, each
field is obviously different.
Full-interlacing is found in almost all types of
videotape, including from camcorders and captures
from VHS and Beta tapes. Full-interlacing can also
be found on DVDs and is sometimes broadcast over
the air for TVs. In these cases, every frame is
interlaced.
When deinterlacing fully-interlaced video, it is best
to deinterlace to double frame rate because the
video will appear smoother; there will be effectively
double the number of frames covering the same
amount of motion after the deinterlacing process.
This results in noticeable improvement in the
smoothness of movement of video from camcorders
and VCRs.
The best method of deinterlacing this is to use
AVISynth/QTGMC. Other options include VDub (as
described above) and other programs such as
Handbrake, which has a deinterlace function in the
Filters tab. For full interlacing, your video editor may
well do a good job. For example, if Magix Video
Deluxe or VPX is set up correctly, deinterlacing
comes out nicely, especially for DV-AVI.
To use QTGMC, you will first need to use or install
AVISynth. There are various ways of doing this; I
prefer the “manual” method where I write my own
scripts. This isn’t particularly difficult when you get
the hang of it. I have a comprehensive guide for
installing and setting-up AVISynth, together with the
dependencies required for QTGMC, here.
A typical AVISynth script using QTGMC to
deinterlace is:
Typical AVISynth+ script to run the
QTGMC Deinterlacer
A typical AVISynth script which uses QTGMC to
deinterlace an AVI video and double the framerate
follows, with explanatory comments following.
SetFilterMTMode ("QTGMC", 2)
AviSource("H:\racwa\aeroclub-int.avi")
ConvertToYV16(interlaced=true)
AssumeTFF()
QTGMC(preset="Fast", EdiThreads=8) # set
EdiThreads to half the system cores you have
Prefetch(24) # set to the number of Logical
Processors in your CPU
Explaining the various parts:
SetFilterMTMode ("QTGMC", 2)
Tells AVISynth what multi-threading mode to use.
AviSource("H:\racwa\aeroclub-int.avi")
Tells AVISynth what “source filter” to use to open the
file, and it’s location. Always wrap the full name in
quotes. If the AVS file is saved in the same folder as
the video file you’re processing, you don’t need the
drive and parent folder in the name.
Tip: use the Windows RC menu “Copy as Path” item
to copy the complete file name, then paste it in.
There are other source filters for opening other
types of files eg MPEGs, MOVs, MP4s. For
example, you cannot use “AVISource” to open an
MP4. Other source filters are shown lower down this
page.
ConvertToYV16(interlaced=true)
Converts file to the required colour space.
AssumeTFF()
Tells QTGMC what the interlace status of the file is.
Almost all analogue captures are Top Field First; DV
files from DV camcorders are almost always Bottom
Field First, so if you’re working on DV, use “BFF”. In
any case, if you get it wrong, you’ll notice forward-
backward-forward movement when you step
through the video frame by frame in VDub. Simply
change to the other option.
QTGMC(preset="Fast", EdiThreads=8)
Tells AVISynth to execute QTGMC using the “fast”
preset and to use the extra threads in your CPU to
speed up processing. Set the EdiThreads to half the
system cores you have (Task
Manager>Performance has the number of cores in
your CPU). QTGMC defaults to double-framerate
mode; it splits each field into a frame.
Prefetch(24)
Tells AVISynth to use the available cores in your
CPU to speed up the process. Set it to the number
of Logical Processors in your CPU, available from
Task Manager. If you have issues, reduce the
number progressively.
Here are some sample full-interlaced files for you to
experiment with (not all files have full-interlacing; for
example, converting telecined movies to
progressive video require different treatment. See
my page on Deinterlacing for details).
AVI
•
f18
•
aeroclub
MPEG 2
•
aircraft MPEG2 (requires a different source-
opening filter)
Open your AVS file in VDub and, fingers crossed,
you’ll shortly be looking at a crisp, smooth,
deinterlaced AVI.
You can now continue editing it, perhaps trimming
and deleting parts, and/or exporting it in whatever
format you wish to either continue editing elsewhere
or save as an MP4 for distribution.
Examples of fully-interlaced files:
•
aeroclub AVI
•
jet AVI
•
aircraft MPEG2
Full Interlacing-But Really Field-Shifted
Progressive!
Frame pattern: IIIIIIII with jaggies, but when double-
rate deinterlaced, you get duplicated frames eg
11223344556677 (with very slight differences).
This is very similar to Progressive Segmented
Frame (PSF) mentioned below.
What looks like a fully interlaced file can actually be
progressive, would you believe it. This would have
been created by a botched re-encode and is not
normal.
To fix, the preference is to use AVISynth>TFM(), but
practically, if you simply single-rate deinterlace it,
the result will be similar. Even if you double-rate
deinterlace it, the overall effect will be the same,
except that you’ll have duplicates, which isn’t an
issue because the frame rate has doubled.
Examples file of a Progressive file that looks
interlaced:
•
Progessive with interlace jaggies
•
Band-Field-Shifted Progressive
Suggested code (from @sharc at VH):
AVISource("band-field_shifted_prog.avi")
TFM()
QTGMC(InputType=3)
Extra filter code for that particular band video to tidy
it up (not needed for good quality FSP):
Spotless(RadT=3) # to remove the black spots
temporaldegrain2(degrainTR=3) # overall denoise
From this VH topic:
https://forum.videohelp.com/threads/419553-vhs-
concert-anyway-to-fix#post2787817
Telecined Video
Telecine is the process of converting film (24fps) to
video NTSC (29.97fps) or PAL (25fps) for broadcast
over the TV networks.
In most cases, telecined video should not be
deinterlaced because only some frames are truly
interlaced. Therefore, do not use QTGMC on
telecined video until the video has been de/inverse
telecined.
Two “P” frames followed by three “I” frames
Frames pattern PPIII
aud=ffaudiosource("VTS_01_1.mpg",track=-1)
vid=ffvideosource("VTS_01_1.mpg", track=-1,
seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
QTGMC(preset="fast")
srestore(frate=23.976)
Three “P” frames followed by two “I” frames
Frame pattern: PPPII PPPII PPPII
This is the classic film (24fps) to NTSC (29.97)
telecine conversion.
A quirk of broadcasting film to NTSC TVs (over the
air or from NTSC DVDs) is the need to change the
framerate to 29.97. Because the film was originally
shot at 24fps, a method called telecine is used to
increase the frames per second (from 24fps
~23.976 to 29.97). This is done by mixing frames to
create the extras required. The practical effect of
this is that there is a mix of fully-frames and
interlaced frames. One common technique is called
3:2 Pulldown and is described in detail here. In a
nutshell, you get frames running like this:
PPPIIPPPII, meaning 3 progressive frames (with no
interlacing) then 2 interlaced frames, and the
pattern repeats. This is shown in this image from
Wiki:
The pulldown effect, as you would see it in VDub, is
shown nicely on this Netflix tech page here.
To get the smoothest and crispest playback of the
digital file after, for example, being captured from a
VHS tape of the movie, one needs to
“inverse/reverse/de” telecine the file back to it’s
original 23.976 (close to 24) fps. The technique to
do so is called IVTC, and can be done in Virtual
Dub, AVISynth (via coding) and other programs.
24fps vs 23.976fps? 23.976 is easier to convert to
and from 29.97, and is deemed to be so close to
24fps that nobody would notice.
To de-telecine a 3:2 Pulldown video:
•
VDub, set up the IVTC filter like this:
This will remove the pulldown, clearing the
interlacing at frames 3 and 4, and restore the video
to the original (film) frame rate of 23.976.
•
AVISynth, use the TIVTC filter:
aud=ffaudiosource("file.mkv",track=-1)
vid=ffvideosource("file.mkv", track=-1,
seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
TFM()
Tdecimate()
Example of a 3:2 pulldown video:
•
hunters
Three “P” frames followed by three “I” frames
Original 25fps footage which has been converted to
29.97fps that needs to be put back to 25fps.
Frame pattern: PPPIII PPPIII PPPIII
TFM()
TDecimate(Cycle=6, CycleR=1)
The TDecimate parameters mean “in every 6
frames, remove 1”, the 1 frame being a duplicate
generated after TFM.
This code will result in an fps of 24.975, because
the original PAL file had to be set to that for the
conversion to NTSC to be correct. To speed it up to
25fps exactly, use this code after TDecimate (the
“True” keeps the audio in sync):
AssumeFPS(25, True)
Example: this video is actually a combo PPPIII and
PPPPII video:
•
33pulldown.mkv
Four “P” frames followed by two “I” frames
Frame pattern: PPPPII PPPPII PPPPII
This indicates a PAL source converted to NTSC.
The solution is the same as for PPPIII above:
TFM()
TDecimate(Cycle=6, CycleR=1)
AssumeFPS(25,True)
Example file of a 4-2 File:
•
4-2elephants.mkv
This scenario is discussed in this VH topic:
https://forum.videohelp.com/threads/417016-
Deinterlace-video-help#top
Every 5th frame is a Repeat
Frame pattern 12344 56788
This can occur if a 3:2 pulldown video is
deinterlaced or if the 3:2 pulldown flag in the file
header is not read properly. A field pattern of 12344
56788 results (one duplicated frame after each 4,
that is, frame 5 is the same as frame 4), resulting in
a slightly jerky video.
Options for removal of the 5th frame and restoration
to the film frame rate of 23.976 include: