[FFmpeg-devel] [PATCH 2/3] lavf/srtdec: Permit streaming input

Tomas Härdin git at haerdin.se
Sat Mar 30 17:23:39 EET 2024


lör 2024-03-30 klockan 15:49 +0100 skrev Nicolas George:
> Tomas Härdin (12024-03-30):
> > Players can implement sorting if they wish.
> 
> API break.

lavf's API provides no guarantees regarding presentation order
> 

> > Finally I will note that sorting does not happen when subtitles are
> > muxed in say mkv or avi, so the behavior is not even consistent
> > across
> > demuxers that support subtitles.
> 
> AVI or MKV demuxer do not sort their packets because the packets are
> supposed to be already sorted;

"Supposed to" is doing a lot of work here. IIRC AVI is fundamentally
incapable of providing out-of-order anything, this is true (B-frames
being notably haram in AVI). It is however capable of providing poorly
muxed files. For example it is perfecectly legal in AVI to mux all
video, then all audio, rather than the typical case where audio and
video are interleaved (the I in AVI). The same goes for many formats.
MOV supports basically any ordering via ctts shenanigans if I'm not
mistaken.

> ASS demuxer sorts its packets because
> there is no guarantee the text are sorted in the file

So? I'm making a normative argument.

/Tomas


More information about the ffmpeg-devel mailing list