Hi!

Attached patches fix Closed Captions when increasing frame rate, both
with "-r" and the fps filter, fixes ticket #7506.

Please comment, Carl Eugen
From fcb6a6ec0bb3246913fab50a0aa7d3c9dc0a465a Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Fri, 23 Nov 2018 18:48:50 +0100
Subject: [PATCH 1/2] lavfi/fps: Avoid duplicating Closed Captions when
 increasing frame rate.

---
 libavfilter/vf_fps.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 9167a00..6b99f20 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -249,6 +249,8 @@ static int write_frame(AVFilterContext *ctx, FPSContext *s, AVFilterLink *outlin
         frame = av_frame_clone(s->frames[0]);
         if (!frame)
             return AVERROR(ENOMEM);
+        // Make sure Closed Captions will not be duplicated
+        av_frame_remove_side_data(s->frames[0], AV_FRAME_DATA_A53_CC);
         frame->pts = s->next_pts++;
 
         av_log(ctx, AV_LOG_DEBUG, "Writing frame with pts %"PRId64" to pts %"PRId64"\n",
-- 
1.7.10.4

From 86ddd7f86991bdfe865f4180f8bf5779383f5295 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Fri, 23 Nov 2018 18:49:27 +0100
Subject: [PATCH 2/2] ffmpeg: Avoid duplicating Closed Captions when
 increasing frame rate.

Fixes ticket #7506.
---
 fftools/ffmpeg.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a12208c..6ce1156 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1286,6 +1286,8 @@ static void do_video_out(OutputFile *of,
         ret = avcodec_send_frame(enc, in_picture);
         if (ret < 0)
             goto error;
+        // Make sure Closed Captions will not be duplicated
+        av_frame_remove_side_data(in_picture, AV_FRAME_DATA_A53_CC);
 
         while (1) {
             ret = avcodec_receive_packet(enc, &pkt);
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to