Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Nov 2022
Posts: 5
|
TrueHDD: A new TrueHD decoder with Atmos support
https://github.com/truehdd/truehdd
This is my recent open-source project. It allows decoding a specified TrueHD presentation. For Dolby Atmos, the decoded audio is provided as a Dolby Atmos Master Format (DAMF) set. This makes it possible to re-encode to DDP Atmos while preserving dynamic objects. I almost forgot that I could post it here. There should be some people interested in trying it, and bug reports are welcome. It also supports skipping the overlapping segments when decoding a direct binary concat of multiple bitstreams that include seamless branching. I would also like to ask if there are any other features needed for working with TrueHD bitstreams. I can check whether they can be implemented. Currently, my to-do list includes:
Last edited by rainbaby; 11th August 2025 at 23:48. |
|
|
|
|
|
#2 | Link | |
|
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 7,369
|
Testing truehdd-0.1.3-x86_64-pc-windows-msvc.zip over a audiosphere.thd (from www.demolandia.net)
We need something in --output-path to obtain some output: Quote:
z.atmos.audio is a .caf file: Code:
General Complete name : C:\tmp\0\z.atmos.audio Format : CAF Format/Info : Core Audio Format Format version : Version 1 File size : 134 MiB Duration : 28 ms Overall bit rate : 40,2 Gb/s FileExtension_Invalid : caf Audio Format : PCM Codec ID : lpcm Duration : 28 ms Bit rate : 18,4 Mb/s Channel(s) : 16 canales Sampling rate : 48,0 kHz Bit depth : 24 bits Stream size : 63,9 KiB (0%) Code:
truehdd decode --output-path z --format pcm aud.thd ... [2025-08-10T07:47:39Z INFO truehdd::cli::decode] Atmos audio detected - forcing CAF format instead of PCM ... Code:
truehdd decode --output-path z --format pcm --presentation 0 aud.thd With --presentation 1 we obtain a 5.1 and with --presentation 2 a 7.1 Like you can know when read my thread Surround 3D I'm interested in a 5.1.2 presentation. Please add it to your todo list to recode TrueHD to m4a (or eac3, even opus) for use 3D surround with AVR's without Atmos support. Now I'll make test comparing your free decoder with the Dolby Reference Player decoder. Thanks for your job! |
|
|
|
|
|
|
#3 | Link |
|
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 7,369
|
truehdd doesn't seem to apply DRC, which restores the original volume, while Dolby Reference Player forces the audio to be normalized to restore the volume. Thank you very much.
After normalizing, the 5.1 and 7.1 DRP decodes compared to truehdd's presentations 1 and 2 are very similar. However, the 16 channels reveal differences in the channel order and some content, as shown in the following figure: |
|
|
|
|
|
#4 | Link | |
|
Registered User
Join Date: Nov 2022
Posts: 5
|
Quote:
Last edited by rainbaby; 10th August 2025 at 14:38. |
|
|
|
|
|
|
#5 | Link | ||
|
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 7,369
|
Quote:
Quote:
In your to-do list I see a 7.1.2 output, please better a 5.1.2 to be compatible with many more players/codecs. Thanks. |
||
|
|
|
|
|
#6 | Link | |
|
Registered User
Join Date: Nov 2022
Posts: 5
|
Quote:
I’m not planning to implement a renderer, that’s currently out of scope and I think Cavern has already done an excellent job in that area. It’s now preparing to integrate truehdd. |
|
|
|
|
|
|
#9 | Link |
|
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 7,369
|
Thanks for the installer!
Last updated: 17th August 2025. Now support TrueHD decode, BTW there are also a portable version here Thats change my thread about Surround 3D EDIT: It create temporary files: Code:
18/08/2025 14:19 519 _extracted.thd.atmos 18/08/2025 14:32 14.198.937.188 _extracted.thd.atmos.audio (CAF file) 18/08/2025 14:32 5.081.694 _extracted.thd.atmos.metadata Last edited by tebasuna51; 18th August 2025 at 23:25. |
|
|
|
|
|
#10 | Link |
|
Registered User
Join Date: Apr 2006
Posts: 185
|
Since you built the software from scratch, can you tell me what the internal format of TrueHD with Atmos? I understand that you get a 7.1 downmix that includes all sounds. If we drop Atmos, all the content is still there. Is the rest of the stream a difference from this to enable lifting of individual channels out of the downmix? How do they manage to make the encoding relatively small? Could channels in the Atmos layer theoretically be listened to?
|
|
|
|
|
|
#11 | Link | |
|
Registered User
Join Date: Nov 2022
Posts: 5
|
Quote:
A common structure is: 2.0 <- 5.1 <- 7.1 <- Atmos (up to 16 elements), where each earlier stage is a downmix of the next. Since downmixing and upmixing can be described using matrices, matrix processing is part of TrueHD’s codec, the information can be split across multiple substreams while still allowing decoding at different levels in the hierarchy. In the example above, four substreams might contain 2, 4, 2, and 8 channels of data respectively, each also carrying the matrix coefficients needed to reconstruct its corresponding presentation. If you only need 2.0, you decode just the first substream. For 7.1, you decode the first three. The fourth substream, which carries Atmos information, follows the same principle but, as a TrueHD extension, it redefines how the matrices are stored. Instead of a static matrix (as is common up to 7.1), it uses interpolation to represent a dynamic matrix. As a result, the channels in the fourth substream are not directly listenable on their own. They must be combined with the data from the first three substreams using matrix operations to produce up to 16 channels. Most of these channels, except usually one LFE channel, are dynamic audio objects whose positions and other properties are defined in separate metadata. It is important to note that TrueHD also allows independent presentations. In the earlier example, if an independent 5.1 presentation is added, the structure becomes 2.0 <- 5.1; 7.1 <- Atmos. In this case, the second substream would independently contain all the audio data required to decode the 5.1 presentation. If you instead add an independent 7.1 presentation, then the Atmos presentation also becomes independent. In these cases the efficiency will drop significantly. Last edited by rainbaby; 20th August 2025 at 06:11. |
|
|
|
|
|
|
#12 | Link |
|
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 3,075
|
Can someone much more expert than me tell what is the correct path to convert THD+ATMOS to DDP+ATMOS?
Before, I used Dolby Player to export ATMOS to discrete channel configuration and then encoded them with dee (usually 9.1.6 or 5.1.2). Now that TrueHDD is out, would be better to use it to have dynamic objects? What is the correct path not to have channel misplacement?
__________________
@turment on Telegram |
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Feb 2024
Posts: 41
|
TrueHDD + DEE + Deezy seems to work for me. Without an Atmos speaker setup I can't test it. However, Cavern does show objects moving through a 9.1.6 virtual space.
It may be possible without Deezy, but I don't know the correct DEE syntax.
__________________
More reasons to collect physical media. Ugoos AM6B+ CE p3i PM4K. Last edited by Gatorman3385; 7th October 2025 at 11:54. |
|
|
|
|
|
#15 | Link |
|
Registered User
Join Date: Jan 2025
Posts: 225
|
__________________
Main Systems:- 9970X on Gigabyte TRX50 AERO D 7970X on Asus Pro WS TRX50-Sage WiFi 9950X3D on MSI Carbon X670E 7950X on Gigabyte Aorus Elite B650 i9-13900KF on MSI Tomahawk B660 |
|
|
|
|
|
#18 | Link | |
|
Registered User
Join Date: Sep 2006
Posts: 118
|
Quote:
Does it go back to the matrix decoding you mentioned in your other post, applied to some substream(s)? Edit: Having seen more info from the fantastic TrueHDD, asked another way, if I have a Dolby Atmos .thd file with the following presentations: Code:
TrueHD Stream Information
=========================
Stream Information
Format Sync F8726FBA
Sampling rate 48000 Hz
Variable rate true
Peak data rate 9849 kbps
Number of substreams 4
Dolby Atmos true
Presentation Information
Presentation 0
Number of channels 2
Presentation type Downmix of presentation 1
Channel format Stereo
DRC on by default true
Dialogue Level -37 dBFS
Mix Level 99 dB
Presentation 1
Number of channels 6
Presentation type Downmix of presentation 2
Dolby Surround EX Not indicated
Channel assignment L, R, C, LFE, Ls, Rs
DRC on by default false
Dialogue Level -31 dBFS
Mix Level 105 dB
Presentation 2
Number of channels 8
Presentation type Downmix of presentation 3
Channel assignment L, R, C, LFE, Ls, Rs, Lb, Rb
DRC on by default false
Dialogue Level -31 dBFS
Mix Level 105 dB
Presentation 3
Number of elements 16
Presentation type Independent
Bed configuration LFE
Dialogue Level -31 dBFS
Mix Level 105 dB
When I convert that same thd file to w64 in ffmpeg, it seems to automatically default to Presentation 2, as I get 8 channels. And then I've used a pan filter like so, to downmix to stereo to my liking: Code:
-af pan="stereo| FL = FL + 0.707*FC + 0.5*LFE + 0.707*SL + 0.707*BL | FR = FR + 0.707*FC + 0.5*LFE + 0.707*SR + 0.707*BR" I'd ultimately like to understand what's happening in ffmpeg vs TrueHDD CLI vs Cavern, and then would especially like to be able to exert more control over how the elements are downmixed. For example, I'd like to be able to raise vocals in a mix (when captured in a center channel or object) or include the LFE in a mix (when Dolby traditionally indicates the LFE channel is meant to be dropped altogether when downmixing to stereo). Maybe that says I should be using TrueHDD to decode Presentation 1 or 2, and then applying a pan filter to my liking with ffmpeg? Or maybe I should be testing using TrueHDD to decode Presentation 0, because the dynamic matrices used in the downmix will now be applied correctly in a way that ffmpeg doesn't allow (since it decodes Presentation 2)? Thank you for the wonderful work. I appreciate any insights you can offer. Last edited by UsedUser; 14th October 2025 at 06:59. Reason: Update after running truehdd |
|
|
|
|
|
|
#19 | Link |
|
Registered User
Join Date: Dec 2010
Posts: 41
|
So, in a few words, if I figure it out how to set up all of the above mentioned software will I be able to convert Dolby TrueHD 7.1 + Atmos to Dolby Digital Plus 7.1 + Atmos and also to remove DialNorm from the "factory" Dolby Digital Plus Atmos?
Last edited by Fuso; 9th December 2025 at 01:20. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|