View Full Version : Silent Film (Framerate Question) Help
nfv
19th February 2020, 13:00
https://www.mediafire.com/file/kkyx3d0190wrsp9/silent.avi/file
I noticed this has an odd cadence. What is the proper way to make it progressive but at the right speed? Also, is there a way to determine what the framerate should be? So many questions and variables...
I have seen many DVD's and BluRay's of silent films that are 23.976 and are the correct speed. The above sample seems to be a common cadence for the interlaced films to bring them to the correct speed I'm guessing?
Any help would be much appreciated.
Sharc
19th February 2020, 16:38
Try something like
TFM(mode=1,pp=1).fdecimate(rate=18.0,threshold=10)
poisondeathray
19th February 2020, 17:36
The weird cadence is probably from the edits
It's closer to about 21.72 . 18 will drop too many good frames . fdecimate is tricky, in that you have to go linearly way back or it will mix up frames
The other option to assuming a single constant framerate is to use VFR such as dedup or related methods
Sharc
19th February 2020, 20:15
or perhaps this:
TFM().tdecimate(cycle=32,cycleR=9)
Yields 21.54fps. Not perfect, but yields CFR with most frames kept.
johnmeyer
20th February 2020, 02:13
If the cadence is a little strange, and doesn't repeat, you have to do something like what Sharc posted, where you set a really high cycle size so that Tdecimate can analyze huge chunks at once. This cuts way down on deleting good frames or preserving dups that should be decimated when you have a pattern which doesn't repeat often, if at all.
So, I did the same thing as Sharc, but used an even longer cycle. I came up with the following values, after walking through a very large number of fields (you should always do your analysis by first doing a separatefields() operation and then walking through a large number of fields). I stepped through 128 fields and got 47 unique images (i.e., where the motion moved horizontally). This means that I should have 94 (2 * 47) pairs of fields instead of 128. Subtracting 94 from 128 yields 34. Thus, if I use a Cycle of 128 and a CycleR of 34, I should get really good decimation, even if the pattern varies. I used the following script and seemed to get perfect results. Of course there is no guarantee it will do the entire movie without any errors, but it should get pretty darned close.
Note that I end the script with an AssumeFPS() statement. This is where you re-time the video to play at what you think is the correct rate. There is absolutely no set number for old silent films, many of which were hand-cranked. Also, because this is Harold Lloyd, there is a possibility that some scenes are undercranked so that the footage would look to be sped up when projected, for comedic effect.
loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\TIVTC.dll")
AVISource("e:\fs.avi").killaudio()
AssumeTFF() #change to BFF is you get field reversal
tfm(display=false)
tdecimate(display=false,mode=0,cycleR=34,cycle=128)
AssumeFPS(12)
The only downside to using a long cycle is that it slows down the script.
Sharc
20th February 2020, 09:23
john
Thanks for the analysis. I just noticed that your script has still 3 duplicates (101,102), (142,143), (413,414) if I am not mistaken.
My prodedure has basically been much the same as you described.
For what it's worth here a script which I occasionally use for analyzing and visualizing progressive vs interlaced vs phase-shifted vs telecined video:
clip="your source filter"
clip=clip.AssumeTFF().converttoYV12(interlaced=true)
current=clip.trim(0,-0).showframenumber(scroll=true,x=60,y=260,size=24) #the current frame n
next=clip.trim(1,-0).showframenumber(scroll=true,x=60,y=260,size=24,offset=1) #the next frame n+1
even_current=current.separatefields().selecteven().subtitle("current (even field)",align=5,size=24)
odd_current=current.separatefields().selectodd().subtitle("current (odd field)",align=5,size=24)
even_next=next.separatefields().selecteven().subtitle("next (even field)",align=5,size=24)
odd_next=next.separatefields().selectodd().subtitle("next (odd field)",align=5,size=24)
matched=current.TFM(pp=0,display=true).subtitle("field matched",align=5,size=24)
pic1=stackvertical(even_current,odd_current)
pic2=stackvertical(even_next,odd_next)
return stackhorizontal(pic1,pic2,matched)
Sharc
20th February 2020, 12:08
Here an interpolated version with framerate doubling, for smoother playback at 23.976 fps. Judge yourself regarding interpolation artifacts etc.
https://www.mediafire.com/file/z9bqrikhe26bb9e/silent_doublerate_interpolated.mp4/file
StainlessS
20th February 2020, 18:29
TFM(pp=0)
Apparentfps(Dupethresh=1.5)
Shows 21.978 FPS.
Dupethresh is quite high [noisy clip] but plenty of movement in clip so reasonably good result I think. [Although any edits could have affected result (result would a bit be too high where dupes edited out)]
Cary Knoop
20th February 2020, 18:32
Here an interpolated version with framerate doubling, for smoother playback at 23.976 fps. Judge yourself regarding interpolation artifacts etc.
https://www.mediafire.com/file/z9bqrikhe26bb9e/silent_doublerate_interpolated.mp4/file
Much better to convert the original to 60p and apply an appropriate cadence.
For instance here is an original 16p source converted to 60p using 60p using an AAA,BBBB,CCCC,DDDD cadence:
https://www.youtube.com/watch?v=YHYaYOMc4eo&t=86s
johnmeyer
20th February 2020, 18:55
I have occasionally used motion estimation on movie film, but the artifacts are so severe, as shown in that test clip, that I almost always recommend against it. Also, these days most displays can show any frame rate and are not locked in to 25 or 29.97 fps.
So my recommendation, which I made in my other post, is to experiment with AssumeFPS() to find a frame rate that makes the motion look to be the right speed, and then not do anything else. Just save the file and watch it. You'll have it at the correct speed; you won't have any funky, and sometimes awful, motion estimation artifacts; and you won't have the additional judder that any pulldown cadence is going to impart.
manono
21st February 2020, 07:31
(you should always do your analysis by first doing a separatefields() operation and then walking through a large number of fields).
Only if you like counting twice as much as is necessary. We've been through this before. Apply TFM to field match and then begin counting.
It's a pretty simple one, with a cycle of only 22 frames:
TFM(pp=0).TDecimate(Cycle=22,CycleR=6)
For which you get 21.796fps. You might not want to leave pp=0 for the whole thing, in case there are some quirks along the way. If for another DVD, it can be soft telecined using DGPulldown. Otherwise I'd leave the framerate alone.
johnmeyer
21st February 2020, 16:20
Only if you like counting twice as much as is necessary. We've been through this before.The reason I do a separatefields() -- and will continue to do so -- is that it is the only way to truly see whether an individual field has been screwed up. If you leave fields paired together, it is very difficult to detect reversed fields; phase shifted fields; fields that have artifacts from re-sizing interlaced video without first deinterlacing; etc. When getting ready to IVTC, all of these things are a possibility, and you need to know if the video needs more than just a simple TFM/TDecimate.
You can also do a bob(), but given how bob() works in AVISynth, you can get distorted results if you don't use the correct parameters.
Sharc
21st February 2020, 20:03
I have occasionally used motion estimation on movie film, but the artifacts are so severe, as shown in that test clip, that I almost always recommend against it. Also, these days most displays can show any frame rate and are not locked in to 25 or 29.97 fps.
So my recommendation, which I made in my other post, is to experiment with AssumeFPS() to find a frame rate that makes the motion look to be the right speed, and then not do anything else. Just save the file and watch it. You'll have it at the correct speed; you won't have any funky, and sometimes awful, motion estimation artifacts; and you won't have the additional judder that any pulldown cadence is going to impart.
In a few (5) blind tests on TV screen people unanimously preferred the IVTCed motion interpolated double framerate variant, either at 'original' playback speed of 43.6fps (=2x21.8fps) or slowed down to 23.976fps. As "uneducated" viewers they didn't notice the interpolation artefacts but preferred the reduced strobing vs the original 'vintage' look.
Of course this is subjective and I would not use it for the archive.
johnmeyer
22nd February 2020, 01:53
In a few (5) blind tests on TV screen people unanimously preferred the IVTCed motion interpolated double framerate variant, either at 'original' playback speed of 43.6fps (=2x21.8fps) or slowed down to 23.976fps. As "uneducated" viewers they didn't notice the interpolation artefacts but preferred the reduced strobing vs the original 'vintage' look.
Of course this is subjective and I would not use it for the archive.Your point is quite valid, and I like the idea of a "blind" test (interesting adjective to apply to a visual test).
I've observed the same thing, namely that people always notice the judder on horizontal camera pans in low framerate film (12-16 fps that is typical on these really old films), but seldom notice what, to me, are very obvious ME artifacts. I think the reason for this is that most ME artifacts persist for only one frame. By contrast, the judder can go on for 5-10 seconds (or more) in many scenes.
Also, some of the ME artifacts, while pretty obnoxious when viewed on a freeze frame, don't always call attention to themselves when that degraded frame is shown in motion.
While I can still make other arguments for not doing ME, such as maintaining more sharpness (watch the sprinklers in the background, for instance and see how fuzzy they get), funky grain morphing (it's probably a good idea to do grain reduction if you're going to do ME); occasional REALLY bad artifacts (I can link you to my usual moose antler doozie in a 1940's parade clip which uses ME in order to reduce judder), I think your tests trump any argument I can make.
nfv
26th February 2020, 01:08
Only if you like counting twice as much as is necessary. We've been through this before. Apply TFM to field match and then begin counting.
It's a pretty simple one, with a cycle of only 22 frames:
TFM(pp=0).TDecimate(Cycle=22,CycleR=6)
For which you get 21.796fps. You might not want to leave pp=0 for the whole thing, in case there are some quirks along the way. If for another DVD, it can be soft telecined using DGPulldown. Otherwise I'd leave the framerate alone.
manono, this seems to work great! But..DGPulldown only accepts MPEG's correct? I tried loading the AVI in DGPulldown and it gave me an error and said "The input file must be an elementary stream".
The software I use to encode MPEG2 doesn't accept 21.796 as a legal framerate either. What should I do know? My endgame here is a DVD by the way.
manono
26th February 2020, 08:19
But..DGPulldown only accepts MPEG's correct?
Yes, sort of, it's for applying soft telecine to MPV/M2Vs (the 'elementary stream' mentioned) encoded for DVD. Don't know why you'd try to open an AVI in it.
The software I use to encode MPEG2 doesn't accept 21.796 as a legal framerate either.
Add an AssumeFPS(23.976) to the bottom of the script and try again. Be sure and adjust your bitrates by a factor of 23.976/21.796= about 1.1. Multiply what you'd use for an ordinary 23.976fps encode by 1.1. I don't know what encoder you're using or how you're figuring your bitrates. Use DGPulldown when done the encoding by opening the MPV/M2V, ticking the "Custom" box and then 21.796->29.97.
Oh, also, later I figured it was even simpler than I had written earlier. You can use this instead:
TFM().TDecimate(Cycle=11,CycleR=3)
Good luck!
Sharc
26th February 2020, 11:48
….My endgame here is a DVD by the way.
Hmmm, I think we arrived almost where we started:
Your .avi was actually prepared for DVD compliance by hard telecining the original film to 29.97fps. The pattern was unusual because of the unusual base rate of the original film.
If you don't succeed with DGpulldown try this and compare with your .avi:
AVISource("silent.avi")
converttoYV12(interlaced=true)
TFM().tdecimate(mode=0,cycle=11,cycleR=3) #progressive frames with unusual framerate, as discussed
#assumeFPS(16) #adjust the playback speed as you prefer
separatefields()
changeFPS(59.94) #hard telecine, DVD compliant field rate
weave()
and encode as mpeg-2 interlaced, 29.97fps
nfv
26th February 2020, 18:22
Yes, sort of, it's for applying soft telecine to MPV/M2Vs (the 'elementary stream' mentioned) encoded for DVD. Don't know why you'd try to open an AVI in it.
Add an AssumeFPS(23.976) to the bottom of the script and try again. Be sure and adjust your bitrates by a factor of 23.976/21.796= about 1.1. Multiply what you'd use for an ordinary 23.976fps encode by 1.1. I don't know what encoder you're using or how you're figuring your bitrates. Use DGPulldown when done the encoding by opening the MPV/M2V, ticking the "Custom" box and then 21.796->29.97.
Oh, also, later I figured it was even simpler than I had written earlier. You can use this instead:
TFM().TDecimate(Cycle=11,CycleR=3)
Good luck!
So just so I understand this correctly...I add AssumeFPS(23.976) to the bottom of the script and my MPEG2 encoding software will recognize it as 23.976? Then after I encode the file into an MPEG2/M2V at 23.976 then I have to run DGPulldown on that (ticking the "Custom" box and then 21.796->29.97)?
Do I have that right?
Another question, since the film doesn't just start, it has some junk before it so if I trim that how do I know I'll be in the right place for the cadence to begin?
Here's the clip: https://www.mediafire.com/file/17yidf14ctgmbvq/start.avi/file
Or is the script smart enough to recognize where the cadence starts?
Thanks!
manono
26th February 2020, 19:05
So just so I understand this correctly...I add AssumeFPS(23.976) to the bottom of the script and my MPEG2 encoding software will recognize it as 23.976? Then after I encode the file into an MPEG2/M2V at 23.976 then I have to run DGPulldown on that (ticking the "Custom" box and then 21.796->29.97)?
Do I have that right?
Yes, all correct.
Another question, since the film doesn't just start, it has some junk before it so if I trim that how do I know I'll be in the right place for the cadence to begin?
It doesn't matter. Start anywhere. Count off 11 frames after applying TFM alone and three of them will be duplicates. Pick up where you left off and do it again, same thing. Plus, TFM and TDecimate are adaptive so that if the cadence changes briefly (it doesn't, not in the sample anyway), it can still get it right.
There are two 'patterns' at work here. One goes 533, the other 443. That means for each frame count, there's one duplicate. When I write 5, it goes 1,2,3,4,4. 4 unique frames and one duplicate. 5+3+3=11, three numbers listed means 3 duplicates. The cycle is 11 frames (5+3+3=11, 4+4+3=11) and within that 11 frame cycle are 3 dupe frames. To figure that out you do have to start at the beginning of a cycle and not at any old place.
Once you learn how it's done, you can do most silent films this way, being sure to also know how to look for the possible problems as outlined by johnmeyer. And with respect to Sharc, the whole point to encoding it progressively and adding soft pulldown later on is to avoid the problems associated with hard pulldown. The bitrate savings are considerable, something like 40% for the same quality, as compared to encoding the interlacing. I didn't look at your new sample. Was there some reason I should? Is it different somehow from the earlier sample?
Sharc
26th February 2020, 20:10
And with respect to Sharc, the whole point to encoding it progressively and adding soft pulldown later on is to avoid the problems associated with hard pulldown. The bitrate savings are considerable, something like 40% for the same quality, as compared to encoding the interlacing. I didn't look at your new sample. Was there some reason I should? Is it different somehow from the earlier sample?
I posted the hard telecining script as a workaround for an DVD 29.97i compliant output in case the OP should not succeed with DGpulldown. I don't know the OP's encoder, DVD authoring and playback scenario, so just in case. No doubt that soft telecining with DGPulldown is more efficient and preferable, especially for mpeg2.
johnmeyer
26th February 2020, 20:43
And with respect to Sharc, the whole point to encoding it progressively and adding soft pulldown later on is to avoid the problems associated with hard pulldown. The bitrate savings are considerable, something like 40% for the same quality, as compared to encoding the interlacing.This is an extremely important point.
I got my start encoding video twenty years ago when I wanted to take various music videos and put them on CD-ROM. I initially used the VCD encoders, but eventually "upgraded" to using SVCD and then XVCD.
What I found was, that at the really low bitrates those specs permitted, that if you encoded a music video from OTA, and if that video was shot on film (many were), I was getting absolutely horrible results than when I encoded videos that were shot as video.
I then read about IVTC, and when I used the TMPGEnc built-in inverse telecine, I suddenly got results that were spectacularly better than what I got at the same bitrate when I didn't remove the pulldown.
So, IMHO, IVTC is not optional; it is mandatory. Never encode video which contains pulldown.
nfv
27th February 2020, 22:27
Only if you like counting twice as much as is necessary. We've been through this before. Apply TFM to field match and then begin counting.
It's a pretty simple one, with a cycle of only 22 frames:
TFM(pp=0).TDecimate(Cycle=22,CycleR=6)
For which you get 21.796fps. You might not want to leave pp=0 for the whole thing, in case there are some quirks along the way. If for another DVD, it can be soft telecined using DGPulldown. Otherwise I'd leave the framerate alone.
I found some duplicate frames. With pp=0 and without on both scripts.
TFM(pp=0).TDecimate(Cycle=22,CycleR=6)
TFM().TDecimate(Cycle=11,CycleR=3)
Also, there is left over visible interlacing in sections.
manono
28th February 2020, 00:09
Also, there is left over visible interlacing in sections.
Which is why I wrote in my first post:
You might not want to leave pp=0 for the whole thing, in case there are some quirks along the way.
Unless that wasn't with pp=0. Sometimes you have to tighten up the cthresh if there's some small amount of interlacing left from time to time. In addition, aliasing (jaggies) is sometimes mistaken for interlacing.
I found some duplicate frames. With pp=0 and without on both scripts.
All anyone had to go on was the sample you provided. If the cycle changes in other places, then provide another sample. Also, a duplicate frame here and there is way way better than missing frames as it's not normally noticed when played at full speed. Missing frames are much more noticeable.
nfv
28th February 2020, 04:18
Which is why I wrote in my first post:
Unless that wasn't with pp=0. Sometimes you have to tighten up the cthresh if there's some small amount of interlacing left from time to time. In addition, aliasing (jaggies) is sometimes mistaken for interlacing.
All anyone had to go on was the sample you provided. If the cycle changes in other places, then provide another sample. Also, a duplicate frame here and there is way way better than missing frames as it's not normally noticed when played at full speed. Missing frames are much more noticeable.
I sent you a PM with link to entire film. The movie is in the public domain but I've posted public domain clips before and had people get upset for some reason.
On this particular film what do you recommend I set the cthresh to? What would be the proper syntax be for the cthresh?
Yeah it could have been aliasing...Thanks!
manono
28th February 2020, 04:43
I'll pass. Good luck.
nfv
28th February 2020, 22:20
I'll pass. Good luck.
Thanks. What about my cthresh question?
videoh
28th February 2020, 22:47
You have to figure that out yourself by trying different values. The cthresh syntax is documented in the user manual.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.