1. IVTC
The NTSC pulldown pattern (3:2) is a repeating of fields every 4 fields. The odd and even fields have their repeats at oposite times, for instance:
EVEN: 1, 2, 3, 4, 4.
ODD: 1, 2, 2, 3, 4.
This gives you three progressive frames, and two interlaced ones, and that pattern repeats.
In Avisynth you can use a simple function to recover the underlying 23.976p frames as so:
However, it can also be done manually. It's usually not desirable to do it manually, but it does help to understand how to do it nevertheless. One advantage of doing it this way is that you can find where edits were made in the stream that break the pattern.
2. Motion-Adaptive.
Field-blended material. Some people have labelled these "improper conversions", which is unhelpful because it's not the case. If we assume that they were improper conversions, then we assume there's not a proper way to restore them to their original frame-rates. However understanding that they are a proper standards conversion allows us to find the best way to restore their original frame rate. One such method used is described in this patent. It worked by dropping about every 6th frame when going from NTSC to PAL, and by repeating or interpolating every 5th frame the other way.
Prior to the invention of the DEFT device in 1989 it was not possible to IVTC a NTSC telecine. Even after that no method could go from 30i to 25i without field blending. There was a method to go from 25i to 30i without blending, and that involved converting the video to film - developed by the BBC in the 1960's. That method threw away half of the video fields, converting 25i video to 16mm film @ 25fps. Besides the use of film-out as a go-between, if the standards conversion was done before DEFTs were invented your source will have intra-field blending. If it was done sometime in the 90's, there's still every chance they used a motion-adaptive method to go between formats. This is especially the case when going from PAL to NTSC. It is possible to create a 3:2 pulldown from a PAL source as well.
Sometimes you need to use AssumeTFF() or AssumeBFF() at the start of the scripts below to correct the input field order, as IcePrick has found.
2a. Good quality standards conversion
"scharfis_brain" on the Doom9 forums posted a method to remove the field blending. I improved upon the method.
That's just an example. You need to find the right value for FixBlend(try selectevery(4,0) ... (4,1) ... (4,2) ... (4,3) until you find the right value), and you can use whatever bob-deinterlace you want, however QTGMC is very good. The first part of the script does chroma correction - not perfect, but you will notice a significant improvement especially in high-contrast scenes, for quite little cost. The result will still contain ghosting in a number of frames, but should contain no blended frames. It needs to be called two or three times for a whole movie because Avisynth will loose sync eventually, no matter what.
This usually works if the source was done with a good standards converter. This is because the conversion usually runs the whole length of the original format tape at once, converting from NTSC to PAL (or vice versa) on the fly. This is also why the speed doesn't change - the only time the speed would change is if modified equipment was used to change either the playback speed or the recording speed. Although this is possible, after extensive testing on these sources I haven't yet seen one.
2b. Poorer quality standards conversion
If the pattern doesn't seem repeat itself, first confirm the original framerate. Use separatefields and count out the number of unique frames in the video over a length of 500 or so. This gives you the true framerate, so that when you use "changefps" you can use the correct value - if it still doesn't work, and you know the correct framerate, this is a poorer quality standards conversion and you need to use Srestore. Srestore doesn't like going to non-integer framerates, it's usually best to use assumefps first to change the framerate to a value that will allow the restored value to be a whole number. Of course, just like above you need to bob-deinterlace first.
Here's an example:
3. DEFT
The DEFT (Digital Electronic Film Transfer) device was the first device to be able to automatically identify duplicate fields and remove them whilst converting the video from 59.94Hz to 47.952Hz. The DEFT device won an Emmy award in 1994 - it was the best, by far, way to convert a NTSC telecine to PAL. In order to record the output onto a PAL tape, a modified recording device would be used that would record the tape at 47.952Hz instead of 50Hz. Here's a paper by the company that made the device, with an explanation of how standards conversions work. Essentially it's a device that IVTC's a NTSC telecine, it works pretty well, but it does leave behind a few problem fields throughout the output, and also pretty much all frames have some quite light combing due to individual filed resizing (and some frames have worse combing). There's a very very easy way to fix this:
On those settings, it doesn't distort the output or lose detail, all the combing is fixed, and there will be no more interlaced frames. Tweak the 'Grainrestore' option from 0 to 1 as desired.
The NTSC pulldown pattern (3:2) is a repeating of fields every 4 fields. The odd and even fields have their repeats at oposite times, for instance:
EVEN: 1, 2, 3, 4, 4.
ODD: 1, 2, 2, 3, 4.
This gives you three progressive frames, and two interlaced ones, and that pattern repeats.
In Avisynth you can use a simple function to recover the underlying 23.976p frames as so:
Code:
TFM(order=0)
TDecimate()
However, it can also be done manually. It's usually not desirable to do it manually, but it does help to understand how to do it nevertheless. One advantage of doing it this way is that you can find where edits were made in the stream that break the pattern.
Code:
converttoyv24()
separatefields()
fields_evn=selecteven()
fields_odd=selectodd()
fields_evn
fields_evn=interleave(selectevery(5,0), \
selectevery(5,1), \
average(selectevery(5,2),0.5,selectevery(5,3),0.5), \
selectevery(5,4))
fields_odd
fields_odd=interleave(average(selectevery(5,0),0.5,selectevery(5,1),0.5), \
selectevery(5,2), \
selectevery(5,3), \
selectevery(5,4))
interleave(fields_evn,fields_odd)
weave()
converttoyv12()
2. Motion-Adaptive.
Field-blended material. Some people have labelled these "improper conversions", which is unhelpful because it's not the case. If we assume that they were improper conversions, then we assume there's not a proper way to restore them to their original frame-rates. However understanding that they are a proper standards conversion allows us to find the best way to restore their original frame rate. One such method used is described in this patent. It worked by dropping about every 6th frame when going from NTSC to PAL, and by repeating or interpolating every 5th frame the other way.
Prior to the invention of the DEFT device in 1989 it was not possible to IVTC a NTSC telecine. Even after that no method could go from 30i to 25i without field blending. There was a method to go from 25i to 30i without blending, and that involved converting the video to film - developed by the BBC in the 1960's. That method threw away half of the video fields, converting 25i video to 16mm film @ 25fps. Besides the use of film-out as a go-between, if the standards conversion was done before DEFTs were invented your source will have intra-field blending. If it was done sometime in the 90's, there's still every chance they used a motion-adaptive method to go between formats. This is especially the case when going from PAL to NTSC. It is possible to create a 3:2 pulldown from a PAL source as well.
Sometimes you need to use AssumeTFF() or AssumeBFF() at the start of the scripts below to correct the input field order, as IcePrick has found.
2a. Good quality standards conversion
"scharfis_brain" on the Doom9 forums posted a method to remove the field blending. I improved upon the method.
Code:
separatefields()
PointResize(width(),height()*2)
interleave(selecteven().crop(0,2,0,0).addborders(0,0,0,2),selectodd())
interleave(repair(selecteven(),selectodd(),0,9,9),repair(selectodd(),selecteven(),0,9,9))
interleave(selecteven().crop(0,0,0,-2).addborders(0,2,0,0),selectodd())
crop(0,4,0,-4)
PointResize(width(),height()/2)
weave()
QTGMC(Preset="Placebo")
AssumeFPS(60000,1001)
Part1=trim(0,183056).FixBlend()
Part2=trim(183057,0).FixBlend()
Part1 ++ Part2
Function FixBlend(clip orig){
orig.changefps(25*4,linear=false)
selectevery(4,2)
return last
}
That's just an example. You need to find the right value for FixBlend(try selectevery(4,0) ... (4,1) ... (4,2) ... (4,3) until you find the right value), and you can use whatever bob-deinterlace you want, however QTGMC is very good. The first part of the script does chroma correction - not perfect, but you will notice a significant improvement especially in high-contrast scenes, for quite little cost. The result will still contain ghosting in a number of frames, but should contain no blended frames. It needs to be called two or three times for a whole movie because Avisynth will loose sync eventually, no matter what.
This usually works if the source was done with a good standards converter. This is because the conversion usually runs the whole length of the original format tape at once, converting from NTSC to PAL (or vice versa) on the fly. This is also why the speed doesn't change - the only time the speed would change is if modified equipment was used to change either the playback speed or the recording speed. Although this is possible, after extensive testing on these sources I haven't yet seen one.
2b. Poorer quality standards conversion
If the pattern doesn't seem repeat itself, first confirm the original framerate. Use separatefields and count out the number of unique frames in the video over a length of 500 or so. This gives you the true framerate, so that when you use "changefps" you can use the correct value - if it still doesn't work, and you know the correct framerate, this is a poorer quality standards conversion and you need to use Srestore. Srestore doesn't like going to non-integer framerates, it's usually best to use assumefps first to change the framerate to a value that will allow the restored value to be a whole number. Of course, just like above you need to bob-deinterlace first.
Here's an example:
Code:
QTGMC(Preset="Placebo")
AssumeFPS(60)
srestore(frate=24,speed=-25)
AssumeFPS(24000,1001)
3. DEFT
The DEFT (Digital Electronic Film Transfer) device was the first device to be able to automatically identify duplicate fields and remove them whilst converting the video from 59.94Hz to 47.952Hz. The DEFT device won an Emmy award in 1994 - it was the best, by far, way to convert a NTSC telecine to PAL. In order to record the output onto a PAL tape, a modified recording device would be used that would record the tape at 47.952Hz instead of 50Hz. Here's a paper by the company that made the device, with an explanation of how standards conversions work. Essentially it's a device that IVTC's a NTSC telecine, it works pretty well, but it does leave behind a few problem fields throughout the output, and also pretty much all frames have some quite light combing due to individual filed resizing (and some frames have worse combing). There's a very very easy way to fix this:
Code:
QTGMC(Preset="Placebo",TR2=0,NoiseProcess=2,NoiseRestore=0,GrainRestore=0.5)
selecteven()
On those settings, it doesn't distort the output or lose detail, all the combing is fixed, and there will be no more interlaced frames. Tweak the 'Grainrestore' option from 0 to 1 as desired.