Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [RFC] Moving edit list handling out of demuxers
@ 2025-06-13 10:55 Tomas Härdin
  2025-06-13 12:51 ` Kieran Kunhya via ffmpeg-devel
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Tomas Härdin @ 2025-06-13 10:55 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi

In my fiddling with fragmented indexes in mov.c I ran cross
mov_fix_index(), which has been in the codebase since September 2016.
The intent of this function is to implement limited support for edit
lists (elst). More rudely one could say it implements half-assed
support for edit lists. Besides the way it's implemented being
incredibly cursed, I feel strongly that this is not something that a
demuxer should do, partly because it's not something a demuxer *can*
do. There are a number of reasons why:

1) demuxers are not part of the presentation layer
2) the demuxer must lie about what the file actually contains
3) the ISOBMFF spec mandates being able to cut on samples, not just
frames. for audio, there is no way to do that from a demuxer
4) similarly, there is no way (I think) to implement "dwell" segments

The second point becomes painfully clear when one looks at
mov_fix_index(). FFStream.index_entries is completely replaced. The
function is not idempotent. For the kind of work I'm doing right now
this is a huge problem.

As I see it, the way forward is:

1) introduce API for edit lists, so that users can decide themselves
what to do
2) implement basic support for edit lists in the ffmpeg CLI
3) remove edit list hacks from all demuxers, especially mov.c

The main issue I see with this is that it risks turning ffmpeg into an
NLE tool, which would be a waste of developer effort better spent on
melt and related tools (kdenlive, shotcut etc). The present level of
edit list support could be reimplemented by just fiddling with the -ss
and -t options. That is, the ffmpeg CLI could automatically derive -ss
and -t from the edit list extracted by lavf.

If this stuff is done correctly then it should be possible to remux MOV
to MXF while keeping the edit lists and the original uncut essence. And
of course back again to MOV if so desired.

I haven't sketched out any API yet, but it would probably closely
mirror how elst works in MOV. Care should be taken that MXF operational
pattern 3a can also fit into this API. Possibly even OP3c.

Thoughts?

/Tomas
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-06-18 15:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-13 10:55 [FFmpeg-devel] [RFC] Moving edit list handling out of demuxers Tomas Härdin
2025-06-13 12:51 ` Kieran Kunhya via ffmpeg-devel
2025-06-13 13:28   ` Derek Buitenhuis
2025-06-13 14:34   ` Tomas Härdin
2025-06-13 14:41     ` Derek Buitenhuis
2025-06-13 14:21 ` Michael Niedermayer
2025-06-13 14:53   ` Tomas Härdin
2025-06-13 14:57     ` Gyan Doshi
2025-06-17 20:42       ` Tomas Härdin
2025-06-13 16:19     ` Michael Niedermayer
2025-06-17 21:15       ` Tomas Härdin
2025-06-18  3:55         ` Michael Niedermayer
2025-06-18 10:02           ` Michael Niedermayer
2025-06-18 10:09             ` Nicolas George
2025-06-18 15:50           ` Tomas Härdin
2025-06-13 16:22     ` Michael Niedermayer
2025-06-13 14:37 ` Gyan Doshi
2025-06-17 21:33   ` Tomas Härdin
2025-06-18  4:15     ` Gyan Doshi
2025-06-18  7:17     ` Nicolas George
2025-06-13 16:57 ` Nicolas George

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