[FFmpeg-devel] [PATCH 1/2] libavfilter: Add new tinterlace mode

Stefano Sabatini stefasab at gmail.com
Sun Apr 29 15:35:46 CEST 2012

On date Saturday 2012-04-28 11:27:14 +0100, Stuart Morris encoded:
> --- On Fri, 27/4/12, Stuart Morris <stuart_morris at talk21.com> wrote:
> > Is there a potential problem if the source video is
> > progressive?
> > 
> > I think the interlaced flag will toggle back and forth at
> > each frame.
> > Rather than merely refer to the current frame, would it be
> > better to
> > re-interlace it by copying both of its fields to a new
> > buffer and
> > marking it as interlaced? Not only would the flag be correct
> > but

> > also the colour space would now be interlaced to.

I don't know what this means (how can a color space be interlaced?).

> I just watched some progressive material with tinterlace mode 6 and
> I see no colour artifacts.
> Concerning the interlace flag, is there a way to set the flag
> without having to copy the whole frame?

Yes, simply set the property in the new frame before sending it to the
next filter:

out = avfilter_ref_buffer(cur, AV_PERM_READ);
out->video->interlaced = 1;

This has still the problem that in case of progressive video the new
reference will be always marked as bottom_field_first
(i.e. top_field_first = 0) but you can always change it with setfield
so it shouldn't be an issue.

Updated patch in attachment, Stuart since the patch is yours please
test with the interlaced flag trick and resend the patch if it works
for you.
FFmpeg = Furious and Formidable Mind-dumbing Proud Enlightening Game
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavfi-tinterlace-add-tinterlace-mode-6.patch
Type: text/x-diff
Size: 3777 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120429/0b8b6b5f/attachment.bin>

More information about the ffmpeg-devel mailing list