Wrong channel count when muxing raw 6.1 DTS-ES
Using a Sample (https://drive.google.com/open?id=17GvV7mOGPaLMaOmJuyZv7AfhRsdrBM-D) which has 6.1 DTS-HD audio
mediainfo.exe c:\Users\Selur\Desktop\Sample_7Ch-001.mkv
General
Unique ID : 305643535159227373137804081320895496115 (0xE5F0CDBD216A8CAF2B4160690D24BFB3)
Complete name : c:\Users\Selur\Desktop\Sample_7Ch-001.mkv
Format : Matroska
Format version : Version 4
File size : 102 MiB
Duration : 1 min 2 s
Overall bit rate mode : Variable
Overall bit rate : 13.7 Mb/s
Encoded date : UTC 2019-12-28 21:56:35
Writing application : mkvmerge v41.0.0.27 ('Smarra') 64-bit
Writing library : libebml v1.3.10 + libmatroska v1.5.2
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 2 frames
Format settings, GOP : M=1, N=10
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 min 2 s
Bit rate mode : Variable
Bit rate : 9 771 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.197
Stream size : 72.5 MiB (71%)
Default : Yes
Forced : No
Audio
ID : 2
Format : DTS ES XXCH XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 1 min 2 s
Bit rate mode : Variable
Bit rate : 3 917 kb/s
Channel(s) : 7 channels
Channel layout : C L R Ls Rs LFE Cb
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless
Stream size : 29.1 MiB (29%)
Language : English
Default : Yes
Forced : No
I use:
ffmpeg -y -threads 8 -i "C:\Users\Selur\Desktop\Sample_7Ch-001.mkv" -map 0:1 -vn -sn -bsf:a dca_core -acodec copy -map_metadata -1 "E:\Temp\iId_1_aid_0_lang_en_09_28_20_8410_01.dts"
to extract the dts core and get:
mediainfo.exe "e:\Temp\iId_1_aid_0_lang_en_09_28_20_8410_01.dts"
General
Complete name : e:\Temp\iId_1_aid_0_lang_en_09_28_20_8410_01.dts
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
File size : 11.2 MiB
Duration : 1 min 2 s
Overall bit rate mode : Constant
Overall bit rate : 1 509 kb/s
Audio
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 7 channels
Channel layout : C L R Ls Rs Cb LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 11.2 MiB
so far so good. Notice the core is DTS-ES with 6.1 audio. Muxing the audio using mkvmerge using:
mkvmerge --ui-language en -o "E:\Output\Sample_7Ch-001.mkv" --global-tags "E:\Temp\Sample_7Ch-001_09_28_20_8410__02.xml" --language 0:en --default-track 0:yes --forced-track 0:no -a 0 --compression -1:none --no-video --no-subtitles --no-chapters "E:\Temp\iId_1_aid_0_lang_en_09_28_20_8410_01.dts"
I get:
mediainfo.exe "e:\Output\Sample_7Ch-001.mkv"
General
Unique ID : 297622948022399407897597109173123386592 (0xDFE81843105E42451110FB9E70E98CE0)
Complete name : e:\Output\Sample_7Ch-001.mkv
Format : Matroska
Format version : Version 4
File size : 11.2 MiB
Duration : 1 min 2 s
Overall bit rate mode : Constant
Overall bit rate : 1 511 kb/s
Encoded date : UTC 2019-12-29 08:28:49
Writing application : mkvmerge v41.0.0 ('Smarra') 64-bit
Writing library : libebml v1.3.9 + libmatroska v1.5.2
Encoding Gui : Hybrid 2019.12.28.1
Audio
ID : 1
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
Codec ID : A_DTS
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 6 channels
Channel(s)_Original : 7 channels
ChannelLayout_Original : C L R Ls Rs Cs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 11.2 MiB (100%)
Language : English
Default : Yes
Forced : No
-> Seems like mkvmerge flags the stream as 6 channel audio.
using ffmpeg for muxing:
ffmpeg -y -r 0 -i "E:\Temp\iId_1_aid_0_lang_en_09_28_20_8410_01.dts" -acodec copy -metadata encoding_tool="Hybrid 2019.12.28.1" -r 0 "E:\Output\Sample_7Ch-001_new.mkv"
everything looks fine:
mediainfo.exe e:\Output\Sample_7Ch-001_new.mkv
General
Unique ID : 214078310457880531657066923291995838582 (0xA10DFB9C6A72D9428FC442879C209876)
Complete name : e:\Output\Sample_7Ch-001_new.mkv
Format : Matroska
Format version : Version 4
File size : 11.3 MiB
Duration : 1 min 2 s
Overall bit rate mode : Constant
Overall bit rate : 1 515 kb/s
Writing application : Hybrid 2019.12.28.1
Writing library : Lavf58.35.100
ErrorDetectionType : Per level 1
Audio
ID : 1
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
Codec ID : A_DTS
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 7 channels
Channel layout : C L R Ls Rs Cb LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 11.2 MiB (100%)
Default : Yes
Forced : No
-> so this is probably a bug / missing feature in mkvmerge.
Cu Selur