[FFmpeg-user] -pix_fmt yuv420p and deinterlacing

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Feb 26 13:56:12 EET 2017


2017-02-26 12:44 GMT+01:00 Katherine Frances <knfrances at gmail.com>:
> On Mon, Feb 27, 2017 at 12:19 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
> wrote:

>> >    2. If used in the same script, *scale* must precede *yadif. *Although
>> > it seems rather redundant.
>>
>> I would suggest the opposite since giving yadif more information could
>> help. There may be a performance trade-off though.
>
> If the order is yadif -> scale, how is yadif getting more information?
> Sorry, I think I'm missing something here.

The scale filter in general does something destructive with the video
so calling yadif first (which does something fuzzy) means giving yadif
the best chance to produce best output.

If you downscale, calling swscale first can improve performance but
it comes at the cost of possibly worse yadif output.

Note that yadif is not the only deinterlacing filter, see the documentation
(I personally only used yadif for a very long time).

>> You should not use a (non-trivial) filter-chain and -pix_fmt since iirc,
>> the output (the filter order) is not defined. (But it is a bad idea anyway.)
>
> I'm not clear on your meaning here. It's not possible to do both of these
> operations (deinterlace + chroma-downsample to 4:2:0) in one script?

On the contrary:
If you do "-vf something -pix_fmt ..." there is no guarantee if scale (needed
for "pix_fmt") or "something" is called first. (Even if I am wrong and the order
is documented, it is still not ideal imo to use this syntax.)
So to make sure you have exactly one filter chain (with a defined order)
use the format filter.
If you don't need specific filters (like scale and yadif), using -pix_fmt
allows a simpler syntax.

> I hope this post is formatted correctly.

No, and I am really surprised how this is possible given the many
examples you have already seen in this very thread.

Carl Eugen


More information about the ffmpeg-user mailing list