View Full Version : Removing every fifth frame
MrVideo
4th July 2011, 10:31
Source video: 1080p29.97 (NOT INTERLACED)
I need to get it back to 23.976, since whoever did this file screwed it up.
The pattern is such that the following frames are duplicate (first frame is 0):
2-3
7-9
12-13
17-18 ...
The first batch of frames are black. The video doesn't really start until frame 60, so the first of the viewable duplicate frames are at 62-63.
What AVIsynth script command do I need to use to inverse telecine this mess?
Thanks.
Didée
4th July 2011, 10:40
Import("TIVTC.dll")
YourVideoSourceFilter()
TDecimate()
MrVideo
4th July 2011, 10:55
Import("TIVTC.dll")
YourVideoSourceFilter()
TDecimate()
Thanks. I shouldn't have to import tivtc.dll as it is in the plugins directory and it should automatically get called.
I've been using decimate for 2:3 pulldown stuff. I'll use tdecimate on the file.
Gavino
4th July 2011, 14:15
Import("TIVTC.dll")
Of course, you meant LoadPlugin(...). ;)
Didée
4th July 2011, 14:20
Yay. You guys know, I can't write three-liners without at least one fatal error in it. :D
johnmeyer
4th July 2011, 16:41
Don't you need to use TFM before TDecimate in order to feed the decimation function the hints that it needs to do the pulldown removal?
This is the "default" script that I start with each time I have to do inverse telecine. If your source is progressive, you'll have to make a few tweaks.
loadPlugin("c:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
AVISource("E:\myvideo.avi")
converttoYV12(interlaced=true)
#Change this to BFF or TFF !!!!!!!!!!
AssumeTFF()
tfm(display=false)
tdecimate(cycleR=1,cycle=5) #defaults are cycleR=1 and cycle=5
Gavino
4th July 2011, 17:13
If the pattern is a fixed one as the OP described, wouldn't a simple
SelectEvery(5, 0,1,2,4)
be sufficient?
johnmeyer
4th July 2011, 18:28
If the pattern is a fixed one as the OP described, wouldn't a simple
SelectEvery(5, 0,1,2,4)
be sufficient?
Possibly, although you'd have to make sure that the missing frame (3 in this case) was really the one you wanted to remove. A bigger issue is that, in my experience, most video like this has a cadence shift at scene boundaries, usually due to editing, but sometimes because the encoding was done to ensure that each scene started with a new frame and not a repeat. TFM/TDecimate handles this; SelectEvery would yield the wrong result as soon as the video pattern was interrupted.
This is one of the main reasons that TFM/TDecimate is so useful: it handles lots of the real-world flakiness in how films are telecined.
Didée
4th July 2011, 18:35
@johnmeyer: In this case, no, there's no need for TFM. The OP has 30p footage with one duplicate every 5 frames ... speaking loosely, TFM fieldmatching "already has been done". It seems the operation to do is just decimate, nothing else.
@Gavino - if the pattern is really fixed, sure. But the *really*fixed* patterns exist mostly in theory. Practice usually is much more evil ...
MrVideo
4th July 2011, 20:29
There are only 720 frames in the whole file and the frame 2-3/7-8 pattern exists at the end of the last visible frame.
MrVideo
4th July 2011, 20:48
If the pattern is a fixed one as the OP described, wouldn't a simple
SelectEvery(5, 0,1,2,4)
be sufficient?
It most certainly was sufficient.
:thanks:
MrVideo
4th July 2011, 20:51
if the pattern is really fixed, sure. But the *really*fixed* patterns exist mostly in theory. Practice usually is much more evil ...
For 2:3 pulldown videos (1080i29.97), I can provide plenty of files that are 2:3 cadence from beginning to end.
It is not as uncommon as one might think.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.