[Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

The place to discuss linux version of MakeMKV
Post Reply
seperis
Posts: 5
Joined: Fri Jun 12, 2020 2:17 am

[Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by seperis »

MakeMKV: 1.17.1
OS: Linux Mint Cinnamon and Solus Budgie
Drives: HL-DT-ST_BE-RE__WH16NS60, HL-DT-ST_BE-RE__WH16NS40
Plex Server: Version 1.28.2.6151 on NVIDIA Shield Pro and Solus Budgie
Played on: NVIDIA Shield Plex Media Player, Firefox Plex Browser Media Player, Windows Plex Media Player, and VLC

I lost a drive two weeks ago so had to rerip roughly 40 4K movies over a few days all in MakeMKV 1.17.1. I added them back into Plex, and there is no audio for any of them in when using the TrueHD 7.1 audio stream in any Plex Media Player. There is audio if I play them straight from VLC. All of these movies were playing that stream fine when I had them ripped before; I bought them between 2019 and Saturday (the two newest movies excluded since this is their first rip).

All rips pull all English audio streams and subtitles. Copies in multiple resolutions with equivalent open source codecs (AAC) for each audio stream are created in Handbrake as needed using H.264 video for 2160p as needed (I use the bluray version if it comes with one for the 1080p, 720p, and sometimes 480p resolutions) so I can play them pretty much everywhere. All custom presets are roughly two years old; I'm a software tester, so when I got serious about my media library, I did formal testing with documentation for H.264, H.265, V9, and V8 and each audio codec, and I documented myself to make sure everything worked.

I thought it was a Plex issue at first then checked the movies in mediainfo and noticed something weird going on with the channels and title. I started checking backward through my other drives with 4K movies. So far, all the movies ripped in 1.16.7 and 1.17.1 are having this same problem. 1.16.5 and anything before does not (so far): verified with Dune (2021), Jupiter Ascending, Annihilation, The Accountant, and some others at random. The discrepancy in metadata on 4K movies with TrueHD Audio also starts with 1.16.7. (Honestly, I might not have realized what was going on nearly this fast, much less the pattern--if I hadn't had to do rerip so many 4K movies in a week and was doing a fast check in Plex Media Player on my laptop instead of my TV; my Sonos setup can't do 7.1 Atmos, so I usually play in 5.1 by default.)

Mediainfo xlm for the TrueHD audio stream for 4K movies from 1.17.1, 1.16.7, and 1.16.5. See bolded sections.

Ripped in 1.17.1, Iron Man:
<track type="Audio" typeorder="1">
<StreamOrder>1</StreamOrder>
<ID>2</ID>
<OriginalSourceMedium_ID>4352</OriginalSourceMedium_ID>
<UniqueID>2</UniqueID>
<Format>MLP FBA</Format>
<Format_Commercial_IfAny>Dolby TrueHD with Dolby Atmos</Format_Commercial_IfAny>
<Format_AdditionalFeatures>16-ch</Format_AdditionalFeatures>
<CodecID>A_TRUEHD</CodecID>
<Duration>8861.979166666</Duration>
<BitRate_Mode>VBR</BitRate_Mode>
<BitRate>4620021</BitRate>
<BitRate_Maximum>7659000</BitRate_Maximum>
<Channels>1</Channels>
<Channels_Original>8</Channels_Original>
<ChannelPositions_Original>Front: L C R, Side: L R, Back: L R, LFE</ChannelPositions_Original>
<ChannelLayout_Original>L R C LFE Ls Rs Lb Rb</ChannelLayout_Original>

<SamplesPerFrame>40</SamplesPerFrame>
<SamplingRate>48000</SamplingRate>
<SamplingCount>425375000</SamplingCount>
<FrameRate>1200.000</FrameRate>
<FrameCount>10634375</FrameCount>
<BitDepth>24</BitDepth>
<Compression_Mode>Lossless</Compression_Mode>
<Delay>0.000</Delay>
<Delay_Source>Container</Delay_Source>
<StreamSize>5117816382</StreamSize>
<StreamSize_Proportion>0.09706</StreamSize_Proportion>
<Title>Surround</Title>
<Language>en</Language>
<Default>Yes</Default>
<Forced>No</Forced>
<extra>
<OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
<NumberOfDynamicObjects>13</NumberOfDynamicObjects>
<BedChannelCount>1</BedChannelCount>
<BedChannelConfiguration>LFE</BedChannelConfiguration>
</extra>
</track>

Ripped in 1.16.7, Apocalypse Now (Final Cut)
<track type="Audio" typeorder="1">
<StreamOrder>1</StreamOrder>
<ID>2</ID>
<OriginalSourceMedium_ID>4352</OriginalSourceMedium_ID>
<UniqueID>2</UniqueID>
<Format>MLP FBA</Format>
<Format_Commercial_IfAny>Dolby TrueHD with Dolby Atmos</Format_Commercial_IfAny>
<Format_AdditionalFeatures>16-ch</Format_AdditionalFeatures>
<CodecID>A_TRUEHD</CodecID>
<Duration>10918.908333333</Duration>
<BitRate_Mode>VBR</BitRate_Mode>
<BitRate>5882487</BitRate>
<BitRate_Maximum>10209000</BitRate_Maximum>
<Channels>1</Channels>
<Channels_Original>8</Channels_Original>
<ChannelPositions_Original>Front: L C R, Side: L R, Back: L R, LFE</ChannelPositions_Original>
<ChannelLayout_Original>L R C LFE Ls Rs Lb Rb</ChannelLayout_Original>

<SamplesPerFrame>40</SamplesPerFrame>
<SamplingRate>48000</SamplingRate>
<SamplingCount>524107600</SamplingCount>
<FrameRate>1200.000</FrameRate>
<FrameCount>13102690</FrameCount>
<BitDepth>24</BitDepth>
<Compression_Mode>Lossless</Compression_Mode>
<Delay>0.000</Delay>
<Delay_Source>Container</Delay_Source>
<StreamSize>8028792082</StreamSize>
<StreamSize_Proportion>0.09210</StreamSize_Proportion>
<Title>Surround</Title>
<Language>en</Language>
<Default>Yes</Default>
<Forced>No</Forced>
<extra>
<OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
<NumberOfDynamicObjects>11</NumberOfDynamicObjects>
<BedChannelCount>1</BedChannelCount>
<BedChannelConfiguration>LFE</BedChannelConfiguration>
</extra>
</track>

Ripped in 1.16.5, Dune:
<track type="Audio" typeorder="1">
<StreamOrder>1</StreamOrder>
<ID>2</ID>
<OriginalSourceMedium_ID>4352</OriginalSourceMedium_ID>
<UniqueID>2</UniqueID>
<Format>MLP FBA</Format>
<Format_Commercial_IfAny>Dolby TrueHD with Dolby Atmos</Format_Commercial_IfAny>
<Format_AdditionalFeatures>16-ch</Format_AdditionalFeatures>
<CodecID>A_TRUEHD</CodecID>
<Duration>9326.609166666</Duration>
<BitRate_Mode>VBR</BitRate_Mode>
<BitRate>3242671</BitRate>
<BitRate_Maximum>5472000</BitRate_Maximum>
<Channels>8</Channels>
<ChannelPositions>Front: L C R, Side: L R, Back: L R, LFE</ChannelPositions>
<ChannelLayout>L R C LFE Ls Rs Lb Rb</ChannelLayout>

<SamplesPerFrame>40</SamplesPerFrame>
<SamplingRate>48000</SamplingRate>
<SamplingCount>447677240</SamplingCount>
<FrameRate>1200.000</FrameRate>
<FrameCount>11191931</FrameCount>
<BitDepth>24</BitDepth>
<Compression_Mode>Lossless</Compression_Mode>
<Delay>0.000</Delay>
<Delay_Source>Container</Delay_Source>
<StreamSize>3780391034</StreamSize>
<StreamSize_Proportion>0.05002</StreamSize_Proportion>
<Title>Surround 7.1</Title>
<Language>en</Language>
<Default>Yes</Default>
<Forced>No</Forced>
<extra>
<OriginalSourceMedium>Blu-ray</OriginalSourceMedium>
<NumberOfDynamicObjects>11</NumberOfDynamicObjects>
<BedChannelCount>1</BedChannelCount>
<BedChannelConfiguration>LFE</BedChannelConfiguration>
</extra>
</track>

There may be other discrepancies, but these are the ones that jumped out at me.

In MakeMKV's GUI, when I highlight the TrueHD audio track on a 4K playlist before ripping, the following appears in the info box:

Track information
Type: Audio
Name: Surround (English)
Language: English
Codec: TrueHD Atmos
Channels: 0
Channel layout: 0 channels
Sample rate: 48000
Bits per sample: 24
MKV Flags: Default

Same movie but with the DD 5.1 Surround highlighted:

Track information
Type: Audio
Flags: Core audio
Name: Surround 5.1 (English)
Language: English
Codec: Dolby Digital
Channels: 6
Channel layout: 5.1(side)
Sample rate: 48000
  1. This issue is right now only occurring with TrueHD 7.1 audio streams that I've found; after checking all other audio streams in both the original rip and the Handbrake re-encodes, all other Dolby, all AAC and all DTS codecs seem unaffected.
  2. This problem occurs both when subtitles are on and off, and with psg or srt.
  3. Verified in Plex stats it is NOT transcoding but direct playing and Plex logs didn't show anything hinky going on.
  4. I haven't checked MakeMKV on Window 10 yet, as I don't rip on my laptop just on my servers.
I'm still sampling as I have time, but it looks it might be how MakeMKV is handling metadata and Plex is reading it but that's pretty much a guess from the metadata. I have no idea what to do about it short of finding a metadata editor and editing the metadata, but I'm not sure if this is the only problem (also I've never direct edited metadata and I suspect it is not a simple process). I'm going to run a batch using mediainfo through all my drives to get all metadata for all the movies, spreadsheet the results, and see how many are affected (from my amazon history, this may be a problem with a third of my library aka over a hundred movies), but I wanted to check and see if a.) anyone else has seen this (I checked the forums but I might have missed something) and b.) if maybe I'm missing something obvious and stupid. Please tell me I'm missing something obvious and very, very stupid; I really desperately do not want to re-rip and re-encode over a hundred movies.

Update:
  1. The problem is not showing in Windows 10. This is Linux-only problem.
  2. I ran a batch job with mediainfo on all my media and spreadsheeted the results; the only affected movies were ripped by MakeMKV 1.17.1 and 1.16.7, but four movies in 1.16.7 were fine; all problem media was ripped on or after 6/10/2022 on Mint Linux, which is when according to my amazon shopping history, I got Apocalypse Now. The last unaffected rips were the Matrix boxed set, which I got on 6/1/2022 and ripped the same day I got it.
  3. I did not recompile and reinstall MakeMKV between The Matrix and Apocalypse Now.
  4. I scrubbed and reinstalled my OS on my Mint machine mid-August, but the rip problem was occurring before and after that according to my shopping history.
  5. I have to assume it was a package update in Linux.
  6. I'm not even sure how to start researching this other than start with packages that affect metadata.
  7. The glibc problem is affecting my Solus machine but not my Linux Mint (it hasn't updated to the new version yet), so I'm assuming the they're not related, but considering expat is what parses the XML and it requires glibc, it actually might be from an earlier glibc update this summer.
  8. I am really absolutely refusing to think about reripping all those movies. Fortunately this is only affecting about fifty movies but that's still fifty movies.
Update 2 (10/5/2022):
  1. This problem also shows on 1080p blurays with TrueHD 7.1 and at least some TrueHD 5.1 in MakeMKV 1.17.1, 1.16.7, and 1.16.5. I didn't have a very large sample size with these to work with as a lot of 1080 blurays that come packaged with the 4K version use DTS.
  2. I am just not familiar enough with the meaning of all the metadata tags to be sure there isn't more missing so if anyone finds more, feel free to tell me.
Workaround/Solution:

Tested in Linux Mint (Cinnamon) and Solus (Budgie):

Direct Metadata Editing
  1. Download Mediainfo and MKVToolNix GUI
  2. In Mediainfo, select a file, open view in XML and verify all your audio streams have the right channels; in general, you're going to only be checking Audio Stream 1. For TrueHD the value of the Channels_Original field will be 8; for TrueHD 5.1, it'll be 6.
  3. In MKVToolNix, click on Header Editor and open the movie file.
  4. Expand each audio track with the codec A_TRUEHD
  5. Edit field Name from Surround to Surround 7.1 or Surround 5.1 depending on what you got from MediaInfo.
  6. Edit field Channels to 8 or 5. This will also automatically correct the Channel Position/Layout metdata fields which aren't available for direct editing on MKVToolNix.
  7. Save and reload, verify all is well.
  8. Repeat.
Re-encode in Handbrake (2160p for 4K or 1080p for bluray)
Handbrake's encoding will embed the correct metadata if you do audio passthru for the audio stream, If there's anything else missing I didn't catch that may cause problems and you want to be sure, this will do the trick.

But as of now, I recommend a metadata encode as it's much, much faster (by many orders of magnitude) and easier and seems to be working or at least, my headphones and Sonos speaker say so.
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by mike admin »

seperis wrote:
Tue Sep 20, 2022 8:23 pm
In MakeMKV's GUI, when I highlight the TrueHD audio track on a 4K playlist before ripping, the following appears in the info box:

Track information
Type: Audio
Name: Surround (English)
Language: English
Codec: TrueHD Atmos
Channels: 0
Channel layout: 0 channels
Sample rate: 48000
Bits per sample: 24
MKV Flags: Default
This is a culprit. Likely this has nothing to do with MakeMKV version as well. The issue is in ffmpeg and/or MakeMKV oss code. On windows and mac ffmpeg library comes pre-compiled with MakeMKV, on linux you are linking to your existing libavcodec (part of ffmpeg). For some reason it returns incorrect metadata (0 channels). The "real" bug is that MakeMKV should sanity-check the return value and print some error.

As for why your ffmpeg returns 0 channels for TrueHD audio - please try compiling with latest ffmpeg. If you have a stable repro (i.e. GUI shows zero channels), please send me all details about ffmpeg library versions.
seperis
Posts: 5
Joined: Fri Jun 12, 2020 2:17 am

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by seperis »

This is a culprit. Likely this has nothing to do with MakeMKV version as well. The issue is in ffmpeg and/or MakeMKV oss code. On windows and mac ffmpeg library comes pre-compiled with MakeMKV, on linux you are linking to your existing libavcodec (part of ffmpeg). For some reason it returns incorrect metadata (0 channels). The "real" bug is that MakeMKV should sanity-check the return value and print some error.

As for why your ffmpeg returns 0 channels for TrueHD audio - please try compiling with latest ffmpeg. If you have a stable repro (i.e. GUI shows zero channels), please send me all details about ffmpeg library versions.
I always download a new copy of ffmpeg from the website and compile from source per the extended instruction (Optional: building with latest libavcodec).

I'm updating to the latest version of MakeMKV as soon as I have time this week (probably Tuesday) on my Mint Linux system. I have at least one new 4K movie coming by then, so I'll document everything fresh and update you with the results.
-SilentAssassin-
Posts: 4
Joined: Wed Feb 10, 2021 2:30 pm

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by -SilentAssassin- »

Just ran into this issue myself. I'm on Arch Linux with the latest version of the official ffmpeg package (5.1.2) and have the latest version of MakeMKV (1.17.2). When I open the 4K WALL-E Criterion disc in MakeMKV, it shows 0 channels for the TrueHD Atmos track, and the resulting MKV shows 1 channel and 8 original channels in mediainfo.

Edit: Happens with the standard BD in the Criterion release as well.
scarbrtj
Posts: 63
Joined: Fri Apr 20, 2018 11:21 pm

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by scarbrtj »

mike admin wrote:
Fri Oct 14, 2022 10:10 am
seperis wrote:
Tue Sep 20, 2022 8:23 pm
In MakeMKV's GUI, when I highlight the TrueHD audio track on a 4K playlist before ripping, the following appears in the info box:

Track information
Type: Audio
Name: Surround (English)
Language: English
Codec: TrueHD Atmos
Channels: 0
Channel layout: 0 channels
Sample rate: 48000
Bits per sample: 24
MKV Flags: Default
This is a culprit. Likely this has nothing to do with MakeMKV version as well. The issue is in ffmpeg and/or MakeMKV oss code. On windows and mac ffmpeg library comes pre-compiled with MakeMKV, on linux you are linking to your existing libavcodec (part of ffmpeg). For some reason it returns incorrect metadata (0 channels). The "real" bug is that MakeMKV should sanity-check the return value and print some error.

As for why your ffmpeg returns 0 channels for TrueHD audio - please try compiling with latest ffmpeg. If you have a stable repro (i.e. GUI shows zero channels), please send me all details about ffmpeg library versions.
Any more ideas about this Mike? I posted same qu in another post (viewtopic.php?f=3&t=29830). In brief, if I upgrade to 1.17.2, TrueHD doesn't rip right or at all. If I downgrade to 1.17.1, all is well. FFMpeg 4.3.1.
mediacable
Posts: 8
Joined: Sun Dec 25, 2022 9:53 pm

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by mediacable »

I can confirm this is still broken on Linux on 1.17.3 using the latest stable FFMPEG 5.1.2. Downgrading ffmpeg from the last few stable versions does not help, but going back down two MakemKV versions to 1.17.1 resolves the problem, but I have to run it in Flatpak since 1.17.1 is broken with the new glibc.

The linux version has been in a sorry state for a while now with this audio issue and the broken glibc from last year - I purchased a license for MakeMKV but wouldn't mind supporting MakeMKV patreon-style etc. if bugs like this could be squashed sooner.
scarbrtj
Posts: 63
Joined: Fri Apr 20, 2018 11:21 pm

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by scarbrtj »

glad someone else could confirm that the only working version of MakeMKV for Linux right now is 1.17.1
scarbrtj
Posts: 63
Joined: Fri Apr 20, 2018 11:21 pm

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by scarbrtj »

Sorry to double post but are people still have zero audio channel TrueHD 7.1 bug in MakeMKV 1.17.5? I still have to run 1.17.1 to get TrueHD to rip correctly.
blind-s33r
Posts: 6
Joined: Thu Jul 25, 2019 1:29 am

Re: [Updated & Workaround] TrueHD 7.1 Not Playing in Plex From 4K Rips

Post by blind-s33r »

I just installed 1.17.5 on kubuntu 23.10 and it seems like it was fixed? I haven't actually ripped it yet but its showing up now with proper channels instead of zero.
I did have to rip a git master copy of ffmpeg instead of using the 6.0 release tarball because it wouldn't compile so it might be due to having the most up to date version of ffmpeg...

Code: Select all

https://imgur.com/a/2eg9uqP
Edit: just finished ripping and it worked on my end.
Post Reply