diff --git a/README.md b/README.md index 0ffac8b18..4277eec52 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ It was originally designed to query, inspect and debug media codecs and containe [aac_frame](doc/formats.md#aac_frame), adts, adts_frame, -[adm](doc/formats.md#adm), aiff, amf0, apev2, @@ -54,7 +53,6 @@ avc_sei, avc_sps, [avi](doc/formats.md#avi), [avro_ocf](doc/formats.md#avro_ocf), -[axml](doc/formats.md#adm), [bencode](doc/formats.md#bencode), bitcoin_blkdat, [bitcoin_block](doc/formats.md#bitcoin_block), @@ -68,9 +66,7 @@ bsd_loopback_frame, bzip2, [caff](doc/formats.md#caff), [cbor](doc/formats.md#cbor), -[chna](doc/formats.md#adm), [csv](doc/formats.md#csv), -[dolby_metadata](doc/formats.md#dolby_metadata), dns, dns_tcp, [dolby_metadata](doc/formats.md#dolby_metadata), diff --git a/doc/formats.md b/doc/formats.md index 75e173471..e0138c63a 100644 --- a/doc/formats.md +++ b/doc/formats.md @@ -7,7 +7,6 @@ |[`aac_frame`](#aac_frame) |Advanced Audio Coding frame || |`adts` |Audio Data Transport Stream |`adts_frame`| |`adts_frame` |Audio Data Transport Stream frame |`aac_frame`| -|[`adm`](#adm) |Audio Definition Model |`riff`| |`aiff` |Audio Interchange File Format || |`amf0` |Action Message Format 0 || |`apev2` |APEv2 metadata tag |`image`| @@ -26,7 +25,6 @@ |`avc_sps` |H.264/AVC Sequence Parameter Set || |[`avi`](#avi) |Audio Video Interleaved |`avc_au` `hevc_au` `mp3_frame` `flac_frame`| |[`avro_ocf`](#avro_ocf) |Avro object container file || -|[`axml`](#adm) |Audio Definition Model  Chunk |`riff`| |[`bencode`](#bencode) |BitTorrent bencoding || |`bitcoin_blkdat` |Bitcoin blk.dat |`bitcoin_block`| |[`bitcoin_block`](#bitcoin_block) |Bitcoin block |`bitcoin_transaction`| @@ -40,9 +38,7 @@ |`bzip2` |bzip2 compression |`probe`| |[`caff`](#caff) |Live2D Cubism archive |`probe`| |[`cbor`](#cbor) |Concise Binary Object Representation || -|[`chna`](#adm) |Audio Definition Model  Chunk |`riff`| |[`csv`](#csv) |Comma separated values || -|[`dolby_metadata`](#dolby_metadata) |Dolby Metadata (Atmos, AC3, Digital Plus) |`riff`| |`dns` |DNS packet || |`dns_tcp` |DNS packet (TCP) || |[`dolby_metadata`](#dolby_metadata) |Dolby Metadata (Atmos, AC3, Dolby Digital) || @@ -184,27 +180,6 @@ Decode value as aac_frame ... | aac_frame({object_type:1}) ``` -## adm -[Audio Definition Model](https://adm.ebu.io/background/what_is_the_adm.html) including 3D Audio. - -RIFF / WAV / Broadcast Wave Format (BWF) chunks: -- `` Chunk, Track UIDs of Audio Definition Model -- `` Chunk, BWF XML Metadata, e.g. for Audio Definition Model ambisonics and elements - -### Examples -Decode ADM configuration from `` and `` chunks: -``` -$ fq -d wav '.chunks[] | select(.id | IN("chna", "axml")) | tovalue' bwf.wav -``` - -### Authors -- [@johnnymarnell](https://johnnymarnell.github.io), original author - -### References -- https://adm.ebu.io/background/what_is_the_adm.html -- https://tech.ebu.ch/publications/tech3285s7 -- https://tech.ebu.ch/publications/tech3285s5 - ## apple_bookmark Apple BookmarkData. @@ -625,7 +600,7 @@ including Dolby Atmos, AC3, Dolby Digital \[Plus\], and Dolby Audio Info (e.g. L ### Examples Decode Dolby metadata from `` chunk: ``` -$ fq -d wav '.chunks[] | select(.id | IN("dbmd")) | tovalue' bwf.wav +$ fq -d wav '.chunks[] | select(.id | IN("dbmd")) | tovalue' adm-bwf.wav ``` RIFF / WAV / Broadcast Wave Format (BWF) chunks: @@ -641,6 +616,7 @@ RIFF / WAV / Broadcast Wave Format (BWF) chunks: - https://tech.ebu.ch/publications/tech3285s5 - https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech3285s6.pdf - https://github.com/DolbyLaboratories/dbmd-atmos-parser +- https://github.com/MediaArea/MediaInfoLib/tree/Source/MediaInfo/Audio/File_DolbyAudioMetadata.cpp ## fit Garmin Flexible and Interoperable Data Transfer. @@ -834,6 +810,7 @@ LevelDB Table. - Zstandard uncompression is not implemented yet. ### Authors + - [@mikez](https://github.com/mikez), original author ### References diff --git a/format/riff/dolby_metadata.go b/format/riff/dolby_metadata.go index 5d8cd4414..4679e3f06 100644 --- a/format/riff/dolby_metadata.go +++ b/format/riff/dolby_metadata.go @@ -83,6 +83,19 @@ var compressionDescMap = scalar.UintMapSymStr{ 5: "speech", } +var downmix5to2DescMap = scalar.UintMap{ + 0: {Sym: "not_indicated", Description: "Not indicated (Lo/Ro)"}, + 1: {Sym: "loro", Description: "Lo/Ro"}, + 2: {Sym: "ltrt_dpl", Description: "Lt/Rt (Dolby Pro Logic)"}, + 3: {Sym: "ltrt_dpl2", Description: "Lt/Rt (Dolby Pro Logic II)"}, + 4: {Sym: "direct_stereo_render", Description: "Direct stereo render"}, +} + +var phaseShift5to2DescMap = scalar.UintMap{ + 0: {Sym: "no_shift", Description: "Without Phase 90"}, + 1: {Sym: "shift_90", Description: "With Phase 90"}, +} + var bitstreamModeMap = scalar.UintMapDescription{ 0b000: "main audio service: complete main (CM)", 0b001: "main audio service: music and effects (ME)", @@ -105,10 +118,10 @@ var binauralRenderModeMap = scalar.UintMapSymStr{ } var warpModeMap = scalar.UintMap{ - 0: {Sym: "normal"}, - 1: {Sym: "warping"}, - 2: {Sym: "downmix_dolby_pro_logic_iix"}, - 3: {Sym: "downmix_loro"}, + 0: {Sym: "normal", Description: "possibly: Direct render"}, + 1: {Sym: "warping", Description: "possibly: Direct render with room balance"}, + 2: {Sym: "downmix_dolby_pro_logic_iix", Description: "Dolby Pro Logic IIx"}, + 3: {Sym: "downmix_loro", Description: "possibly: Standard (Lo/Ro)"}, 4: {Sym: "not_indicated", Description: "Default warping will be applied"}, } @@ -236,29 +249,35 @@ func parseAudioInfo(d *decode.D) { } func parseDolbyAtmos(d *decode.D) { - // TODO: both these are fixed size null terminated strings? d.FieldUTF8NullFixedLen("atmos_dbmd_content_creation_preamble", 32) d.FieldUTF8NullFixedLen("atmos_dbmd_content_creation_tool", 64) d.FieldStruct("version", func(d *decode.D) { d.FieldU8("major") d.FieldU8("minor") - d.FieldU8("micro") + d.FieldU8("patch") }) + // TODO: All these unknowns? (mostly from MediaInfoLib, also Dolby repo) + + d.FieldRawLen("unknown0", 21*8) + + d.FieldRawLen("unknown1", 1) + d.FieldU3("downmix_5to2", scalar.UintSym("unknown"), downmix5to2DescMap) + d.FieldRawLen("unknown2", 2) + d.FieldU2("phaseshift_90deg_5to2", scalar.UintSym("unknown"), phaseShift5to2DescMap) - // TODO: what is this? - d.FieldRawLen("unknown0", 53*8) + d.FieldRawLen("unknown3", 12*8) - d.FieldU8("warp_mode", warpModeMap) + d.FieldRawLen("bed_distribution", 2) + d.FieldRawLen("reserved0", 3) + d.FieldU3("warp_mode", warpModeMap) - // TODO: what is this? - d.FieldRawLen("unknown1", 15*8) - d.FieldRawLen("unknown2", 80*8) + d.FieldRawLen("unknown4", 15*8) + d.FieldRawLen("unknown5", 80*8) } func parseDolbyAtmosSupplemental(d *decode.D) { d.FieldU32("dasms_sync", d.UintAssert(0xf8726fbd), scalar.UintHex) - // TODO: wav.go sets LE default i think? objectCount := int64(d.FieldU16("object_count")) d.FieldU8("reserved") diff --git a/format/riff/dolby_metadata.md b/format/riff/dolby_metadata.md index f3e952e5f..19386780f 100644 --- a/format/riff/dolby_metadata.md +++ b/format/riff/dolby_metadata.md @@ -20,3 +20,4 @@ RIFF / WAV / Broadcast Wave Format (BWF) chunks: - https://tech.ebu.ch/publications/tech3285s5 - https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech3285s6.pdf - https://github.com/DolbyLaboratories/dbmd-atmos-parser +- https://github.com/MediaArea/MediaInfoLib/tree/Source/MediaInfo/Audio/File_DolbyAudioMetadata.cpp