Skip to content

Handling audio priming offsets in the absence of edit lists in MP4 #199

Description

@thurinus

I have a MP4 file generated with ffmpeg that has an mp4a-encoded audio track that beeps every second. It contains an edit list with a specified media_time of 1024, which makes Mediabunny (correctly) begin emitting samples offset from the first priming packet.
https://github.com/user-attachments/assets/e37d5e3c-7b7d-4f66-b220-b834a49604d6

I have another which is basically the same file, just with no edit list (media_time of 0). This would cause Mediabunny to emit the priming silence in the first packet when decoding.
https://github.com/user-attachments/assets/14ba3588-d227-4032-8e65-34da818b8d78

Audacity seems to do the same thing and include the silence:
Image

However, Audition ignores the first packet, honouring the intent of the original file:
Image

If the edit list isn’t present and we know the first packet doesn’t produce samples, should we assume an implicit offset of the first packet’s duration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions