Plazik писал(а):В
Dolby Reference Player можно декодировать программно E-AC3, AC4 и TrueHD с Atmos, смотреть информацию о файле и проигрывать звук под разные speaker layouts (до 9.1.6). Сама прога не очень информативна, можно только наблюдать, какие каналы звук активны в данный момент.
Через консольную прогу
drp можно декодировать звук в WAV файл, но только в 2.0, 3.1, 5.1 и 7.1.
Посмотрел как устроена программа, она сделана через GStreamer, декодеры сделаны в виде плагинов:
. \\gst-inspect-1.0.exe --gst-plugin-path gst-plugins
- Код: Выделить всё
dlbtruehdparse: audio/x-true-hd: mlp, vr
dlbtruehdparse: dlbtruehdparse: Dolby TrueHD Parser
dlbtruehddec: dlbtruehddec: Dolby TrueHD Decoder
dlbproresdec: dlbproresdec: ProRes Decoder
dlboar: dlboar: Object Audio Renderer plugin
dlblevelbin: dlblevelbin: Dolby bin for Filter/Analyzer/Audio
dlbh265parserbin: dlbh265parserbin: Dolby HEVC Parser Bin
dlbh265impactdec: dlbh265impactdec: Dolby IMPACT 3 (HEVC) Decoder
dlbh264parserbin: dlbh264parserbin: Dolby AVC Parser Bin
dlbdualfilesrcbin: dlbdualfilesrcbin: Dolby Dual File Source Bin
dlbdapvr: dlbdapvr: Dolby Audio Processing Virtual Reality plugin
dlbchannelvolume: dlbchannelvolume: Per-channel volume
dlbchanneldelay: dlbchanneldelay: Per-channel delay
dlbaudiodecbin: dlbaudiodecbin: Dolby Audio Decoder Bin
dlbasiosink: dlbasiosink: Dolby ASIO audio sink
dlbasiosink: dlbasiosinkdeviceprovider (GstDeviceProviderFactory)
dlbajasrc: dlbajasrc: AJA KONA 4 SDI source plugin
dlbac4parse: audio/x-ac4: ac4
dlbac4parse: dlbac4parse: Dolby AC-4 Parser
dlbac4dec: dlbac4dec: Dolby AC-4 Decoder
dlbac3parse: dlbac3typefind: ac3, ec3, eac3, eb3
dlbac3parse: dlbac3parse: Dolby AC-3 and E-AC-3 Parser
dlbac3dec: dlbac3dec: Dolby E-AC-3 and AC-3 Decoder
Наиболее интересный плагин это dlbaudiodecbin, который отвечает за декодирование распарсенного потока:
. \\gst-inspect-1.0.exe --gst-plugin-path gst-plugins dlbaudiodecbin
Доступные настройки:
- Код: Выделить всё
Element Properties:
ac3dec-dmx-mode : Set two-channel downmix mode
flags: readable, writable, controllable
Enum "DlbAc3DecDmxMode" Default: 0, "auto"
(0): auto - Auto detect
(1): lt/rt - Surround compatible
(2): lo/ro - Stereo
ac3dec-drc-boost : Set the dynamic range control boost scale factor
flags: readable, writable, controllable
Integer.Range: 0 - 100 Default: 100
ac3dec-drc-cut : Set the dynamic range control cut scale factor
flags: readable, writable, controllable
Integer.Range: 0 - 100 Default: 100
ac3dec-drc-mode : Set the dynamic range control mode
flags: readable, writable, controllable
Enum "DlbAc3DecDrcMode" Default: 2, "line"
(0): custom-0 - Custom mode, analog dialnorm
(1): custom-1 - Custom mode, digital dialnorm
(2): line - Line out mode
(3): rf - RF mode
(4): portable-8 - Portable mode -8dB (output reference level is -8dB)
(5): portable-11 - Portable mode -11dB (output reference level is -11dB)
(6): portable-14 - Portable mode -14dB (output reference level is -14dB)
ac3dec-drc-suppress: Suppress dynamic range control
flags: readable, writable
Boolean.Default: false
ac3dec-drop-delay: Drop delay samples added by the decoder at the stream start
flags: readable, writable
Boolean.Default: false
ac3dec-max-errors: Max consecutive decoder errors before returning flow error
flags: readable, writable
Integer.Range: -1 - 2147483647 Default: 10
ac4dec-ajoc-core-enabled: Enable advanced joint object coding core decoder
flags: readable, writable
Boolean.Default: true
ac4dec-dap-enabled: Enable Dolby Audio Processing
flags: readable, writable
Boolean.Default: true
ac4dec-de-level : Set Dialog Enhancement preferred Level
flags: readable, writable
Integer.Range: -12 - 12 Default: 0
ac4dec-dmx-mode : Set stereo downmix mode
flags: readable, writable
Enum "DlbAc4DecDmxMode" Default: 512, "lo/ro"
(512): lo/ro - Stereo
(513): lt/rt - Surround compatible, Pro Logic
(514): plII - Surround compatible, Pro Logic II
(528): hp - Headphone virtualization
(529): sp - Speaker virtualization
ac4dec-drc-enabled: Enable dynamic range control
flags: readable, writable
Boolean.Default: true
ac4dec-drop-delay: Drop delay samples added by the decoder at the stream start
flags: readable, writable
Boolean.Default: false
ac4dec-front-speaker-angle: Provide a front speaker angle
flags: readable, writable
Integer.Range: 0 - 30 Default: 10
ac4dec-ieq-profile: Select Intelligent Equalizer profile
flags: readable, writable
Enum "GstAc4DecIeqProfile" Default: 0, "disabled"
(0): disabled - Disabled
(1): detailed - Detailed
(2): balanced - Balanced
(3): warm - Warm
ac4dec-ieq-strength: Select Intelligent Equalizer strength
flags: readable, writable
Integer.Range: 0 - 16 Default: 10
ac4dec-limiter-enabled: Enable limiter
flags: readable, writable
Boolean.Default: true
ac4dec-lpde-enabled: Enable loudness-preserving mode in Dialogue Enancement
flags: readable, writable
Boolean.Default: true
ac4dec-main-assoc-mix-level: Set main and associated mixing level
flags: readable, writable
Integer.Range: -32 - 32 Default: 0
ac4dec-main-assoc-mode: Set main and associated decoding modes
flags: readable, writable
Enum "GstAc4DecMainAssocMode" Default: 1, "all"
(1): all - All
(16): main - Main
(17): associated - Associated
ac4dec-max-errors: Max consecutive decoder errors before returning flow error
flags: readable, writable
Integer.Range: -1 - 2147483647 Default: 10
ac4dec-out-cplx-level: Set output complexity level
flags: readable, writable
Enum "GstAc4DecOutputCplxLevel" Default: 2303, "5.1.2"
(767): 2.0 - 2.0
(1791): 5.1 - 5.1
(2303): 5.1.2 - 5.1.2
(2815): 5.1.4 - 5.1.4
ac4dec-out-ref-level: Set output reference level.Values from -6 to -1 are not permitted!
flags: readable, writable
Integer.Range: -31 - 0 Default: -31
ac4dec-pres-index: Set presentation index
flags: readable, writable
Integer.Range: 0 - 512 Default: 0
async-handling : The bin will handle Asynchronous state changes
flags: readable, writable
Boolean.Default: false
channel-map : Set mapping of decoded channels to output channels.The map is an array of pairs where
first element in pair is a numerical value of channel id from GstAudioChannelPosition,
and second element is an index of an output channel.For example, to switch stereo
channels, set channel-map to "<<0,1>, <1,0>>"
flags: readable, writable
GstValueArray of GValues of type "GstValueArray"
message-forward : Forwards all children messages
flags: readable, writable
Boolean.Default: false
name : The name of the object
flags: readable, writable, 0x2000
String.Default: "dlbaudiodecbin0"
oar-bass-ext-mode: Enable bass extraction with the given cutoff frequency
flags: readable, writable
Enum "DlbOarBassExtractionMode" Default: -1, "off"
(-1): off - Bass extraction disabled
(0): 45 - Bass extraction enabled at 45Hz
(1): 50 - Bass extraction enabled at 50Hz
(2): 55 - Bass extraction enabled at 55Hz
(3): 60 - Bass extraction enabled at 60Hz
(4): 70 - Bass extraction enabled at 70Hz
(5): 80 - Bass extraction enabled at 80Hz
(6): 90 - Bass extraction enabled at 90Hz
(7): 100 - Bass extraction enabled at 100Hz
(8): 110 - Bass extraction enabled at 110Hz
(9): 120 - Bass extraction enabled at 120Hz
(10): 130 - Bass extraction enabled at 130Hz
(11): 140 - Bass extraction enabled at 140Hz
(12): 150 - Bass extraction enabled at 150Hz
(13): 160 - Bass extraction enabled at 160Hz
(14): 170 - Bass extraction enabled at 170Hz
(15): 180 - Bass extraction enabled at 180Hz
(16): 190 - Bass extraction enabled at 190Hz
(17): 200 - Bass extraction enabled at 200Hz
oar-drop-delay : Drop delay samples added by the OAR at the stream start
flags: readable, writable
Boolean.Default: false
oar-limiter-enable: Enable object audio renderer limiter
flags: readable, writable
Boolean.Default: true
out-ch-config : Set output channel configuration
flags: readable, writable, controllable
Enum "DlbAudioDecBinOutChConfigType" Default: 0, "2.0"
(0): 2.0 - channels: L, R
(3): 3.1 - channels: L, R, C, LFE
(7): 5.1 - channels: L, R, C, LFE, Ls, Rs
(11): 7.1 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs
(12): 9.1 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw
(13): 5.1.2 - channels: L, R, C, LFE, Ls, Rs, Ltm, Rtm
(14): 5.1.4 - channels: L, R, C, LFE, Ls, Rs, Ltf, Rtf, Ltr, Rtr
(15): 7.1.2 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltm, Rtm
(16): 7.1.4 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltf, Rtf, Ltr, Rtr
(17): 7.1.6 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltf, Rtf, Ltm, Rtm, Ltr, Rtr
(18): 9.1.2 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltm, Rtm
(19): 9.1.4 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltf, Rtf, Ltr, Rtr
(20): 9.1.6 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltf, Rtf, Ltm, Rtm, Ltr, Rtr
parent : The parent of the object
flags: readable, writable, 0x2000
Object of type "GstObject"
truehddec-drc-boost: Set the dynamic range control boost scale factor
flags: readable, writable, controllable
Integer.Range: 0 - 100 Default: 100
truehddec-drc-cut: Set the dynamic range control cut scale factor
flags: readable, writable, controllable
Integer.Range: 0 - 100 Default: 100
truehddec-drc-mode: Set the dynamic range control mode
flags: readable, writable, controllable
Enum "DlbTruehdDecDrcMode" Default: 0, "disabled"
(0): disabled - DRC disabled
(1): follow - Normal mode follows bitstream control flag
(2): normal - Normal mode
(3): heavy - Heavy mode
truehddec-max-errors: Max consecutive decoder errors before returning flow error
flags: readable, writable
Integer.Range: -1 - 2147483647 Default: 10
truehddec-presentation: Set presentation
flags: readable, writable, controllable
Enum "DlbTruehdDecPresentation" Default: 0, "0"
(0): 0 - Auto presentation
(2): 2 - 2-Channel presentation
(6): 6 - 6-Channel presentation
(8): 8 - 8-Channel presentation
(16): 16 - 16-Channel presentation
Набросал небольшой скриптик
https://gist.github.com/Plazik/e950267c ... 879aaa3d5d для декодирования E-AC3 и TrueHD в отдельный WAV файлы (до 16). Использование:
python atmos_decode.py -i atmos.thd
По умолчанию декодируется в 9.1.6 (16 файлов), параметром -c можно выбрать нужную конфигурацию:
2.0 - channels: L, R
3.1 - channels: L, R, C, LFE
5.1 - channels: L, R, C, LFE, Ls, Rs
7.1 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs
9.1 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw
5.1.2 - channels: L, R, C, LFE, Ls, Rs, Ltm, Rtm
5.1.4 - channels: L, R, C, LFE, Ls, Rs, Ltf, Rtf, Ltr, Rtr
7.1.2 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltm, Rtm
7.1.4 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltf, Rtf, Ltr, Rtr
7.1.6 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Ltf, Rtf, Ltm, Rtm, Ltr, Rtr
9.1.2 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltm, Rtm
9.1.4 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltf, Rtf, Ltr, Rtr
9.1.6 - channels: L, R, C, LFE, Ls, Rs, Lrs, Rrs, Lw, Rw, Ltf, Rtf, Ltm, Rtm, Ltr, Rtr

sound config.jpg (52.28 КБ) Просмотров: 2959