Log in

View Full Version : Replicating Telecine on AviSynth


RGMOfficial
21st October 2022, 16:23
I have a question about replacing old media (like i've been doing with DotCrawl++):

How i can properly redo an telecine of an 23.976fps film, into 60i, on AviSynth?

As for anyone who doesn't know, Telecine was an old way to transferring video into film using interlacing and duplicated frames together.
The most common technique is 2:3 pull-down.

https://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/32pulldown.svg/749px-32pulldown.svg.png

johnmeyer
21st October 2022, 16:39
1. You generate the additional frames needed to go from 24 events per second to 60 events per second, but do this using the 1000/1001 conversion that is needed for NTSC video.

2. You convert frames to fields.

3. You remove every other field and then weave the remaining fields back together.

This code assumes your video has been assigned to the variable "source" and returns the result in the variable "final." MFlowFPS is a function in the MVTools2 DLL.

MFlowFps(source,super, backward_vec, forward_vec, num=60000,den=1001,ml=600)
SeparateFields()
SelectEvery(4, 0, 3)
final=Weave()

RGMOfficial
21st October 2022, 16:42
1. You generate the additional frames needed to go from 24 events per second to 60 events per second, but do this using the 1000/1001 conversion that is needed for NTSC video.

2. You convert frames to fields.

3. You remove every other field and then weave the remaining fields back together.

This code assumes your video has been assigned to the variable "source" and returns the result in the variable "final." MFlowFPS is a function in the MVTools2 DLL.

MFlowFps(source,super, backward_vec, forward_vec, num=60000,den=1001,ml=600)
SeparateFields()
SelectEvery(4, 0, 3)
final=Weave()

What about the "super", "backward_vec" and "forward_vec" variables?

johnmeyer
21st October 2022, 17:27
Sorry. I just grabbed the key parts from a larger script and figured you would know how to do the rest. Here is a larger segment of that script and it should work as shown. You probably don't need the killaudio() statement. I included it because I used multi-threading (I deleted all those statements in the post below) to dramatically increase the script's speed, and MVTools2 didn't used to work well with multi-threading unless you eliminated the audio.

loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
source=AVISource("e:\frameserver.avi").killaudio()
super = MSuper(source,pel=2)
backward_vec = MAnalyse(super, blksize=16, overlap=4, isb = true, search=3)
forward_vec = MAnalyse(super, blksize=16, overlap=4, isb = false, search=3)
MFlowFps(source,super, backward_vec, forward_vec, num=60000,den=1001,ml=600)
SeparateFields()
SelectEvery(4, 0, 3)
final=Weave()
return final

lollo2
21st October 2022, 18:47
How i can properly redo an telecine of an 23.976fps film, into 60i, on AviSynth?

From Scharfis_Brain - Exotic Interlacing document in https://forum.doom9.org/showthread.php?p=1865607#post1865607


AVISource("24fps.avi")
SelectEvery(2,0,0,0,1,1).SeparateFields().SelectEvery(4,1,2).Weave()

real.finder
21st October 2022, 18:55
ColorBars().ChangeFPS(24) #the 24fps source
AssumeFPS("ntsc_film",true) #for 1000/1001 thing, it change the audio too
ChangeFPS("ntsc_double")
interlaced60or50(bff=false) (https://pastebin.com/Av385Vub)

RGMOfficial
21st October 2022, 19:17
Thanks a lot for all the help you guys.

johnmeyer
21st October 2022, 20:25
reel.finder's solution is better than mine because it does what you asked and does the telecine by duplicating fields. I grabbed the wrong script because I was in a hurry. Mine will work, and it will match up with your other footage, but you won't get quite the same "feel" to the video as you do when fields are duplicated.

The one additional thing to add is that, depending on the field dominance in your other footage, you need to pay attention to the bff or tff flag in the "interlaced" line. Otherwise you will end up with some pretty nasty artifacts.

StainlessS
22nd October 2022, 04:16
NOTE, in real.finder script,
AssumeFPS("ntsc_film",true) #for 1000/1001 thing, it change the audio too
The true arg is Bool "sync_audio" which keeps the audio in sync,
but will result in odd-non/std samplerate, you would normally follow it with
ResampleAudio(OriginalAudioRate).

or ResampleAudio(OriginalClip.AudioRate).

AssumeFPS:- http://avisynth.nl/index.php/FPS