Feature Request: Implement DolbyE Audio Decoding in VLC (FFMpeg supports it)
It would be cool if VLC supported DolbyE audio decoding on the fly instead of hearing just noise.
Expected behavior of the wanted feature
Once playing a mov or an mxf file with DolbyE 5.1 tracks, VLC should be able to recognize them and decode them. The decoding is already supported in FFMpeg.
Actual behavior of VLC
Audio is decoded as noise.
How to reproduce
Step 1: Download the sample file from here: https://user-images.githubusercontent.com/18946343/140714716-a851a758-7057-4f45-b553-19d075f97d8c.mov
Step 2: Play it in VLC
Step 3: Hear the noise on the audio track
Audio Layout of the Sample:
The sample has the following audio layout:
Track 1: DolbyE 5.1 + 2.0 Stereo Downmix
Mediainfo
General
Complete name : /home/FranceBB/Downloads/DolbyE.mov
Format : MPEG-4
Commercial name : XDCAM HD422
Format profile : QuickTime
Codec ID : qt 0000.02 (qt )
File size : 8.64 MiB
Duration : 2 s 80 ms
Overall bit rate : 34.9 Mb/s
Writing application : Lavf59.5.100
Video
ID : 1
Format : MPEG Video
Commercial name : XDCAM HD422
Format version : Version 2
Format profile : 4:2:2@High
Format settings : BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Default
Format settings, GOP : M=3, N=12
Format settings, picture structure : Frame
Codec ID : xd5c
Duration : 2 s 80 ms
Source duration : 2 s 40 ms
Bit rate mode : Constant
Bit rate : 31.2 Mb/s
Maximum bit rate : 50.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Separated fields (2 fields per block)
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.601
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Closed
Stream size : 7.73 MiB (89%)
Source stream size : 8.09 MiB (94%)
mdhd_Duration : 2080
Codec configuration box : glbl
Audio #1
ID : 2-1
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : in24
Duration : 2 s 0 ms
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Stream size : 315 KiB (4%)
Title : Sky_Italia_Program_1
Default : Yes
Alternate group : 1
Audio #2
ID : 2-2
Format : Dolby E
Format settings : Little
Muxing mode : SMPTE ST 337
Codec ID : in24
Duration : 2 s 0 ms
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -9 h 59 min
Stream size : 123 KiB (1%)
Title : Sky_Italia_Program_2
Default : Yes
Alternate group : 1
Other
ID : 3
Type : Time code
Format : QuickTime TC
Duration : 2 s 80 ms
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
Time code of last frame : 10:00:02:01
Time code, striped : Yes
Language : English
Default : No
mdhd_Duration : 2080
How to decode DolbyE 5.1 with FFMpeg
@echo off
setlocal EnableDelayedExpansion
cd /d %~dp0
for %%a in (%*) do (
call :inizia %%a
shift
)
exit
:inizia
ffmpeg.exe -i %1 -map 0:1 -acodec copy -f u8 -y stream1.u8
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out1.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out2.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out3.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out4.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out5.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out6.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out7.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out8.wav
pause
:eof
And obviously it's possible to create a 5.1 PCM as track 1 and a 2.0 Stereo as Track 2 like so:
#Extract DolbyE track 1
ffmpeg -i "DolbyE.mov" -map 0:1 -acodec copy -f u8 -y "stream1.u8"
#Extract each channel of DolbyE 5.1
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y "FL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y "FR.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y "CC.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y "LFE.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y "SL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y "SR.wav"
#Extract each channel of DolbyE 2.0
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y $jobOutputFolder:Left.wav
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.0 -y $jobOutputFolder:Right.wav
#Audio 5.1
ffmpeg -i "FL.wav" -i "FR.wav" -i "CC.wav" -i "LFE.wav" -i "SL.wav" -i "SR.wav" -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track1_51.wav"
#Audio 2.0
ffmpeg -i "Left.wav" -i "Right.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track2_20.wav"
Since this can be done in FFMpeg, I suppose it could be implemented inside VLC itself and it would be a very appreciated added value to this player.