[Libav-user] using avpicture_deinterlace

Don Moir donmoir at comcast.net
Mon Sep 22 13:51:02 CEST 2014

> Hendrik Leppkes <h.leppkes at ...> writes:
>> Our program is using avpicture_deinterlace
>> to deinterlace frames.
> This sounds like a bad idea, use yadif instead.
>> if it's interlaced_frame field is true, we
>> can avpicture_deinterlace to deinterlace it.
> This is also a bad idea: the interlaced_frame
> filed tells you how the frame was *encoded*
> but to decide whether it should be deinterlaced
> or not only the actual content is relevant
> which is often independent of interlaced_frame.
> As Hendrik explained, frames and fields within
> FFmpeg are defined so that one frame consists
> of two fields.
> (Even in cases when this is semantically wrong.)
> Carl Eugen

In the initial attempt at using ffmpeg, I used avfilter because it was a part of sample code I was looking at. Then as I got more 
into it I see I don't need avfilter. I am thinking thank god. Remembering back I was thinking clusmy and a place for more things to 
go wrong. While there seems to be some useful things in avfilter, I don't really need any of it. Anything I might need from there I 
just do that myself in my own code.

So yadif is integrated via avfilter in ffmpeg I believe. Deinterlacing is something I need to do. I am no expert on deinterlacing, 
yadif, or avfilter.

avpicture_deinterlace is inferior to yadif as far as I know and what most people will tell you. I do not have video where 
avpicture_deinterlace does not do an acceptable job but somewhere there must be one :)

The beauty of avpicture_deinterlace for me is how easy it is to call. There is no setup for it and you can just call it or not 
depending on deinterlace requriement or intense CPU usage, etc. In other words, an easy on the fly decision.

I would like to see avpicture_deinterlace improved, renamed, but retained as part of the main ffmpeg libraries. I have not found a 
reason to link to avfilter except yadif but so far that is not enough for the potential head aches, additional setup that might 
require, and not so sure what improvement that would bring. I am thinking a negative it terms of CPU usage as a start. 

More information about the Libav-user mailing list