justdan96 / tsMuxer

tsMuxer is a transport stream muxer for remuxing/muxing elementary streams, EVO/VOB/MPG, MKV/MKA, MP4/MOV, TS, M2TS to TS to M2TS. Supported video codecs H.264/AVC, H.265/HEVC, VC-1, MPEG2. Supported audio codecs AAC, AC3 / E-AC3(DD+), DTS/ DTS-HD.
Apache License 2.0
877 stars 147 forks source link

TrueHD with Atmos track inside MKV is not recognized #447

Closed MastaG closed 2 years ago

MastaG commented 3 years ago

Hi there,

I used makemkv to remux the bluray disc of John Wick 3 (with dolby vision) to mkv. I have chosen to only retain the AC3 5.1 and TrueHD/Atmos tracks. The mediainfo shows like:

mediainfo ../John\ Wick\ 3-\ Parabellum_t00.mkv 
General
Unique ID                                : 198507216450823093206721411531790351333 (0x9557196765944C6A9785693E42D3FBE5)
Complete name                            : ../John Wick 3- Parabellum_t00.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 68.9 GiB
Duration                                 : 2 h 10 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 75.4 Mb/s
Movie name                               : John Wick 3: Parabellum
Encoded date                             : UTC 2021-08-31 18:56:09
Writing application                      : MakeMKV v1.16.4 linux(x64-release)
Writing library                          : libmakemkv v1.16.4 (1.3.10/1.5.2) x86_64-unknown-linux-gnu

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 10 min
Bit rate                                 : 70.8 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 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 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.356
Stream size                              : 64.7 GiB (94%)
Language                                 : English
Default                                  : No
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0010 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 358 cd/m2
Original source medium                   : Blu-ray

Audio #1
ID                                       : 2
ID in the original source medium         : 4352 (0x1100)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Format settings                          : Dolby Surround EX
Codec ID                                 : A_AC3
Duration                                 : 2 h 10 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 599 MiB (1%)
Title                                    : Surround 5.1
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No
Original source medium                   : Blu-ray

Audio #2
ID                                       : 3
ID in the original source medium         : 4352 (0x1100)
Format                                   : MLP FBA 16-ch
Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Codec ID                                 : A_TRUEHD
Duration                                 : 2 h 10 min
Bit rate mode                            : Variable
Bit rate                                 : 4 012 kb/s
Maximum bit rate                         : 6 327 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 3.66 GiB (5%)
Title                                    : Surround 7.1
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

Menu
00:00:00.000                             : en:Chapter 01
00:08:46.776                             : en:Chapter 02
00:14:06.637                             : en:Chapter 03
00:22:40.067                             : en:Chapter 04
00:31:26.301                             : en:Chapter 05
00:37:51.310                             : en:Chapter 06
00:47:43.318                             : en:Chapter 07
00:57:08.842                             : en:Chapter 08
01:02:56.439                             : en:Chapter 09
01:14:27.588                             : en:Chapter 10
01:20:36.623                             : en:Chapter 11
01:28:48.323                             : en:Chapter 12
01:33:51.792                             : en:Chapter 13
01:41:31.794                             : en:Chapter 14
01:53:44.651                             : en:Chapter 15
01:59:51.434                             : en:Chapter 16

However when I try to import this into the tsmuxer gui, it says:

Track 2 was not recognized and ignored. File name: "/home/mastag/John Wick 3- Parabellum_t00.mkv"

Only the video and first AC3 audio track are there. I'd like to remux both audio tracks into a .TS container (AC3 5.1 being the first one).

justdan96 commented 3 years ago

Can you confirm if it does not work if you isolate just one audio track of Dolby TrueHD with Dolby Atmos?

MastaG commented 3 years ago

Hi @justdan96 ,

Yes then it's the same case. git rev: 2aa293b5136321e2d88cd45bd2a8e09499d4a69a

Here's the mediainfo of the mkv with only the TrueHD/Atmos track:

