Discussion:
[FFmpeg-user] De Details of Deinterlacing
Jim Shupert
2009-08-05 16:53:24 UTC
Permalink
friends,

I wonder if someone could tell me or point toward some info on how
ffmpeg deinterlacing works.

that is when i do a " -deinterlace " in a cmd line -- What is
actually happening?

Does it remove one field of a video (the odd or even lines) and then
blend (interpolate) the remaining lines?

Does it do deinterlacing like the VirtualDub Plug-in
<http://neuron2.net/LVG/vdplugins.html> ; "Deinterlace - area based".
Instead of removing all of the odd or even lines, this plug-in only
removes lines in portions of the video where interlacing artifacts are
present. In other words, it only deinterlaces areas where motion causes
interlacing artifacts.
Does it do *adaptive deinterlacing*?

Is there more than 1 way to deinterlace via ffmpeg? Can i use a switch
for adaptive deinterlacing?

Thanks

jS
Jim Shupert
2009-08-06 18:36:14 UTC
Permalink
Post by Jim Shupert
friends,
I wonder if someone could tell me or point toward some info on how
ffmpeg deinterlacing works.
that is when i do a " -deinterlace " in a cmd line -- What is
actually happening?
Does it remove one field of a video (the odd or even lines) and then
blend (interpolate) the remaining lines?
Does it do deinterlacing like the VirtualDub Plug-in
<http://neuron2.net/LVG/vdplugins.html> ; "Deinterlace - area based".
Instead of removing all of the odd or even lines, this plug-in only
removes lines in portions of the video where interlacing artifacts are
present. In other words, it only deinterlaces areas where motion
causes interlacing artifacts.
Does it do *adaptive deinterlacing*?
Is there more than 1 way to deinterlace via ffmpeg? Can i use a
switch for adaptive deinterlacing?
Thanks
jS
efforts to find more information on FFmpeg deinterlacing finds only this

*FFmpeg deinterlacing filter that deinterlaces the given block by
filtering every second line with a (-1 4 2 4 -1) filter.*
from
http://avidemux.org/admWiki/index.php?title=Video_filter_libavcodec_deinterlacer

I currently think that ffmpeg has no ' additional options ' for
deinterlacing a use of -deinterlace
simply evokes it.
But what exactly happens?

the above statement seems to say that it only acts on 1 field ( "...
filtering every second line..." ) and if that is true?--
My thinking was it should read : "... filtering every /**other*/ line..."
what might the number sequence of -1 4 2 4 -1 mean

mostly -- I would like to know
1. how it deInterlaces
2. know if there are any additional options -- blending , edge detection
etc.
Thanks much!

jS
Ben Baker-Smith
2009-08-07 15:02:39 UTC
Permalink
I did a little searching out of curiosity, perhaps some of this will be
helpful:

First of all (accordiing to http://vektor.ca/dvd/tech/) the [-1 4 2 4 -1]
deinterlacing filter is an interpolation filter.
It appears that you are correct in assuming there are no options for
-deinterlace.

However, I ran across a reference to a whole group of different
deinterlacing filters available as postprocessing filters in FFmpeg.
I've never used the postprocessing filters, so I can't comment on whether
these work or not, but here's the list of filters, and a link to the
documentation.

lb linblenddeint linear blend deinterlacer
li linipoldeint linear interpolating
deinterlace
ci cubicipoldeint cubic interpolating
deinterlacer
md mediandeint median deinterlacer
fd ffmpegdeint ffmpeg deinterlacer
l5 lowpass5 FIR lowpass deinterlacer

http://svn.aegisub.net/branches/aui/FFmpegSource/ffmpegsource.html

(the page at the above address is not properly formatted, so I took the
liberty of hosting a fixed copy here:
http://benbakersmith.com/dump/ffmpegsource.html)

If you make any more progress on this subject please post your results.

-Ben
Post by Jim Shupert
Post by Jim Shupert
friends,
I wonder if someone could tell me or point toward some info on how
ffmpeg deinterlacing works.
that is when i do a " -deinterlace " in a cmd line -- What is
actually happening?
Does it remove one field of a video (the odd or even lines) and then
blend (interpolate) the remaining lines?
Does it do deinterlacing like the VirtualDub Plug-in
<http://neuron2.net/LVG/vdplugins.html> ; "Deinterlace - area based".
Instead of removing all of the odd or even lines, this plug-in only
removes lines in portions of the video where interlacing artifacts are
present. In other words, it only deinterlaces areas where motion
causes interlacing artifacts.
Does it do *adaptive deinterlacing*?
Is there more than 1 way to deinterlace via ffmpeg? Can i use a
switch for adaptive deinterlacing?
Thanks
jS
efforts to find more information on FFmpeg deinterlacing finds only this
*FFmpeg deinterlacing filter that deinterlaces the given block by
filtering every second line with a (-1 4 2 4 -1) filter.*
from
http://avidemux.org/admWiki/index.php?title=Video_filter_libavcodec_deinterlacer<http://avidemux.org/admWiki/index.php?title=Video_filter_libavcodec_deinterlacer>
I currently think that ffmpeg has no ' additional options ' for
deinterlacing a use of -deinterlace
simply evokes it.
But what exactly happens?
the above statement seems to say that it only acts on 1 field ( "...
filtering every second line..." ) and if that is true?--
My thinking was it should read : "... filtering every /**other*/ line..."
what might the number sequence of -1 4 2 4 -1 mean
mostly -- I would like to know
1. how it deInterlaces
2. know if there are any additional options -- blending , edge detection
etc.
Thanks much!
jS
Ben Baker-Smith
2009-08-07 15:07:22 UTC
Permalink
there is also this post...

https://init.linpro.no/pipermail/skolelinux.no/cinelerra/2007-February/010000.html
Kevin Oberman
2009-08-07 15:37:30 UTC
Permalink
From: Ben Baker-Smith <bbakersmith at gmail.com>
Date: Fri, 7 Aug 2009 10:07:22 -0500
Sender: ffmpeg-user-bounces at mplayerhq.hu
there is also this post...
https://init.linpro.no/pipermail/skolelinux.no/cinelerra/2007-February/010000.html
My favorite de-interlace tool is 'decomb telecide'. It is a part of a
couple of video tools, avidemux2 and avisynth. I think it is also used
in handbrake. It works better than any other filter I have tried and is
especially good when changing frame rates. When changing frame rates, it
must be used in conjunction with 'decomb decimate' which does
"clean-up".

I'd love to see this filter more generally available, especially in
ffmpeg.
Source at http://neuron2.net/decomb/decombnew.html

Information at:
http://www.doom9.org/decomb-params.htm
http://avidemux.org/admWiki/index.php?title=Video_filter_Decomb_Telecide
--
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net Phone: +1 510 486-8634
Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751
Continue reading on narkive:
Loading...