View Full Version : Reencoding an IVTC'd 24 fps film as 20 fps
rmatei
25th February 2003, 06:29
I have the DVD of Metropolis (the classic German silent, not the anime) and unfortunately, it's encoded at a higher fps than the movie was originally designed for. That is, it was shot at 20 fps, but for the R1 transfer it was treated like a normal 24 fps and IVTC'd. This makes some serious scenes comical and has an overall detrimental effect on the picture. Read more about it here (http://www.dvdtalk.com/reviews/read.php?ID=5463).
I have little experience with DVD encoding since I don't have a burner, but I'll learn more about that later. My main question is, how is it possible to turn a progressive 20 fps video into an interlaced 30 fps video for encoding? It's a nice, round ratio of 3/2 but I'm not sure how I would combine the fields so that playback isn't jerky.
I'd really appreciate advice about how to do this, both the theory of the fields should be combined and what program to do it in.
SomeJoe
25th February 2003, 18:22
Well, I'm far from an AVISynth guru, but perhaps something like the following could work:
I'll assume you've already extracted the video from the DVD, and it's at 23.976 fps with pulldown flags applied. The speed really should be 20 fps, but we're going to use 19.98 fps to make it match NTSC offsets from 30 (29.97).
My theory is that you have frames of the source video as such:
A B C D
For every 2 frames of source, you need 3 frames of NTSC (or, for every 4 fields of source, you need 6 fields of NTSC). This gives the necessary ratio of 19.98 : 29.97. If we were to take every frame of source and split it into two fields, we get
A1 A2 B1 B2 C1 C2 D1 D2
Now we perform "2:1 pulldown" for lack of a better term:
A1 A2 B1 A2 B1 B2 C1 C2 D1 C2 D1 D2
And finally, recombine them into frames:
A Ba B C Dc D
4 frames of source has become 6 frames of NTSC.
Potential AVISynth script:
# 24fps source meant to be shown at 20fps,
# converted for 29.97 NTSC
LoadPlugin("d:\mpeg2dec.dll")
Mpeg2Source("d:\filename.d2v")
AssumeFrameBased()
AssumeFPS(19.98)
SeparateFields()
SelectEvery(4,0,1,2,1,2,3)
Weave()
The final result should look just as good as telecined film. Since telecined film has 2 synthesized frames for every 5 (40%), and this strategy only has 1 synthesized frame for every 3 (33%), it should actually look better. :)
As for the audio, here's where you're going to need a decent tool. I would recommend using Sound Forge, and doing a time stretch. This will change the length of the audio without changing the pitch. If you let AVISynth change the audio sample rate to match the video duration and then resample to 48kHz, the audio will be the correct length, but will have deepened all of the musical notes with the pitch shift, and most likely the music will no longer be in tune. :eek:
slk001
25th February 2003, 19:30
Originally posted by SomeJoe
The final result should look just as good as telecined film. Since telecined film has 2 synthesized frames for every 5 (40%), and this strategy only has 1 synthesized frame for every 3 (33%), it should actually look better. :)
Your method might work, but this statement isn't exactly true. A normal TELECINED film will have 1 synthesized frame for every 5, but it will be done over three frames (five frames are made into six). The 20fps will have 2 synthesiszed frames for every four (four frames are made into six). Also, since the final video is 29.97fps, your ASSUMEFPS statement should be (29.97).
The technique I would try on this film, is to use your method to get the original to 23.976fps and encode this (with its "new" interlaced frame added). I would then use PULLDOWN to apply a 2:3 PD.
It might be possible to set enough RFF flags to enable you to encode directly at 20fps, then just use these flags to get to 29.97fps, but no software exists to do this that I'm aware of (in this pattern).
SomeJoe
25th February 2003, 21:48
Originally posted by slk001
A normal TELECINED film will have 1 synthesized frame for every 5, but it will be done over three frames (five frames are made into six).
I believe it's four frames are made into five.
Film: 24 fps, 4 frames is exactly 1/6 of a second.
A B C D
There are several ways to perform the telecine process (also called 3:2 pulldown), but the most common way is given on page 137 of DVD Demystified, 2nd Ed.:
Out of the 4 film frames, 5 NTSC frames (10 NTSC fields) are created. This is 5 frames at 30 frames per second, or 10 fields at 60 fields per second (either way you want to look at it), also 1/6 of a second:
A1 A2 B1 B2 B1 C2 C1 D2 D1 D2
If these fields are grouped into frames, we have:
A1/A2, B1/B2, B1/C2, C1/D2, D1/D2
Of these 5 NTSC frames, frames 0, 1, and 4 are "natural" frames, in that they are the entire, whole frames A, B, and D directly from the film. Frames 2 and 3 are "synthesized" frames, in that their fields come from two different film frames.
This is why I said that the percentage of synthesized frames in a normal telecined film is 40% (2 out of every 5 NTSC frames are synthesized), when viewed on an NTSC TV.
Originally posted by slk001
The 20fps will have 2 synthesiszed frames for every four (four frames are made into six).
It's 2 synthesized frames for every 6 NTSC frames (or 1 for 3). Thus the 33% figure. In other words, of all the frames that you would be viewing on the NTSC TV, 1/3 of them are synthesized frames, and 2/3 of them are natural frames from the film.
Originally posted by slk001
Also, since the final video is 29.97fps, your ASSUMEFPS statement should be (29.97).
I don't believe so. According to the AVISynth documentation, AssumeFPS() (http://www.avisynth.org/index.php?page=FPS) changes the frame rate without changing the frame count (causing the video to play faster or slower). It only sets the framerate-parameter. This is exactly what we want. The .m2v file extracted from the DVD contains all whole film frames, encoded for display at 23.976 fps. But this is too fast, the film was supposed to be shown at 20 fps. The AssumeFPS statement here tells AVISynth the correct frame rate of the source material, 19.98 fps.
The SeparateFields() (http://www.avisynth.org/index.php?page=SeparateFields) call then splits each frame into two fields, doubling the frame count and doubling the frame rate. So we now have field-based material at 39.96 fields per second.
The SelectEvery() (http://www.avisynth.org/index.php?page=SelectEvery) call then performs our synthetic combining, giving us 6 fields for every 4 originally. This increases the frame count and frame rate proportionally, so that the total program length remains the same, thus we now have 59.94 fields per second.
The Weave() (http://www.avisynth.org/index.php?page=Weave) call recombines fields into frames, halving the frame count and halving the frame rate. We now are frame-based again at 29.97 fps.
Originally posted by slk001
The technique I would try on this film, is to use your method to get the original to 23.976fps and encode this (with its "new" interlaced frame added). I would then use PULLDOWN to apply a 2:3 PD.
I think that's going to turn out looking horrible, because there are then two different pulldown processes applied. First, we would have to change the first pulldown process from the one discussed above to one that changes 20 fps into 24 fps. This would involve making 5 original 20fps frames into 6 24fps frames. (5 @ 20fps = 1/4 second, 6 @ 24fps also = 1/4 second). Then, you would apply standard pulldown flags to cause the DVD player to turn 24fps into 30fps in the player. There would be compounded motion judder due to each pulldown process: judder at 1/4 second intervals from the 1st pulldown, judder at 1/5 second intervals from the 2nd pulldown, and judder at the beat frequency between the two, which is 1 second intervals.
Originally posted by slk001
It might be possible to set enough RFF flags to enable you to encode directly at 20fps, then just use these flags to get to 29.97fps, but no software exists to do this that I'm aware of (in this pattern).
Now this is a highly interesting idea, and could be accomplished as follows:
Frames: A B C D E F
TFF Flags: 1 0 1 0 1 0
RFF Flags: 1 1 1 1 1 1
Resulting field sequence: A1 A2 A1 B2 B1 B2 C1 C2 C1 D2 D1 D2 E1 E2 E1 F2 F1 F2
6 frames of source film @ 20fps = 3/10 of a second, 18 fields of NTSC @ 60 fields per second = 3/10 of a second.
But you're quite correct - no software exists to set TFF/RFF in this pattern. A few small changes in the pulldown.exe source would probably do nicely. :)
slk001
25th February 2003, 22:36
A normal TELECINED film will have 1 synthesized frame for every 5, but it will be done over three frames (five frames are made into six).
I started out okay, but blotched the ending. I should have said that there were four frames are made into five, thus 20% (not 40%, as you stated) vs 33%.
But the ASSUMEFPS(29.97) I believe is correct, because after our separate/weaving process, we now have 29.97fps (we don't care about the input framerate, only the output). I didn't analyze the script carefully, I just thought that 29.97 was the goal.
I agree that a pulldown on the resulting 23.976 would probably be horrible.
I would like to be able to get a hold of the source code to PULLDOWN.EXE.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.