[Libav-user] using avpicture_deinterlace

Clément Bœsch u at pkh.me
Mon Sep 22 13:59:14 CEST 2014


On Mon, Sep 22, 2014 at 07:51:02AM -0400, Don Moir wrote:
> 
> >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.
> 

This code doesn't belong anywhere else than in filters. You can already
strip off everything you don't want from libavfilter and link against it.
The overhead won't be large. There is no way we are going to maintain an
improve a broken filter out of libavfilter.

What you want might be a better interface than currently for libavfilter.

Now you can also just strip off avpicture_deinterlace() from FFmpeg,
and improve it in your application.

We have multiple deinterlacers in avfilter, and they need temporal
information to be useful. We are not going to have such code in
libavcodec, libavfilter is designed for that exact purpose.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140922/28b87356/attachment.asc>


More information about the Libav-user mailing list