[mastag@AMD3960X ~]$ mediainfo John\ Wick\ 3-\ Parabellum_t00.mkv 
General
Unique ID                                : 242384696003118924218214399919251196513 (0xB659982B363B4F7CD6743600357F0A61)
Complete name                            : John Wick 3- Parabellum_t00.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 68.3 GiB
Duration                                 : 2 h 10 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 74.8 Mb/s
Movie name                               : John Wick 3: Parabellum
Encoded date                             : UTC 2021-09-02 17:05:43
Writing application                      : MakeMKV v1.16.4 linux(x64-release)
Writing library                          : libmakemkv v1.16.4 (1.3.10/1.5.2) x86_64-unknown-linux-gnu

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 10 min
Bit rate                                 : 70.8 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 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 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.356
Stream size                              : 64.7 GiB (95%)
Language                                 : English
Default                                  : No
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0010 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 358 cd/m2
Original source medium                   : Blu-ray

Audio
ID                                       : 2
ID in the original source medium         : 4352 (0x1100)
Format                                   : MLP FBA 16-ch
Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Codec ID                                 : A_TRUEHD
Duration                                 : 2 h 10 min
Bit rate mode                            : Variable
Bit rate                                 : 4 012 kb/s
Maximum bit rate                         : 6 327 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 3.66 GiB (5%)
Title                                    : Surround 7.1
Language                                 : English
Default                                  : Yes
Forced                                   : No
Original source medium                   : Blu-ray
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

Menu
00:00:00.000                             : en:Chapter 01
00:08:46.776                             : en:Chapter 02
00:14:06.637                             : en:Chapter 03
00:22:40.067                             : en:Chapter 04
00:31:26.301                             : en:Chapter 05
00:37:51.310                             : en:Chapter 06
00:47:43.318                             : en:Chapter 07
00:57:08.842                             : en:Chapter 08
01:02:56.439                             : en:Chapter 09
01:14:27.588                             : en:Chapter 10
01:20:36.623                             : en:Chapter 11
01:28:48.323                             : en:Chapter 12
01:33:51.792                             : en:Chapter 13
01:41:31.794                             : en:Chapter 14
01:53:44.651                             : en:Chapter 15
01:59:51.434                             : en:Chapter 16

I just open up makemkv 1.16.4, I open my John Wick disc and select only the main video (which is Dolby Vision) and the TrueHD audio track. Here's the first 50MB of the file: https://mega.nz/file/b4EAlRhZ#eKmTuE5MjfSAzgrUKd8PxRCoPJtISUC1foEg7eoBxRA

When I create a TS file with TSMuxer from the same disc, I only have to select the TrueHD track and there will automatically be a second "core" AC3 5.1 track as well when I try to play it in Plex or Emby.

makemkv somehow rips these two apart from each other as two different pids inside the MKV, perhaps TSMuxer is expecting the trueHD track to have some embedded core AC3 thing as well..

Just thinking out loud.

jcdr428 commented 3 years ago

See #256 and #270 . @justdan96 I will work on muxing / demuxing pure TrueHD when version 2.7 is out.

MastaG commented 3 years ago

Hi @jcdr428 That would be very nice. Then perhaps we could have an option to split the core_ac3 and TrueHD in the GUI to have them muxed as two separate tracks/pids.

dts24436 commented 3 years ago

Seems it's a compatibility issue with the MKV container and a stream of TrueHD within the AC3 core. If such stream is to be imported into somekind of MKV or FFMPEG muxers, they just won't take it as a whole stream but two separate streams (a.k.a. a stream of TrueHD only and another of AC3 core) instead.

What I'd like to see more is, while importing an AC3 stream and a TrueHD-only stream, there's an option to combine these two stream together as one whole AC3 stream, which is supposed to be recognized by TSMuxer (within versions before). @jcdr428 Although I see a methodology in #256 , by adding a null AC3 as core (in lowest bitrate possible as 32kbps), it will be better to have a dedicate AC3 import instead, along with the TrueHD stream into the job.

jcdr428 commented 2 years ago

Fixed by be59064