[FFmpeg-devel] [PATCH v3 1/2] avformat/avcodec: Add DTS-UHD demuxer and parser, movenc support.

Roy Funderburk royffmpeg at funderburk.us
Tue Jun 13 21:20:32 EEST 2023

On 6/13/23 11:09 AM, Paul B Mahol wrote:
> Parser just splits bitstream into packets and packets are then passed to
> decoders. Demuxer in such case pass fixed packet sizes to parser minus
> optional header/trailer bytes.
> There should be no reason for such complexity in parser and/or demuxer if
> there are in bitstream valid markers for start/end of packet that is given
> to decoder.
> Unless this format uses packets that may be not byte aligned than and/or
> markers are useless and/or there are no size info of each packet feed to
> decoder in such case and only in such case current complexity is valid.

The dtsuhd audio frames are variable length.  The length of the audio frames cannot be determined by reading a field in the frame header, instead the frame must be parsed and only then can the frame length be determined by adding the sizes of the elements parsed.  So we do have the complexity you refer to.  While the frame signature (first four bytes) is unlikely to occur within a frame, such a false positive is possible, so we cannot rely on the signature alone.

More information about the ffmpeg-devel mailing list