[FFmpeg-devel] yadif frame doubling - incorrect closed captioning

Michael Niedermayer michael at niedermayer.cc
Mon Jan 14 10:31:34 EET 2019


On Sun, Jan 13, 2019 at 05:26:49PM -0500, Gabriel Blanchard wrote:
> When frame doubling using yadif/bwdif closed captioning gets copied to the
> second frame - as a result the closed captioning text is garbage.
> 
> I've attached a very simple patch that fixes this issue. Very similar to
> what vf_fps.c already does around line 253.
> 
> -Gabe

>  yadif_common.c |    3 +++
>  1 file changed, 3 insertions(+)
> b01ce870aa048fbe25c6ae69ec1b611d6a782865  0001-fix-closed-captioning-when-frame-doubling.patch
> From 0f6d3c31842ae33eaa3d5d91600bcd80c9c0a6b9 Mon Sep 17 00:00:00 2001
> From: Gabriel Blanchard <gblanchard at start.ca>
> Date: Sun, 13 Jan 2019 17:10:01 -0500
> Subject: [PATCH 1/1] fix closed captioning when frame doubling
> 
> ---
>  libavfilter/yadif_common.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavfilter/yadif_common.c b/libavfilter/yadif_common.c
> index a10cf7a17f..fbb4289b80 100644
> --- a/libavfilter/yadif_common.c
> +++ b/libavfilter/yadif_common.c
> @@ -43,6 +43,9 @@ static int return_frame(AVFilterContext *ctx, int is_second)
>              return AVERROR(ENOMEM);
>  
>          av_frame_copy_props(yadif->out, yadif->cur);
> +        // Don't copy Closed Captioning
> +        av_frame_remove_side_data(yadif->out, AV_FRAME_DATA_A53_CC);

This also applies to AV_FRAME_DATA_MOTION_VECTORS which too become invalid
on a duplicated frame

Thus a new function should be added which does all this, and that then
be used

thx
[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190114/95176909/attachment.sig>


More information about the ffmpeg-devel mailing list