[FFmpeg-devel] [RFC] Moving edit list handling out of demuxers
Michael Niedermayer
michael at niedermayer.cc
Fri Jun 13 17:21:18 EEST 2025
Hi Tomas
On Fri, Jun 13, 2025 at 12:55:56PM +0200, Tomas Härdin wrote:
> 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
+1
> 2) implement basic support for edit lists in the ffmpeg CLI
+1
> 3) remove edit list hacks from all demuxers, especially mov.c
+1 (with ABI +2 bump)
>
> The main issue I see with this is that it risks turning ffmpeg into an
> NLE tool,
If ffmpeg could do NLE, that would not be a bad thing
And a full implementation of edit lists may be equivalent to this.
I think thats a win not a loss
[...]
> 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.
yeah
>
> 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?
it would be cool if someone implemented this, its not trivial as all
sides need to support it. demuxer, muxer, player, ffmpeg
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What is money laundering? Its paying someone and not telling the government.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250613/0aca7a4f/attachment.sig>
More information about the ffmpeg-devel
mailing list