525/60
2nd April 2007, 18:04
My goal is to remove every duplicate field in a Silent Film regardless of framerate. But first I have to explain the problem in a little tutorial before I can ask the question.
Silent Films were shot somewhere between 18fps and 22fps, but never at 24fps. Like modern films, they where never interlaced. Like modern films, they must be interlaced for NTSC TV by adding fields. The number of fields added increases as the fps of the original footage decreases.Film is generally shot and projected at 24 frames per second (fps), so when film frames are converted to NTSC video, the rate must be modified to play at 29.97 fps. During the telecine process, twelve (12) fields are added to each 24 frames of film (12 fields = 6 frames) so the same images that made up 24 frames of film then comprise 30 frames of video.Video plays at a speed of 29.97 fps so the film actually runs at 23.976 fps when transferred to video.The process of converting 24 frame/s material to 29.97 frame/s is known as 3:2 pulldownYes, but does that mean that the process of convertig 22 frames/s to 29.97 frames/s is called 3 3 3 2 3 3 3 2 3 3 2? Quickly googling the terms telecine and pulldown gives me the answer, which is that the terms do apply to film of any framerate.
So let's get on with it, my point briefly stated is that while it is possible to restore telecined silent film material to any framerate when creating an avi file, there are no standard tools for doing so, hence it can only be done manually. To the extent that this thread contains a question rather than a tutorial, I need help on how to adapt the tools to this purpose. At 23.976 frame/s, there are 4 frames of film for every 5 frames of NTSC video:
\frac{23.976}{29.97} = \frac{4}{5} Oddly enough, if I were to state that in my own words, I would say almost the exact same thing. However, there is a different ratio involved for non-talkie framerates. When converting 22fps to 30fps (the first step is actually to slow down 22fps to 22000/1001=21.978fps, but the ratio of that to 30000/1001=29.97 is the same as the ratio between 22 and 30, so it is best to ignore the pulldown since the point of the pulldown is to make the ratios match up the same as if we were dealing with NTSC being 30fps.) Anyway what we end up with is that for every 11 frames of film, we need 15 frames of video. Of course we break it down to fields, not frames, so for regular 24fps to 30fps we need 5 fields of video for every 2 frames of film. This is represented by 2:3; the number of numbers represents how many frames we started with, the total of the numbers represents the number of fields we end with. If for every 11 frames you needed 30 fields, you end up with the long pulldown pattern previously refered to: 3 3 3 2 3 3 3 2 3 3 2.
But in practice, I discovered an even longer pulldown pattern of 137 fields for every 50 frames. Rather than writing a 50 frame pattern down, the pattern must be described. It is made up mainly of the 3 3 3 2 pattern repeating, alternately being interupted by the shorted 3 3 2 pattern once after 5 or 6 repeats of the main 3 3 3 2 pattern. The main pattern is 11 fields long and the shorter pattern is 8 fields long, so the main pattern starts again after interuption every 11*5+8=63 or 11*6+8=74 fields. 63+74=137 is the number of fields that go by before the whole pattern repeats again. Basically, this seems to be the pattern for all the TCM silents. Weird isn't it?
In order to keep the field order correct, I use a SelectEvery lasting over 274 fields after a SeparateFields. Attached is an AviSynth script using that SelectEvery while keeping a running total of the number of frames created in order to keep it in sync with the main pattern.
The pattern for 20fps to 30fps is much simpler. For every frame of film you need 3 fields of video. This can be represented by the number 3 by itself, or 3:3 to make it clear that it is a repeating pattern. Attatched is another AviSynth script that uses TDecimate(cycleR=1,cycle=3) for this pattern.
In the first case the challenge is to find the pattern manually, in the second case the challenge is to find a way to verify that TDecimate really removed all repeating fields.
Here we come across an AviSynth limitation. What I really want is to remove all duplicate fields regardless of the resulting framerate or number of frames. In contrast, AviSynth needs to know the framerate and number of frames before any field decimation can start. The best alternative would be a two-pass system where duplicates are counted on the first pass and removed on the second pass. So what I really need is a FieldMatching filter that can create a log of matching fields instead of a log of combed frames. Alternatively, if it could output a log of duplicate frames that it creates as it deinterlaces, a decimation filter could remove all of them on a second pass. It has to be a second pass, because before the decimation filter can start if has to know how many frames it is going to remove.
So my question is, in the above paragraph, is there any plugin for avisynth that can already do that?
My quotes were from: 2-3 Pulldown (http://www.zerocut.com/tech/pulldown.html) and Common pulldown patterns (http://en.wikipedia.org/wiki/Telecine#Common_pulldown_patterns)
Stephen7030
Silent Films were shot somewhere between 18fps and 22fps, but never at 24fps. Like modern films, they where never interlaced. Like modern films, they must be interlaced for NTSC TV by adding fields. The number of fields added increases as the fps of the original footage decreases.Film is generally shot and projected at 24 frames per second (fps), so when film frames are converted to NTSC video, the rate must be modified to play at 29.97 fps. During the telecine process, twelve (12) fields are added to each 24 frames of film (12 fields = 6 frames) so the same images that made up 24 frames of film then comprise 30 frames of video.Video plays at a speed of 29.97 fps so the film actually runs at 23.976 fps when transferred to video.The process of converting 24 frame/s material to 29.97 frame/s is known as 3:2 pulldownYes, but does that mean that the process of convertig 22 frames/s to 29.97 frames/s is called 3 3 3 2 3 3 3 2 3 3 2? Quickly googling the terms telecine and pulldown gives me the answer, which is that the terms do apply to film of any framerate.
So let's get on with it, my point briefly stated is that while it is possible to restore telecined silent film material to any framerate when creating an avi file, there are no standard tools for doing so, hence it can only be done manually. To the extent that this thread contains a question rather than a tutorial, I need help on how to adapt the tools to this purpose. At 23.976 frame/s, there are 4 frames of film for every 5 frames of NTSC video:
\frac{23.976}{29.97} = \frac{4}{5} Oddly enough, if I were to state that in my own words, I would say almost the exact same thing. However, there is a different ratio involved for non-talkie framerates. When converting 22fps to 30fps (the first step is actually to slow down 22fps to 22000/1001=21.978fps, but the ratio of that to 30000/1001=29.97 is the same as the ratio between 22 and 30, so it is best to ignore the pulldown since the point of the pulldown is to make the ratios match up the same as if we were dealing with NTSC being 30fps.) Anyway what we end up with is that for every 11 frames of film, we need 15 frames of video. Of course we break it down to fields, not frames, so for regular 24fps to 30fps we need 5 fields of video for every 2 frames of film. This is represented by 2:3; the number of numbers represents how many frames we started with, the total of the numbers represents the number of fields we end with. If for every 11 frames you needed 30 fields, you end up with the long pulldown pattern previously refered to: 3 3 3 2 3 3 3 2 3 3 2.
But in practice, I discovered an even longer pulldown pattern of 137 fields for every 50 frames. Rather than writing a 50 frame pattern down, the pattern must be described. It is made up mainly of the 3 3 3 2 pattern repeating, alternately being interupted by the shorted 3 3 2 pattern once after 5 or 6 repeats of the main 3 3 3 2 pattern. The main pattern is 11 fields long and the shorter pattern is 8 fields long, so the main pattern starts again after interuption every 11*5+8=63 or 11*6+8=74 fields. 63+74=137 is the number of fields that go by before the whole pattern repeats again. Basically, this seems to be the pattern for all the TCM silents. Weird isn't it?
In order to keep the field order correct, I use a SelectEvery lasting over 274 fields after a SeparateFields. Attached is an AviSynth script using that SelectEvery while keeping a running total of the number of frames created in order to keep it in sync with the main pattern.
The pattern for 20fps to 30fps is much simpler. For every frame of film you need 3 fields of video. This can be represented by the number 3 by itself, or 3:3 to make it clear that it is a repeating pattern. Attatched is another AviSynth script that uses TDecimate(cycleR=1,cycle=3) for this pattern.
In the first case the challenge is to find the pattern manually, in the second case the challenge is to find a way to verify that TDecimate really removed all repeating fields.
Here we come across an AviSynth limitation. What I really want is to remove all duplicate fields regardless of the resulting framerate or number of frames. In contrast, AviSynth needs to know the framerate and number of frames before any field decimation can start. The best alternative would be a two-pass system where duplicates are counted on the first pass and removed on the second pass. So what I really need is a FieldMatching filter that can create a log of matching fields instead of a log of combed frames. Alternatively, if it could output a log of duplicate frames that it creates as it deinterlaces, a decimation filter could remove all of them on a second pass. It has to be a second pass, because before the decimation filter can start if has to know how many frames it is going to remove.
So my question is, in the above paragraph, is there any plugin for avisynth that can already do that?
My quotes were from: 2-3 Pulldown (http://www.zerocut.com/tech/pulldown.html) and Common pulldown patterns (http://en.wikipedia.org/wiki/Telecine#Common_pulldown_patterns)
Stephen7030