Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Devin Heitmueller <devin.heitmueller@ltnglobal.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v4 6/6] decklink_enc: add support for playout of 608 captions in MOV files
Date: Tue, 2 May 2023 10:47:52 -0400
Message-ID: <CAHGibzH32gBsj9qagsTpMtPFbR3TFiCSQw_OLLF5DpWpmsaieA@mail.gmail.com> (raw)
In-Reply-To: <CAM=jba8RgTA4vJOzYOoyhA_rH=diB+c6s8rjzHUWCgEycLOFzg@mail.gmail.com>

Hi Lance,

On Sun, Apr 30, 2023 at 7:01 PM Lance Wang <lance.lmwang@gmail.com> wrote:
> This implementation  is limited to decklink SDI output only,  If possible,
> can we implement the function from demuxer layer,  and then passthrough
> by SEI side data? By this way,  we can convert  such stream in streaming
> to  embedded CC to video stream easily also.

I did consider this approach, and it does raise the more fundamental
issue about trying to minimize the number of ways we have to process
CC data depending on whether it originated in SEI metadata or in
separate packets.  There are a number of problems with what you are
proposing though:

1.  There could be multiple CC streams within an MOV file but only a
single CC stream can be embedded into AVFrame side data.  Hence you
would have to specify some sort of argument to the demux to decide
which stream to embed.  This makes it much more difficult to do things
like ingest a stream with multiple CC streams and have separate
outputs with different CC streams.  Performing the work on the output
side allows you to use the standard "-map" mechanism to dictate which
CC streams are routed to which outputs, and to deliver the content to
different outputs with different CC streams.

2.  I have use cases in mind where the captions originate from sources
other than MOV files, where the video framerate is not known (or there
is no video at all in the source).  For example, I want to be able to
consume video from a TS source while simultaneously demuxing an SCC or
MCC file and sending the result in the output.  In such cases the
correct rate control for the captions can only be implemented on the
output side, since in such cases the SCC/MCC demux doesn't have access
to the corresponding video stream (it won't know the video framerate,
nor is it able to embed the captions into the AVFrame side data).

I can indeed imagine there are use cases where doing it further up the
pipeline could be useful.  For example, if you were taking in an MOV
file and wanting to produce a TS where the captions need to be
embedded as SEI metadata (hence you would need the e608 packets
converted to AVFrame side data prior to reaching the encoder).
However I don't see this as a substitute for being able to do it on
the output side when that is the most flexible approach for those
other use cases described above.

Much of this comes down to the fundamental limitations of the ffmpeg
framework related to being able to move data back/forth between data
packets and side data.  You can't feed data packets into
AVFilterGraphs.  You can't easily combine data from data packets into
AVFrames carrying video (or extract side data from AVFrames to
generate data packets), etc.  You can't use BSF filters to combine
data from multiple inputs such as compressed video streams and data
streams after encoding.  I've run across all these limitations over
the years, and at this point I'm trying to take the least invasive
approach possible that doesn't require changes to the fundamental
frameworks for handling data packets.

It's worth noting that nothing you have suggested is an "either/or"
situation.  Because caption processing is inexpensive, there isn't any
significant overhead in having multiple AvCCFifo instances in the
pipeline.  In other words, if you added a feature to the MOV demuxer,
it wouldn't prevent us from running the packets through an AvCCFifo
instance on the output side.  The patch proposed doesn't preclude you
adding such a feature on the demux side in the future.

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".

  reply	other threads:[~2023-05-02 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28 16:37 [FFmpeg-devel] [PATCH v4 0/6] Add support for Closed Caption FIFO Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 1/6] ccfifo: Properly handle CEA-708 captions through framerate conversion Devin Heitmueller
2023-05-03  9:20   ` Anton Khirnov
2023-05-03 13:15     ` Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 2/6] vf_fps: properly preserve CEA-708 captions Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 3/6] yadif: Properly preserve CEA-708 closed captions Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 4/6] tinterlace: " Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 5/6] vf_ccrepack: Add new filter to repack CEA-708 side data Devin Heitmueller
2023-04-30 22:42   ` Lance Wang
2023-05-02 14:17     ` Devin Heitmueller
2023-04-28 16:37 ` [FFmpeg-devel] [PATCH v4 6/6] decklink_enc: add support for playout of 608 captions in MOV files Devin Heitmueller
2023-04-30 23:01   ` Lance Wang
2023-05-02 14:47     ` Devin Heitmueller [this message]
2023-05-03  7:36       ` Lance Wang

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=CAHGibzH32gBsj9qagsTpMtPFbR3TFiCSQw_OLLF5DpWpmsaieA@mail.gmail.com \
    --to=devin.heitmueller@ltnglobal.com \
    --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