[FFmpeg-devel] IVTC in FFmpeg
ubitux at gmail.com
Sun Mar 24 07:40:45 CET 2013
So, as you may know, an efficient inverse telecine filter toolkit was requested
and trolled many times when talking about libavfilter. After various IRC talks
all around, it was assumed that the TIVTC solution from Avisynth was most
likely one of the most efficient one, or at least the most commonly used,
especially when dealing with all the various broken telecined crap you can find
So here it is, ported from the VapourSynth project, which did some light clone
from the original filters. It is still a work in progress (I have notably to
run various extended checks; check the TODO list in the appropriate commit
description) but it should be usable already.
Here is the most basic usage of the filters:
You can of course specify various options such as the parity, mode, etc. But
one of the most interesting things about these filters is that they can be used
in coordination with some other filters. First thing, the fieldmatcher will
make sure to mark as interlaced the frames it wasn't able to decomb (it will
also print a warning on stderr), so you can fallback on a real deinterlacer to
interpolate the fields:
-vf "fieldmatch, yadif=deint=interlaced, decimate"
Now another interesting thing about these filters is that they can take an
additional video stream (the feature is known as "clip2" in TIVTC and vivtc).
In the case of fieldmatch for instance, you can specify a pre-processed input
to calculate the combed metrics, but still use the original untouched source to
reconstruct the fields. It would theorically looks like this:
-vf " split [ppme][clean];
[ppme] fields, denoise, tinterlace [pp];
[pp][clean] fieldmatch=ppsrc=1, decimate"
The pp chain here theorically separate fields, run a destructive/hard denoising
(note: a good denoiser is also often trollquested), and re-interlace; that way
it could help fieldmatch to detect fields better; and the filter will still
pick from the clean source.
The decimate filter also has such feature; you can provide it a pre-processed
input to help it, but will still be lossless by picking from the other source.
Anyway, there is still some work to do on it, but feel free to send some
BTW, I'd like to thank Fredrik, TheFluff, Derek and the others for the help,
explanations, samples etc...
More information about the ffmpeg-devel