Add muxer support for E-AC-3 and Dolby Atmos (E-AC-3 JOC)#3317
Add muxer support for E-AC-3 and Dolby Atmos (E-AC-3 JOC)#3317rexjin-meta wants to merge 1 commit into
Conversation
|
Findings
|
Implement the dec3 box (EC3SpecificBox) and ec-3 fourcc in Boxes.java so Mp4Muxer and FragmentedMp4Muxer can write E-AC-3 and Dolby Atmos audio tracks. The dec3 payload is carried verbatim from format.initializationData, following the same pattern as av1C. Direct callers can mux Atmos by supplying the raw dec3 payload as csd-0. E-AC-3 is intentionally NOT added to SUPPORTED_AUDIO_SAMPLE_MIME_TYPES yet: the MP4 extractor does not currently preserve the raw dec3 payload in Format.initializationData, so advertising support would make the default Transformer attempt a direct stream-copy that then fails while writing moov. E-AC-3 will be added to the supported list in a follow-up once the extractor preserves the dec3 payload. Unit tests added to BoxesTest cover: - dec3 box wraps csd-0 payload verbatim for AUDIO_E_AC3 - dec3 box wraps csd-0 payload verbatim for AUDIO_E_AC3_JOC - IllegalArgumentException is thrown when initializationData is absent
5f86373 to
c00a263
Compare
|
Hey @FongMi and @snow2405 , Thanks for the reviews — addressed both comments:
Also added a unit test asserting the ec-3 fourcc on the audio sample entry. This PR will laser focus on enabling muxer to write atmos. |
Problem
Mp4Muxer and FragmentedMp4Muxer had no support for E-AC-3 (audio/eac3) or E-AC-3 JOC (audio/eac3-joc, the container format for Dolby Atmos). Attempting to mux an E-AC-3 or Atmos audio track into an MP4 container would fail at the supported-format check, making stream-copy of these tracks impossible.
Changes
Testing
Regarding an end-to-end parameterized test — sample_eac3joc.mp4 is already in the test asset library. The blocker is that BoxParser currently parses the dec3 box into Format fields (channel count, sample rate, mime type) but does not carry the raw bytes forward into
Format.initializationData. This is a pre-existing behavior in the extractor, not introduced by this PR. Since Mp4Muxer needs those raw bytes to write the dec3 box, the full round-trip pipeline doesn't connect yet. Happy to add the end-to-end test once that extractor behavior is addressed, or if the team has a preferred approach for bridging that gap.