From: Artem Smorodin <artem.smorodin@telestream.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Anton Khirnov <anton@khirnov.net>
Subject: Re: [FFmpeg-devel] [External Sender] Re: [PATCH] fftools/ffmpeg_enc: Prevent duplicate A53 Closed Captions at frame rate up-conversion
Date: Fri, 9 Jun 2023 16:33:36 +0000
Message-ID: <DM6PR14MB3645BA1E8FAC28EE7CA6460AE151A@DM6PR14MB3645.namprd14.prod.outlook.com> (raw)
In-Reply-To: <CAHGibzFmj_RpOqtqPGmM71-R0fF2aL95txdd79T1hE0B7_BwTg@mail.gmail.com>
Hi David,
I think the reworking of the "-r" option is a breaking change.
I understand that output won't conform to the spec, but at least CC won't be broken. For example libx264->a53cc option is 1 by default, so any h264 output with CC with frame rate up-conversion will be broken.
The behavior that adds this patch was there before, but was removed after about 5.1.1, so I think it's safe to restore it until a better solution is implemented.
Regarding a better solution:
I don't think we should change the behavior of the "-r" option, instead I suggest moving ccfifo from libavfilter to libavutil and using it in the ffmpeg program.
Thank you
Artem Smorodin
-----Original Message-----
From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Devin Heitmueller
Sent: Friday, June 9, 2023 6:13 PM
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Anton Khirnov <anton@khirnov.net>
Subject: [External Sender] Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_enc: Prevent duplicate A53 Closed Captions at frame rate up-conversion
Hi Artem,
On Fri, Jun 9, 2023 at 9:19 AM Artem Smorodin <artem.smorodin@telestream.net> wrote:
>
> When up-converting frame rate, ffmpeg duplicates frames including side data. This causes duplicated characters in the output. This patch removes A53 side data from duplicated frames.
>
> Signed-off-by: Artem Smorodin <artem.smorodin@telestream.net>
> ---
> fftools/ffmpeg_enc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index
> 2bf4782a9f..93d18034ca 100644
> --- a/fftools/ffmpeg_enc.c
> +++ b/fftools/ffmpeg_enc.c
> @@ -1104,6 +1104,9 @@ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame)
> else if (ret < 0)
> exit_program(1);
>
> + //Prevent duplicate Closed Captions at frame rate up-conversion
> + av_frame_remove_side_data(in_picture, AV_FRAME_DATA_A53_CC);
> +
> e->next_pts++;
> e->vsync_frame_number++;
> }
> --
> 2.25.1
>
> Disclaimer
Unfortunately, the patch needed is more complicated than what you're proposed. You can't simply drop the caption from the duplicated frame, but rather the CC data needs to be rewritten in existing frames with the appropriate cc_count and distribution of 608 pairs.
I've reworked the logic to behave correctly if you use the "fps" video filter, but had forgotten that using "-r" doesn't use that filter.
Anton, is there any good reason we couldn't rework the "-r" command line argument to invoke the fps filter (like we do with scaling) rather than re-implementing the same functionality inside of the ffmpeg program itself? It always seemed strange to me that it didn't work that way from the beginning...
Artem, in the meantime you can avoid this problem if you specify "-vf fps" on the command line rather than specifying "-r".
Devin
--
Devin Heitmueller, Senior Software Engineer LTN Global Communications
o: +1 (301) 363-1001
w: https://ltnglobal.com e: devin.heitmueller@ltnglobal.com _______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-06-09 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 13:19 [FFmpeg-devel] " Artem Smorodin
2023-06-09 15:13 ` Devin Heitmueller
2023-06-09 16:33 ` Artem Smorodin [this message]
2023-06-13 14:11 ` [FFmpeg-devel] [External Sender] " Devin Heitmueller
2023-06-11 3:55 ` [FFmpeg-devel] " Anton Khirnov
2023-06-13 14:16 ` Devin Heitmueller
2023-06-13 14:41 ` Gyan Doshi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR14MB3645BA1E8FAC28EE7CA6460AE151A@DM6PR14MB3645.namprd14.prod.outlook.com \
--to=artem.smorodin@telestream.net \
--cc=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git