View Full Version : Looking for a eac3 7.1 encoder


sfatula
10th January 2020, 19:21
I don't think eac3to does this, libav doesn't seem to support it, ffmpeg does not, etc. However, I have discovered that Plex does use ffmpeg via a special external library they seem to create on the fly to transocde to eac3. I can't find eac3_eae reference anywhere but Plex, and of course no source code. I wonder where they got it?

Anyone know of a library anywhere I could use to encode to eac3 7.1?

eca2424
2nd April 2020, 21:25
Any news?

tebasuna51
2nd April 2020, 23:26
7.1 for what? Maybe Atmos...

hajj_3
3rd April 2020, 11:19
Anyone know when patents for E-AC3 aka Dolby Digital Plus expire? I can't find anything on google, just info about regular dolby ac3. Also, I can't even find a date for when E-AC3 was even released so i can't even add 20yrs to that for a rough estimate.

amichaelt
3rd April 2020, 15:09
Anyone know when patents for E-AC3 aka Dolby Digital Plus expire? I can't find anything on google, just info about regular dolby ac3. Also, I can't even find a date for when E-AC3 was even released so i can't even add 20yrs to that for a rough estimate.

If it helps, the A/52B revision of the ATSC standard that contained the eac-3 specification was published in June of 2005.

eca2424
5th April 2020, 20:36
These guys encoding 7.1 eac3. How?

[DELETED by rule 6]

Sparktank
6th April 2020, 00:18
These guys encoding 7.1 eac3. How?

Rule 6 violation. We don't discuss pirated stuff here.

l00t
6th April 2020, 08:05
The only way to do it, is to use Dolby's Media Producer Suite. It costs about $3000 grand and available for Windows and OSX.

https://www.dolby.com/us/en/professional/content-creation/products/dolby-media-producer-suite.html

hajj_3
18th April 2020, 10:46
I think this might be the list of patents for Dolby E-AC3/Dolby Digital Plus: TS 102 366 https://www.docdroid.net/xEqhKmr/initdecl-pdf

The last U.S patent seems to be US6246345 (https://patents.google.com/patent/US6246345B1/) which seems to have expired on 2019-07-08.

filler56789
18th April 2020, 13:08
The only way to do it, is to use Dolby's Media Producer Suite. It costs about $3000 grand and available for Windows and OSX.

https://www.dolby.com/us/en/professional/content-creation/products/dolby-media-producer-suite.html

Not the only way, apparently...

The MainConcept Dolby Digital Plus Pro SDK components support both Dolby Digital (AC-3) as well as Dolby Digital Plus (EAC-3) audio for encoding and decoding.

Encoding and decoding for different channel layouts ranging from mono, stereo, 5.1 up to 7.1 for the perfect Dolby audio experience.

https://www.mainconcept.com/eu/products/for-developers/audio/dolby-digital-plus.html

SeeMoreDigital
18th April 2020, 15:34
And here's a link to the 'MainConcept Dolby Digital Plus Pro SDK Data Sheet' Data sheet: https://www.mainconcept.com/fileadmin/user_upload/datasheets/DDPlusPro_SDK_DATASHEET.pdf

neil wilkes
24th April 2020, 15:36
The only way to do it, is to use Dolby's Media Producer Suite. It costs about $3000 grand and available for Windows and OSX.

https://www.dolby.com/us/en/professional/content-creation/products/dolby-media-producer-suite.html

Sorry to correct you, but this is Mac only.
Just like the new DTS-X encoder.
From the quoted Dolby web page:
Dolby Media Producer Suite v.2 Hardware Requirements
Mac® Pro 5,1 or later (6,1 preferred)
Intel Xeon, Intel Core i7 or Intel Core i5 with full support of the SSE4.2 instruction set (Nehalem/Westemere and later microarchitectures)
Mac OS X® version 10.10, 10.11 or 10.12
8 GB RAM (16 GB recommended for Dolby TrueHD encoding jobs with Dolby Atmos)
PACE iLok USB smart key
For more information about iLok USB smart keys, please visit www.iLok.com.

This of course is nothing less than bloody perverse given there are NO full spec mac OS Blu-ray authoring tools in existence that can be used to create factory replicas, and far too many consoles in common use will not play or even load BD-R.
All you have these days is Scenarist BD, and that is strictly Windows 64-bit only. Sony bought up NetBlender, and promptly killed it off and it appears that their Blu-Print has gone the same way. Scenarist is the best (indeed the only) player in town still actively developing and supporting their software.

Question - why on earth would you want to even bother with 7.1 AC3? Much better to use DTS-HD Master Audio.

SeeMoreDigital
24th April 2020, 16:27
Question - why on earth would you want to even bother with 7.1 AC3? Much better to use DTS-HD Master Audio.What's so bad about having a lossy audio format that's able to support 7.1 channels (not to mention Atmos)?

By-the-way.... MainConcept's Dolby Digital Plus Pro encoder runs with Windows, Mac and Linux ;)

SquallMX
26th April 2020, 22:18
Adobe Audition 2018 and below includes support for EAC3 encoding up to 7.1 1024 Kbps, but is not Blu-ray compatible.

SeeMoreDigital
6th May 2020, 11:05
As most of us have quite a bit of time on our hands at the moment, a couple of days ago I decided to find out what a 5.1 Dolby Digital Plus audio encode of Blade Runner 2049 would sound like.

Audio source: 7.1 [8-channel] Dolby TrueHD with Atmos stream
Encoding software: UsEac3To 'A/V Recode' option using ffmpeg manually set to 'E1536' (Kbps)
Muxer: MKVToolNixGUI
Playback device: OPPO UDP-203

My audio surround system is essentially for listening to music (I don't have an Atmos). All my speakers offer full frequency range, so they're all able to produce bass!

Anyway... I can confirm that the 5.1 Dolby Digital Plus encodes sounds extremely good, there's plenty of bass and dynamic range. Indeed, there's very little difference between the 7.1 TrueHD source.

Now I'm wondering what a 7.1 Dolby Digital Plus encode from the same source would sound like!

NiN3
22nd September 2020, 15:02
Adobe Audition 2018 and below includes support for EAC3 encoding up to 7.1 1024 Kbps, but is not Blu-ray compatible.

What's the difference between Bluray compatible or not? Both have legacy 5.1 stream inside as far as I am concerned.

nevcairiel
22nd September 2020, 15:34
What's the difference between Bluray compatible or not? Both have legacy 5.1 stream inside as far as I am concerned.

Blu-ray EAC3 7.1 is literally 5.1 AC3 + 4 channel EAC3 which replaces the side channel and adds rear channel.

Streaming EAC3 7.1 from eg. Netflix is pure 7.1 EAC3, no weird composition, no AC3 legacy stream on the inside.

NiN3
22nd September 2020, 15:59
Blu-ray EAC3 7.1 is literally 5.1 AC3 + 4 channel EAC3 which replaces the side channel and adds rear channel.

Streaming EAC3 7.1 from eg. Netflix is pure 7.1 EAC3, no weird composition, no AC3 legacy stream on the inside.

I see, thanks.

What happens when you play a EAC3 track on a system that only supports AC3? According to wikipedia and some explanations on Dolby's website, EAC3 is backwards compatible so it supposedly converts it bit perfectly to AC3.

SeeMoreDigital
22nd September 2020, 21:53
I see, thanks.

What happens when you play a EAC3 track on a system that only supports AC3?Well... If the EAC3 audio stream contains an AC3 core, the playback device should, in theory, be able to play the AC3 core...

NiN3
22nd September 2020, 22:15
Well... If the EAC3 audio stream contains an AC3 core, the playback device should, in theory, be able to play the AC3 core...

nevcairiel said the EAC3 track does not include a AC3 core inside it unless you use the Blu-ray Disc profile, in which case it's mandatory.

nevcairiel
22nd September 2020, 22:30
If a player cannot handle EAC3, it wont be able to play a pure EAC3 stream. That lossless conversion to AC3 is just theoretical marketing fluff. EAC3 supports higher bitrates then AC3, how could you make that a lossless conversion.
Or they simply refer to the Blu-ray profile, pushing all the features in marketing at the same time, eventhough you can't actually combine everything.

SeeMoreDigital
22nd September 2020, 22:38
nevcairiel said the EAC3 track does not include a AC3 core inside it unless you use the Blu-ray Disc profile, in which case it's mandatory.This is true...

An AC3 core is mandatory for the Blu-ray specification. But back in the day, it wasn't mandatory for the DVD HD specification.

Dolby had to fiddle about with EAC3 again when DVB-T2, DVB-S2 and DVB-C2 decoder support was added to European TV's...

NiN3
22nd September 2020, 22:58
If a player cannot handle EAC3, it wont be able to play a pure EAC3 stream. That lossless conversion to AC3 is just theoretical marketing fluff. EAC3 supports higher bitrates then AC3, how could you make that a lossless conversion.
Or they simply refer to the Blu-ray profile, pushing all the features in marketing at the same time, eventhough you can't actually combine everything.

I didn't literally mean a lossless conversion but more like if you have a 640k AC3 track and a 1024k EAC3 track that gets converted down to AC3 because your receiver doesn't support EAC3, would those both end results sound identical or would the native AC3 track sound slightly better because the other one had to be converted from a "lossy" source. If that makes any sense.

This is what it says on wikipedia: "Dolby Digital Plus bitstreams are not directly backward compatible with legacy Dolby Digital decoders. However, Dolby Digital Plus is a functional superset of Dolby Digital, and decoders include a mandatory component that directly converts (without decoding and re-encoding) the Dolby Digital Plus bitstream to a Dolby Digital bitstream (operating at 640 kbit/s) for carriage via legacy S/PDIF connections (including S/PDIF over HDMI) to external decoders (e.g. AVRs, etc.). All Dolby Digital Plus decoders can decode Dolby Digital bitstreams."

This paper actually has a very interesting explanation for the EAC3 to AC3 transcoding process starting from page 22: https://professional.dolby.com/globalassets/dolby-digital-plus/aes-convention-paper-intro-to-dolby-digital-plus.pdf

NiN3
26th September 2020, 18:44
This is true...

An AC3 core is mandatory for the Blu-ray specification. But back in the day, it wasn't mandatory for the DVD HD specification.

Dolby had to fiddle about with EAC3 again when DVB-T2, DVB-S2 and DVB-C2 decoder support was added to European TV's...

Any idea when this new standard came to be?

SeeMoreDigital
27th September 2020, 11:38
Any idea when this new standard came to be?
Like all standards, the Dolby Digital (AC-3 and E-AC-3) standard has been revised over the years.

The (25 January) 2018 ATSC standards can be downloaded here: https://www.atsc.org/wp-content/uploads/2015/03/A52-2018-1.pdf. Which includes a revisions page...

NiN3
30th September 2020, 18:57
If a player cannot handle EAC3, it wont be able to play a pure EAC3 stream. That lossless conversion to AC3 is just theoretical marketing fluff. EAC3 supports higher bitrates then AC3, how could you make that a lossless conversion.
Or they simply refer to the Blu-ray profile, pushing all the features in marketing at the same time, eventhough you can't actually combine everything.

I don't want to bother you with too many questions but you seem very knowledgeable and it's always nice to learn from experts.

What's your opinion on efficiency between AC3, EAC3 and DTS if encoded at 640, 1024, and 1509 respectively. Is there any point in having EAC3 at all or is the improvement compared to AC3 minimal at best. Common consensus seems to be that AC3 and DTS are usually transparent to each other even with the large difference in file size, would EAC3 at 1024 compete better against DTS at 1509?

tebasuna51
30th September 2020, 20:46
A old multichannel test (https:\\tech.ebu.ch\docs\tech\tech3324.pdf) show EAC3 (DD+) 448 Kb/s near DTS 1500 Kb/s.

filler56789
30th September 2020, 22:07
A old multichannel test (https:\\tech.ebu.ch\docs\tech\tech3324.pdf) show EAC3 (DD+) 448 Kb/s near DTS 1500 Kb/s.

Sadly it seems nobody cared about doing new comparison tests after the release of the Master Audio Suite :( My educated guess says 1509 kbps has always been overkill for six-channel (5.1) lossy DTS and 1344 kbps (or even 1280 kbps) would be sufficient for being qualified as «perceptually-lossless», but it would be nice to have an "official confirmation" so to speak.

tebasuna51
1st October 2020, 10:06
Yes, a new test can be nice. Maybe EAC3, AAC can be better than in 2007, and include also Opus.

But seems than EAC3, AAC and Opus have the same quality than old DTS with 1/3 of bitrate more or less.

SeeMoreDigital
1st October 2020, 12:22
A old multichannel test (https:\\tech.ebu.ch\docs\tech\tech3324.pdf) show EAC3 (DD+) 448 Kb/s near DTS 1500 Kb/s.I'm inclined to agree that multi-channel DTS was 'over bit-rated' at 1509.75 kbps or 1536kbps. Indeed, it sounds perfectly fine when encoded at 754.875kbps or 768kbps... Which is pretty good for an audio format that was developed in the early 1990's ;)

NiN3
26th October 2020, 20:22
I hate to beat a dead horse but I do find it an interesting subject so I did some extra reading of that Dolby paper I posted a few comments above in hopes of trying to learn a bit more about EAC3 in general.

It seems that regardless of the bitrate of the EAC3 stream, your TV's built-in "EAC3->AC3 converter" converts it to AC3 640kbps by default which seems kinda smart since TV broadcasters can now send an EAC3 stream at a much lower bitrate than 640 to save bandwidth and then lets your TV do the conversion to AC3 and since EAC3 is much more efficient at low bitrates technically the conversion will be almost "lossless" as the low bitrate EAC3 gets converted to a high bitrate AC3. (high relative to the even lower EAC3 bitrate obviously, not like 640 is considered high).

And for bitrates higher than 640kbps it'll just throw away the extra information and it ends up being a waste of bandwidth.

This is what I've been wondering, how much loss is there exactly during that conversion? According to the paper it's not a conventional transcode (EAC3 decode -> PCM -> AC3 encode), but majority of the code stays untouched since both codecs were originally built on the same principles, so there shouldn't be much loss in there compared to just doing a lossy to lossy transcode using ffmpeg/eac3to. If one were to encode an AC3 and EAC3 from the same source and play on a TV with S/PDIF connection, the EAC3 would get converted to AC3 while the main AC3 would stay untouched, would both of these end products sound identical? Or would the untouched AC3 sound slightly better than the downconverted one as a result of the "transcoding" process? Would it be worth future-proofing by encoding everything in EAC3 5.1 instead of AC3 5.1?

Anyway, sorry for my long ass questions. There aren't many places to learn this stuff.

SeeMoreDigital
26th October 2020, 22:21
It seems that regardless of the bitrate of the EAC3 stream, your TV's built-in "EAC3->AC3 converter" converts it to AC3 640kbps by default which seems kinda smart Eh?

My LG TV does not convert EAC3 to AC3... It's able to decode native EAC3 up-to 5.1 channels just fine. It's also able to pass EAC3 as a bit-stream via HDMI ARC just fine too!

An SPDIF transport is too old to support EAC3. Hence it's conversion to AC3...

NiN3
26th October 2020, 22:26
Eh?

My LG TV does not convert EAC3 to AC3... It's able to decode native EAC3 up-to 5.1 channels just fine. It's also able to pass EAC3 as a bit-stream via HDMI ARC just fine too!

You can't pass EAC3 using S/PDIF so TV's convert it to AC3 640k. That's the whole point and why I mentioned the document..

nevcairiel
26th October 2020, 22:33
You can't pass EAC3 using S/PDIF so TV's convert it to AC3 640k. That's the whole point and why I mentioned the document..

But thats why someone invented HDMI and (e)ARC.

NiN3
26th October 2020, 22:38
But thats why someone invented HDMI and (e)ARC.

Right, but I am specifically talking about the backwards compatibility of EAC3, as mentioned in the document... That's what I was asking.

SeeMoreDigital
26th October 2020, 23:36
Right, but I am specifically talking about the backwards compatibility of EAC3, as mentioned in the document... That's what I was asking.
Hmmm...

Given that HDMI is currently the de-facto transport system for both video and audio, it's a bit of a pointless discussion....

NiN3
26th October 2020, 23:59
Hmmm...

Given that HDMI is currently the de-facto transport system for both video and audio, it's a bit of a pointless discussion....

Which is why I wasn't talking about HDMI but about the backwards compatibility of EAC3 with legacy AC3 devices that dominate the average living room.

SeeMoreDigital
27th October 2020, 00:05
I think it's time to put this topic, back on topic!

Ripmann
8th July 2021, 18:09
I think it's time to put this topic, back on topic!

Putting it back on topic, I'm kind of stumped that there seem to be no available 7.1 E-AC3 solutions in 2021, especially considering that uncompressed TrueHD 7.1 streams for movies routinely take is 3-4GB in [mostly wasted] space.

Were there any developments in 7.1 E-AC3 encoding since 2020? I just started looking for it (finally got a cheap 7.1 speaker set) and was genuinely surprised to learn that neither eac3to nor ffmpeg support this rather essential feature. Anyone?

tebasuna51
8th July 2021, 20:29
I want a Atmos surround 3D (at least 5.2.1) EAC3 encoder better than a 2D 7.1

Ripmann
8th July 2021, 20:54
I want a Atmos surround 3D (at least 5.2.1) EAC3 encoder better than a 2D 7.1

I didn't realize that these are two separate things. That's what I'm after as well. The main problem here is that any 5.1-converted backups I'll make will have noticeably inferior audio quality compared to the originals, so my only choice is to copy TrueHD and waste a crapload of space in the process.

Is there any tangible progress going in that area? As in, is there any reason to expect that any of the existing tools will start supporting 7.1/5.2.1 by the end of this year? Hope an expert will chime in to give a quick status update.

junh1024
9th July 2021, 00:58
DDP 71 is inefficient due to 4ch surround replacement as others have said.

qAAC & FDK AAC should support 71 AAC, which might be suitable for your purposes.

Blue_MiSfit
9th July 2021, 04:19
Dolby Encoding Engine is a great option for this. Yes it's a paid pro tool, but if you're a pro it's reasonably (imo) priced.

tebasuna51
9th July 2021, 09:47
...The main problem here is that any 5.1-converted backups I'll make will have noticeably inferior audio quality compared to the originals...

For what?

To emulate a 2D surround over a point is enough 3 speakers, like humans have 2 ears it is better 4 speakers in the 4 corners. For what do you need 7 speakers?

If you need more quality 2D use better bitrate, if you need more power buy a new AVR/speakers 5.1 with more power. It is enough a 4.1 but we can respect the standards.

[EDIT] If you have already a AVR 7.1 you can use qaac AAC like junh1024 say. I tested it with my AVR 5.2.1, configured like 7.1, and work fine.
Of course you need a player (PC or standalone) than send PCM 7.1 to the AVR by HDMI.

junh1024
10th July 2021, 12:48
For what?

To emulate a 2D surround over a point is enough 3 speakers, like humans have 2 ears it is better 4 speakers in the 4 corners. For what do you need 7 speakers?

If you need more quality 2D use better bitrate, if you need more power buy a new AVR/speakers 5.1 with more power. It is enough a 4.1 but we can respect the standards.


40 is a bit unstable & has a tiny sweet spot, and there are compromises depending on speaker placement for 51, so 71 is a HQ option for 2D. SOundtrack/mixing is also a factor.

tebasuna51
10th July 2021, 18:27
40 is a bit unstable & has a tiny sweet spot
Sorry, I don't understand you.

there are compromises depending on speaker placement for 51
I think there are much more compromises for 7.1

FranceBB
13th July 2021, 12:45
Dolby Encoding Engine is a great option for this. Yes it's a paid pro tool, but if you're a pro it's reasonably (imo) priced.

+1.
That's what everyone uses professionally and it can take a DAMF as input and encode it to like E-AC3 5.1.4 Atmos etc.
For people it's gonna be good 'cause it encodes directly to what the end-user should receive. Of course it's less good for broadcasters 'cause we're better off with Dolby ED2 as mezzanine and then encode in consumer-tier codecs, but still, for your scenario it's what you're looking for, but of course it's not free, just like literally everything Dolby has ever made eheheheheh

ymgenesis
9th August 2021, 15:59
Putting it back on topic, I'm kind of stumped that there seem to be no available 7.1 E-AC3 solutions in 2021, especially considering that uncompressed TrueHD 7.1 streams for movies routinely take is 3-4GB in [mostly wasted] space.

Were there any developments in 7.1 E-AC3 encoding since 2020? I just started looking for it (finally got a cheap 7.1 speaker set) and was genuinely surprised to learn that neither eac3to nor ffmpeg support this rather essential feature. Anyone?

Has anyone looked into how Plex handles TrueHD 7.1 streams? It uses something called EasyAudioEncoder to decode TrueHD 7.1 and encode to eac3 7.1, all on the fly during transcoding. Therefore, that means their transcoder (which is basically just FFmpeg) is able to utilize a custom or proprietary decoder/encoder (EasyAudioEncoder) to convert TrueHD 7.1 (and probably DTS MA 7.1) to eac3 7.1.

Looking more into this... I looked at the transcoder console as it started transcoding TrueHD to eac3 7.1 and found the FFmpeg commands it used to do this. It uses a decoder for TrueHD called "truehd_eae", and an encoder for EAC3 7.1 called "eac3_eae", "eae" being EasyAudioEncoder. I couldn't find reference to this *coder anywhere, but Plex is using it on the fly to convert TrueHD to EAC3 7.1 (streaming Atmos with full 7.1 channels, not Blu-ray 5.1 with some others). The command output is packaged into a TS stream (for streaming to the Plex player), but it wouldn't be hard to alter the FFmpeg command to output to a file instead of a TS stream.

Next step for anyone interested would be to figure out how to use those tools locally on command line outside of Plex. The tools are installed when installing Plex, and are there, it's just a matter of mimicking the manner in which Plex calls EasyAudioEncoder, and passing the Plex Transcoder (FFmpeg) the right options. Plex itself recommends using its transcoder from time to time on the command line. Link (https://support.plex.tv/articles/201035968-generating-sample-files-from-media/), see "Use the Plex Transcoder".

ymgenesis
13th August 2021, 02:47
Seeing as the title of this thread is "Looking for a eac3 7.1 encoder", I figure this is on-topic:

Building on my idea above, I wrote a UNIX/macOS only bash script that manages various audio conversions in MKVs using FFmpeg/FFprobe and EasyAudioEncoder (TrueHD 7.1/DTS MA 7.1 to EAC3 7.1 encoding included). It requires some resource gathering from your Plex installation on your machine to the script’s folder, but once setup its fairly powerful and straight forward. Script and instructions are macOS only, though with some tweaking of the script, and a little exploration of your Plex installation, you could probably configure it on Linux.

Requires up-to-date Plex Media Server, FFmpeg, and FFprobe (as of writing).

https://github.com/ymgenesis/AudioTool

Blue_MiSfit
13th August 2021, 07:06
+1.
That's what everyone uses professionally and it can take a DAMF as input and encode it to like E-AC3 5.1.4 Atmos etc.
For people it's gonna be good 'cause it encodes directly to what the end-user should receive. Of course it's less good for broadcasters 'cause we're better off with Dolby ED2 as mezzanine and then encode in consumer-tier codecs, but still, for your scenario it's what you're looking for, but of course it's not free, just like literally everything Dolby has ever made eheheheheh

Current releases of DEE can take DAMF or ADM-BWF as input which is emerging in popularity since it's just a single Broadcast WAV file with all the fancy baked in metadata.

I'd actually never even heard of ED2! So what, it's backwards compatible with good old Dolby E so you can route it over SDI / AES (8 channels per pair)? How does that work if you're carrying immersive audio that might have dozens of overlapping objects? Wouldn't you need a variable number of SDI/AES pairs?

Also, yuck compressed audio! :)

guest
26th August 2021, 08:41
Seeing as the title of this thread is "Looking for a eac3 7.1 encoder", I figure this is on-topic:

Building on my idea above, I wrote a UNIX/macOS only bash script that manages various audio conversions in MKVs using FFmpeg/FFprobe and EasyAudioEncoder (TrueHD 7.1/DTS MA 7.1 to EAC3 7.1 encoding included). It requires some resource gathering from your Plex installation on your machine to the script’s folder, but once setup its fairly powerful and straight forward. Script and instructions are macOS only, though with some tweaking of the script, and a little exploration of your Plex installation, you could probably configure it on Linux.

Requires up-to-date Plex Media Server, FFmpeg, and FFprobe (as of writing).

https://github.com/ymgenesis/AudioTool

Why not a Windows build ???

ymgenesis
28th August 2021, 14:38
Because I don't develop/script for Windows. No experience. The script and concept is open on Github. If someone has the necessary experience they can adapt it.

Lollaskates
5th September 2021, 08:09
EasyAudioEncoder appears to use MainConcept's Dolby Digital Plus Pro SDK, statically compiled. Pretty neat.

bokeron2020
8th September 2021, 01:24
EasyAudioEncoder appears to use MainConcept's Dolby Digital Plus Pro SDK, statically compiled. Pretty neat.

In Plex Media Server for Windows it looks like they've compiled a custom ffmpeg with eae encoder/decoder enabled ("Plex Transcoder.exe"), though it needs dlls.

Is it the same thing?

Balling
16th September 2021, 09:24
In Plex Media Server for Windows it looks like they've compiled a custom ffmpeg with eae encoder/decoder enabled ("Plex Transcoder.exe"), though it needs dlls.

Is it the same thing?

Yes. It is -c:a eac3_eae, truehd_eae. See: https://github.com/ymgenesis/AudioTool/blob/904d3f56abd13e01857a686deb611a0ef8103e8f/audiotool.sh#L333

Lollaskates
17th September 2021, 14:52
The ffmpeg in the transcoder is old, and it doesn't decode dtshdma 7.1 :(. After testing of it's decoding and looking at the resulting audio, its only decoding 5.1 DTS core. This also means when plex thinks its transcoding DTSHDMA -> AAC 7.1, its actually taking 5.1 DTS and upmixing it to 7.1 (probably just copying the side channels to rear). Modern ffmpeg does decode DTSHDMA correctly, so to maintain all channels we can decode 7.1 dtshdma to FLAC or similar lossless with modern ffmpeg, then input the FLAC to Plex transcoder/eae to encode 7.1 EAC3.

eae doesn't seem to respect the bitrate you set with ffmpeg args, it'll always encode at 1024kbps. I'm looking into it too.

I've also written a windows equivalent in powershell (that accepts args) and has an accompanying batchfile with drag and drop functionality. It only works with audio: drop in audio and get out eac3 7.1. that's all I'd use it for, I'd use modern ffmpeg for any other operation. There's no need to pass the transcoder ffmpeg video related information, can just do simple audio conversion.

truehd_eae seemed to decode and produce the same file that modern ffmpeg decodes with its truehd codec, so no issue there. The only useful thing here imo is eac3_eae. After I polish up this powershell implementation i'll look into hooking it nicely into Staxrip or something for ease of use.

ymgenesis
1st October 2021, 02:49
The ffmpeg in the transcoder is old, and it doesn't decode dtshdma 7.1 :(. After testing of it's decoding and looking at the resulting audio, its only decoding 5.1 DTS core. This also means when plex thinks its transcoding DTSHDMA -> AAC 7.1, its actually taking 5.1 DTS and upmixing it to 7.1 (probably just copying the side channels to rear). Modern ffmpeg does decode DTSHDMA correctly, so to maintain all channels we can decode 7.1 dtshdma to FLAC or similar lossless with modern ffmpeg, then input the FLAC to Plex transcoder/eae to encode 7.1 EAC3.


Bummer. I had a feeling it was too good to be true when it just seemed to work in the same manner as TrueHD. Maybe Plex will update this one day. I use/rip TrueHD 7.1 sources whenever I can, so it doesn't affect me too much. Plus, my LG TV doesn't support DTS at all, so a 5.1 upmix to 7.1 isn't that bad at the moment.

eae doesn't seem to respect the bitrate you set with ffmpeg args, it'll always encode at 1024kbps. I'm looking into it too.

I noticed this as well when I tried to up the quality to see if it would change the poor audio limiting in some instances.

The only useful thing here imo is eac3_eae. After I polish up this powershell implementation i'll look into hooking it nicely into Staxrip or something for ease of use.

Very cool!

tebasuna51
1st October 2021, 08:56
... so a 5.1 upmix to 7.1 isn't that bad at the moment.

I can't understand, upmix 5.1 to 7.1?
Any AVR 7.1 do so on the fly without need a previous upmix wasting time and space.

I noticed this as well when I tried to up the quality to see if it would change the poor audio limiting in some instances.

Poor quality with a bitrate of 1024 Kb/s?
With 640 Kb/s is already 'transparent' for many speakers and ears.

BTW I can help to do a GUI if there are a free eac3 (for windows) encoder with 7.1 support.

ymgenesis
3rd October 2021, 15:30
Poor quality with a bitrate of 1024 Kb/s?
With 640 Kb/s is already 'transparent' for many speakers and ears.


To elaborate, EasyAudioEncoder limits/compresses loud audio (much like a limiter, compressor, or maximizer in audio production does). In some particularly loud instances it can cause some awful volume fluctuation/flutters. I originally thought it was a side effect of the bitrate, however I learned it was the encoder's normalization process itself. More here (https://forums.plex.tv/t/striking-volume-fluctuation-pulsing-artifacts-when-converting-truehd-7-1-to-eac3-7-1/737767).


BTW I can help to do a GUI if there are a free eac3 (for windows) encoder with 7.1 support.

I guess EasyAudioEncoder is technically free, but it is packaged and licensed to Plex Media Server and its users. It requires a license file that comes with the installation. So while not exactly a paid tool, it is still licensed. Also, I paid for PlexPass, so I'm not 100% sure if its available to free users. Maybe someone can confirm this.

tebasuna51
3rd October 2021, 18:55
About your post in plex forum:

- The -filter_complex' '[0:a:0] aresample=async=1:ocl='\''7.1''\'':rematrix_maxval=60.000000dB:osr=48000[0]' '-map' '[0]'
do absolutly nothing over the TrueHD decoded audio because is already 7.1 and 48 KHz. Don't exist resample or rematrix.

[- I can't know if there are fluctuations but in your sample the EAC3 7.1 is -15 dB less volume than TrueHD or EAC3 5.1 track.
The sample have high volume but without clip and a encoder with this behaviour is usseless to transcode audio tracks.]

- The ffmpeg eac3 track is limited to 5.1 but do a aceptable recode with the same volume than the TrueHD.

EDIT: I was wrong in the second point.
The problem is the DRC data included in the EAC3 stream, the 3 tracks in your MKV play at same level if the player don't apply the Dynamic Range Compression.
Decoded the track with the ffmpeg parameter -drc_scale 0 output the full audio volume.

File: C:\tmp\Bsid12.eac3
Size: 1302528 bytes
----------------------------------------- First Frame Info
StrmTyp .....................: 0 (0=Ind, 1=Dep, 2=AC3)
SubStreamID .................: 0
FrameSize....................: 2292 bytes (573 Kb/s)
SampleRate ..................: 0 (48000 Hz)
NumBlksCod ..................: 3 (6 Blocks)
Audio coding mode (acmod) ...: 7 (3/2 - L, C, R, SL, SR)
Low frequency effects channel: 1 (Present)
Version (bsid) ..............: 12 (Other sintax)
Dialogue normalization ......: -31 dB
Dynamic Range gain ..........: -0.27 dB
Mixing metadata .............: 0 (Not exist)
Informational metadata ......: 0 (Not exist)
Additional Bsi ..............: 0 (Not exist)
----------------------------------------- Revised EAC3 Info
Dyn. Range min/max : -18.06/3.34 dB
Frames Tot/Ind/AC3.: 636 / 318 / 0
Bitrate average... : 1024 Kb/s
Duration ..........: 10176 ms (0 h. 0 m. 10.176 s.)
------------------------------------------------- End Info

Like you can see the DRC force to attenuate the volume until -18 dB or amplify 3 dB, it's normal listen fluctuations.

Then the problem in the PLEX forum is solved configuring the player to don't apply DRC (like is always recommended, use 'Night mode' or similar in the AVR)

tebasuna51
3rd October 2021, 23:35
Other problem with the EAC3 generated by EasyEncoder.

If you load the sample.mkv in MKVToolNix the EAC3 7.1 is not recognized.
By eac3to:

sample.mkv:
------------------------------------------------------------------------------
MKV, 1 video track, 3 audio tracks, 0:00:10, 24p /1.001
1: h265/HEVC, English, 3840x1600 24p /1.001 (12:5), 10 bits
2: TrueHD (Atmos), English, 7.1 channels, 48kHz, 5ms "TrueHD 7.1"
3: EAC3, English, 7.1 channels, 32 bits, 48kHz, 5ms "EAC3 7.1 from TrueHD"
4: EAC3, English, 5.1 channels, 16 bits, 48kHz "EAC3 640kbps"

But the mkvmerge -i (info) show:

File 'C:\Temp\audacity_temp\sample.mkv': container: Matroska
Track ID 0: video (HEVC/H.265/MPEG-H)
Track ID 1: audio (TrueHD Atmos)
Track ID 3: audio (E-AC-3)

The track ID 2 is not recognized.

Maybe is because all the frames have the header field 'bsid' with the value 12. The well know values are: 8 for Standard Syntax, 6 for Alternate Syntax and 16 for Enhanced Syntax.

But is a valid value:
Annex E: Enhanced AC-3

bsid – Bit Stream Identification – 5 Bits

The bsid field has a value of ‘10000’ (=16) for bitstreams compliant with this Annex. Values of bsid smaller than 16 and greater than 10 are used for versions of E-AC-3 which are backwards compatible with version 16 decoders. Decoders which can decode version 16 will thus be able to decode version numbers less than 16 and greater than 10. Additionally, E-AC-3 decoders shall also be able to decode AC-3 bitstreams with bsid values 0 through 8. Decoders compliant with this Annex are not able to decode bit streams with bsid=9 or 10.

ymgenesis
4th October 2021, 16:01
Great research! I definitely don't have the knowledge to do that kind of digging.

I know Plex has issue with compatibility when it comes to these EAC3 7.1 tracks. Also, It uses an older build of ffmpeg/ffprobe which only recognizes these 7.1 tracks as 5.1 in their GUI. During playback they do playback Dolby Digital 7.1. The current versions of ffmpeg/ffprobe recognize the tracks as 8 channel (7.1).

Interesting about the DRC. Thanks for that info. I do use "night mode" sometimes in my setup, but it squashes the dynamic range. No more lows as they're basically mixed in to ensure less of an offending output. But, that's what it's supposed to do, so I can't complain.

Also interesting about bsid 12. I noticed eac3to does a good job of recognizing and handling these EasyAudioEncoder-encoded tracks. mkvnix and tsmuxer seem to have some issues handling the tracks. Mediainfo usually shows the right information.

Balling
5th October 2021, 11:59
Great research! I definitely don't have the knowledge to do that kind of digging.



EAC3 and Atmos specs are publically available from ETSI in pdf.
I can paste the docx files which are only available to members though. Atmos metadata in EAC3 is decoded using Hafmann tables which are also available.

https://portal.etsi.org/webapp/workprogram/Report_WorkItem.asp?WKI_ID=52775 here top right corner, pdf, docx, and zip with tables.

tebasuna51
5th October 2021, 12:17
To resume the situation:
To elaborate, EasyAudioEncoder limits/compresses loud audio (much like a limiter, compressor, or maximizer in audio production does). In some particularly loud instances it can cause some awful volume fluctuation/flutters.

Seems EasyAudioEncoder create DRC metadata in eac3 stream with undesired results.
But the problem can be override instructing the player to don't apply DRC to AC3/EAC3 (the only than have these normally, DTS can have also but don't use it).
I always recommend do so on players, we can use instead AVR functions like 'Night mode' than can be applied to any audio, (not only AC3/EAC3) with a button in the remote control instead changing the player configuration.

Seems also than recode only until 1024 Kb/s. But I think is enough

More here (https://forums.plex.tv/t/striking-volume-fluctuation-pulsing-artifacts-when-converting-truehd-7-1-to-eac3-7-1/737767).

The samples you create was using '/usr/lib/plexmediaserver/Resources/Plex Transcoder'? Like it was the old ffmpeg compiled with the EasyEncoder lib.
Do you need to be connected to Internet at this moment? To obtain some permission for instance.

I guess EasyAudioEncoder is technically free, but it is packaged and licensed to Plex Media Server and its users. It requires a license file that comes with the installation.

Then who need recode to eac3 7.1 in windows must install Plex Media Server and then recode it with:

"C:\Program Files (x86)\Plex\Plex Media Server\PlexTranscoder.exe" -i INPUT7.1 -c:a eac3_eae -b:a 1280k OUTPUT.eac3

Where INPUT7.1 can be a TrueHD (if the ffmpeg version is too old maybe need before the input the parameter -c:a:0 truehd_eae) or a DTS-HD (if the ffmpeg version is too old maybe don't support DTS-HD and need a previous decode to .W64/WAV) or a WAV (or W64 if is greater than 4 GB).

Any volunteer to check if is really free?

ymgenesis
5th October 2021, 18:35
The samples you create was using '/usr/lib/plexmediaserver/Resources/Plex Transcoder'? Like it was the old ffmpeg compiled with the EasyEncoder lib.
Do you need to be connected to Internet at this moment? To obtain some permission for instance.


Yes, the sample I created in that post was using the "audiotool" I wrote here (https://github.com/ymgenesis/AudioTool). The command would be the same as I quoted in the Plex forum post. I don't believe an internet connection is needed. On Mac, it requires the structure from here (https://github.com/ymgenesis/AudioTool#dependencies-and-folder-structure). Variables for the Codecs and Encoder folder need to be set properly (folder with dylibs, probably dlls in Windows, and the Plex Transcoder executable). It needs EasyAudioEncoder executable and the license file. This license file is the permission file to be able to use EasyAudioEncoder executable, so I don't think an internet connection is needed. Keep in mind all these resources (including EasyAudioEncoder and its license file) are insalled when installing Plex. They get updated every once and a while when Plex updates. EasyAudioEncoder must be running for the encode to work, as you can see I execute EasyAudioEncoder first in the background here (https://github.com/ymgenesis/AudioTool/blob/904d3f56abd13e01857a686deb611a0ef8103e8f/audiotool.sh#L329) before executing the Plex Transcoder executable here (https://github.com/ymgenesis/AudioTool/blob/904d3f56abd13e01857a686deb611a0ef8103e8f/audiotool.sh#L331) a couple lines later. Of course, this is Unix.

Sorry I can't be more help with Windows. The process isn't exactly clean, as it requires the proper environment variables, and needs a running EasyAudioEncoder instance before executing the Plex Transcoder (ffmpeg) command.

And as I mentioned before, I paid for Plex Pass, which may have allowed me EasyAudioEncoder for 7.1 transcoding when playing on Plex (existence of EasyAudioEncoder and license file). BUT, I don't know that 100%, I actually suspect it is included with the free version. So, if someone wants to try, they can sign up for a free Plex account at plex.tv and download my sample from here (https://www.mediafire.com/file/sicv8mizm2tsnov/sample.mkv/file) (same sample as on the Plex forums), add it to your server once setup, and see if it'll transcode the first audio track (TrueHD) to EAC3 7.1 when playing back on your 7.1-capable TV/box & AV setup. If it does, EasyAudioEncoder exists and can be used in a manner like my "audiotool".

Krautmaster
18th October 2021, 19:00
tried the same with my plexserver and get this:


C:\Program Files (x86)\Plex\Plex Media Server\Plex Transcoder.exe" -i "C:\tmp\cut.mkv" -map v:0 -map a:0 -c:v copy -c:a:0 eac3_eae -b:a:0 1280k plex_convert.mkv

[truehd_eae @ 02a6f400] No EAE watchfolder set!
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (truehd (truehd_eae) -> eac3 (eac3_eae))
Error while opening decoder for input stream #0:1 : Generic error in an external library

ideas?

tebasuna51
18th October 2021, 22:33
@Krautmaster
Sorry, seems don't work because:

...
Sorry I can't be more help with Windows. The process isn't exactly clean, as it requires the proper environment variables, and needs a running EasyAudioEncoder instance before executing the Plex Transcoder (ffmpeg) command...

Milka
23rd November 2021, 22:55
so, Is Dolby software (Dolby suite and Dolby encoding engine) the only apps for encode 7.1 DD+ (in any bitrate) for now?

filler56789
24th November 2021, 05:51
so, Is Dolby software (Dolby suite and Dolby encoding engine) the only apps for encode 7.1 DD+ (in any bitrate) for now?

OR ""any"" :rolleyes: Dolby-licensed software, such as Rovi's TotalCode Studio.

szabi
18th December 2021, 20:16
This 7.1ch DD+ encoding does not developing quickly.
My first post near 6 years old (https://forum.doom9.org/showpost.php?p=1754063&postcount=170) asking it.

FuzzyNutz
2nd February 2022, 22:39
Adobe Audition 2018 and below includes support for EAC3 encoding up to 7.1 1024 Kbps, but is not Blu-ray compatible.

AC3/EAC3 encoders are not present in the 2018 version of Adobe Audition. They're in the 2017 version. Apparently, getting the 2017 version from Adobe, at present, will yield a version that has had the Dolby encoders removed. Thus, acquiring an existing version of Adobe Audition 2017, or possibly earlier, may be necessary.
The 2017 version can encode 7.1 EAC3 up to 1024. It can also enable the surround EX flag for AC3 and EAC3. Audition's Dolby encoding is accessible via File -> Export -> File, after double-clicking the loaded source file. The plethora of studio-level configuration options suggests Audition's AC3/EAC3 encoders are the no-compromise, professional version(s).
Lossless sources in TrueHD and dts-HD formats won't load into Audition, but .w64 and FLAC versions, created with eac3to or similar, will.
Audition outputs EAC3 files with .ec3 extensions. Though the .ec3 will need to be changed to .eac3 to be recognized by some software, MKVToolNix correctly outputs EAC3 tracks from .ec3 or eac3. Matroska files containing EAC3, including 7.1, created with Audition, are playable with VLC, MPC-HC, KODI, Microsoft Movies & TV and Windows Media Player. -My playback tests were done on various Windows 10 PCs outputting in 2-channel stereo via HDMI and DisplayPort.

tebasuna51
3rd February 2022, 20:00
I make a test with the EAC3 encoder in Audition 2017.

Like FuzzyNutz say we can access it with the menu: File -> Export -> Export File
And we can configure all settings like I explain here (see the attached image) with some considerations:

3) Change Sample type
By default put 5.1 and we need change to Same as source for 7.1 EAC3 output.
But seems there are a bug and we need remap (swap BL-BR with SL-SR) the input file to obtain a correct channel mapping output.
If we want recode a DTS-MA 7.1 we need obtain a remaped W64 file for instance with eac3to:

eac3to 8v341.dtshd 8v341.dtshd_R.w64 -0,1,2,3,6,7,4,5

5) Codec Mode: only Dolby Digital Plus can output eac3 7.1 and not BluRay compliant. The rest if for AC3 until 5.1

6) Channel Configuration: the standard wav 7.1 order is FL,FR,FC,LFE,BL,BR,SL,SR to output L R C LFE Ls Rs Rls Rls we need the remap mentioned in 3)

7) The max bitrate offered is 1024 like was already mentioned.

8) Pre-Procesing: there are other values by default, but if we are recoding from a source already processed maybe is better uncheck all the options.

9) Dynamic Range Control: by default is Film Standard, but I recommend set to None to avoid volume problems already mentioned in this thread.

Other settings can be let at defaults.

FuzzyNutz
4th February 2022, 00:28
tebasuna51:

Should all 7.1 w64 files, (to be encoded in EAC3 7.1 with Adobe Audition 2017), be remapped regardless of whether the source was dts-ma, TrueHD, FLAC, LPCM etc.?

Have you confirmed Audition's Dolby encoding is not automatically remapping (map correcting) when creating EAC3 7.1 from w64?

tebasuna51
4th February 2022, 00:39
Must be remaped always, seems a problem with the Audition included encoder, can't recognize the standard WAV/W64 channel order FL,FR,FC,LFE,BL,BR,SL,SR and asign BL,BR to Ls,Rs instead to Rls,Lls.

FuzzyNutz
4th February 2022, 01:04
Must be remaped always, seems a problem with the Audition included encoder, can't recognize the standard WAV/W64 channel order FL,FR,FC,LFE,BL,BR,SL,SR and asign BL,BR to Ls,Rs instead to Rls,Lls.

Off thread topic yet related, I've assumed eac3to remaps as needed. Is this correct?

tebasuna51
4th February 2022, 01:16
Nope, it is not a eac3to job (maybe only for LPCM) the decoders (libav, arcsoft, ...) must decode to standard WAV/W64 channel order and the encoders (libaften, libflac and externals like ffmpeg) must know that order and convert to internal channel order of the codec.

We only need remap when a decoder or encoder is wrong.
Here Audition show the correct WAV/W64 channel order, but the encoder don't correct the order to the internal order.

FuzzyNutz
4th February 2022, 01:24
Nope, it is not a eac3to job (maybe only for LPCM) the decoders (libav, arcsoft, ...) must decode to standard WAV/W64 channel order and the encoders (libaften, libflac and externals like ffmpeg) must know that order and convert to internal channel order of the codec.

Therefore, effectively, eac3to conversions, (from dts-ma, TrueHD, wav, w64, flac to ac3, aac, flac etc.), are remapped as needed?

tebasuna51
4th February 2022, 02:22
All eac3to decoders (libav, libdcadec.dll, arcsoft,...) output correct WAV/W64 channel mapping, and all eac3to encoders (libaften, libflac, neroAacEnc.exe) read that channel order and change to internal equivalent channel order.

Also, if you use external decoders (ffmpeg.exe, flac.exe, Lame.exe, NeroAacDec.exe, opusdec.exe, oggdec.exe, wma2wav.exe, and others) always can output WAV/W64 with the correct channel order, no mather the internal channel order of the codec.
And, if you use external encoders (fdkaac.exe, ffdcaenc.exe, ffmpeg.exe, flac.exe, lame.exe, neroAacEnc.exe, oggenc2.exe, opusenc.exe, qaac.exe, and others) always accept WAV/W64 files and know the input channel order, and is a job of the encoder convert to internal order if is different.

tebasuna51
4th February 2022, 02:55
To test the correct channel order you can use a Channel test like the attached.
Obtain a w64 with:

ffmpeg -i "7.1_Channels.aac" -acodec pcm_s24le "7.1_Channels.w64"

And encode the w64 with EAC3 Audition 2017

Now remap and encode:
ffmpeg -i "7.1_Channels.aac" -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -acodec pcm_s24le "7.1_Channels_R.w64"

And listen the two eac3 in a 7.1 audio system.

FuzzyNutz
4th February 2022, 03:08
To test the correct channel order you can use a Channel test like the attached.
Obtain a w64 with:

ffmpeg -i "7.1_Channels.aac" -acodec pcm_s24le "7.1_Channels.w64"

And encode the w64 with EAC3 Audition 2017

Now remap and encode:
ffmpeg -i "7.1_Channels.aac" -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -acodec pcm_s24le "7.1_Channels_R.w64"

And listen the two eac3 in a 7.1 audio system.

I got rid of my 5.1/7.1 setups. My rigs are 2.0/2.1. I'll assume you've confirmed the mapping of Audition's 7.1 w64 to EAC3. -Despite my stereo setups, I don't downmix my encodes to stereo.

Thank you for your insight and efforts.

FuzzyNutz
4th February 2022, 03:48
The option to enable the surround EX mode is available for ac3 and eac3, in Adobe Audition (2017), whether the source is 5.1, 6.1 or 7.1 and whether the output of eac3 is 5.1, 6.1 or 7.1. So... what is the EX accomplishing, especially when the source is 5.1?

junh1024
4th February 2022, 04:40
AFAIK It just enables a flag to tell your AVR it's EX, so it can treat the sound accordingly.

FuzzyNutz
4th February 2022, 04:53
AFAIK It just enables a flag to tell your AVR it's EX, so it can treat the sound accordingly.

What does that accomplish if the source is 5.1?

tebasuna51
4th February 2022, 10:06
From the manual:

D2.3.8 dsurexmod: Dolby Surround EX Mode, 2 bits

This 2-bit code, as shown in Table D2.7, indicates whether or not the program has been encoded in Dolby Surround EX.
This information is not used by the AC-3 decoder, but may be used by other portions of the audio reproduction equipment.
If dsurexmod is set to the reserved code, the decoder should still reproduce audio. The reserved code may be interpreted as “not indicated”.

Table D2.7 Dolby Surround EX Mode
dsurexmod Indication
--------- -----------------------------
'00' Not indicated
'01' Not Dolby Surround EX encoded
'10' Dolby Surround EX encoded
'11' Reserved


Note: The meaning of this field is only defined as described if the audio coding mode is 2/2 or 3/2.
If the audio coding mode is 1+1, 1/0, 2/0, 3/0, 2/1 or 3/1 then the meaning of this field is reserved.

The Dolby Digital EX format is similar to Dolby Digital. It's used in the same way, but it adds a third surround channel speaker behind the listener, making it a 6.1 channel system.
The channels are represented by six speakers (left, [center], right, left surround, center back, and right surround) and a subwoofer

If the audio equipment is 6.1 or 7.1, and have the Dolby Digital EX decoder , can extract the BC channel from the Surround Channels.
Of course the source must be encoded previously like Dolby Digital EX, the AC3/EAC3 encoder can't do that job.
Here (7.1) is useless and with 5.1 only if the source was previously a Dolby Digital EX.

FuzzyNutz
4th February 2022, 21:32
Of course the source must be encoded previously like Dolby Digital EX, the AC3/EAC3 encoder can't do that job.
Here (7.1) is useless and with 5.1 only if the source was previously a Dolby Digital EX.

Did you intent to say "the AC3/EAC3 decoder can't do that job"? and What are sources that were previously EX?

If the encoder doesn't require a source with more than 5.1 channels for EX to be enabled and subsequently, the creation of a back center by an A/V receiver, why not enable the EX flag for all AC3/EAC3 5.1 encodes?

tebasuna51
5th February 2022, 01:28
Did you intent to say "the AC3/EAC3 decoder can't do that job"?

Nope, the AC3/EAC3 encoder need a 5.1 with the Ls-Rs previously obtained from 3 surround channels Ls-Bs-Rs. The original source must be 6.1

After decode the AC3/EAC3 to 5.1, if the receiver (6.1 at least) read the EX flag and have a Dolby Ex decoder the Bs channel is recovered.

https://en.wikipedia.org/wiki/Dolby_Digital#Dolby_Digital_EX

writemaster
5th February 2022, 12:41
hi tebasuna51

Is it possible to make DD-EX audio from lossless 7.1 audio?
There is no guide for this unfortunately. If you have information on this subject, I would appreciate it if you could please explain it with an illustrated guide. thank you very much for all your efforts

Adobe Audition Thank you very much for the guide.

tebasuna51
5th February 2022, 13:19
Just some info about the 3/4 (L R C LFE Ls Rs Vhl Vhr) EAC3 encode mode.

I have a minimal '3D' Surround audio system with speakers like the image1 attached. The receiver (7.1) is configured like a 3front/2surround/2top.lfe

When play a EAC3 encoded like (L R C LFE Ls Rs Vhl Vhr) I can listen the Vhl Vhr channels with my FDL,FDR speakers.
To encode, with Audition 2017, a WAV/W64 file 2/2/2.1 (FL FR FC LFE SL SL TFL TFR, mask channel 0x560F=22031) to EAC3 (L R C LFE Ls Rs Vhl Vhr) we don't need remap the source.

But when play a standard 7.1 (L R C LFE Ls Rs Rls Rrs) I listen the channels Ls,Rls by the speaker SL and Rs,Rrs by speaker SR, and the FDL,FDR speakers are mute, like is the correct behaviour, and enough for me for a 2D surround.

To make test over (L R C LFE Ls Rs Rls Rrs) I need deceive the receiver and configure the system like image2 to listen Rls,Rrs with my FDL,FDR speakers.

Then the (L R C LFE Ls Rs Vhl Vhr) mode can be used instead Atmos/DTS:X for a basic 3D (enough for me) surround system (3/2/2.1)

tebasuna51
5th February 2022, 13:45
Is it possible to make DD-EX audio from lossless 7.1 audio?

It is possible but I don't know for what.
Only 6.1 audio systems can obtain a little less size recoding a 5.1 EX instead a pure 6.1. It is not recommended.

For 5.1 systems I recommend the standard downmix already explained (https://forum.doom9.org/showthread.php?p=1920201#post1920201).

After that downmix to 5.1 you can encode it like EX if you want, but is usseless for 2D surround:
- In a 5.1 system you listen the common parts in SL,SR channels like a phantom BS channel.
- In a 6.1 system the common parts in SL,SR channels are extracted and sended to BS speaker.
- In a 7.1 system the common parts in SL,SR channels are extracted and half volume are sended to BL,BR speakers.
You listen the same in all systems, with or without encode like EX.

junh1024
6th February 2022, 05:22
Just to add on what tebasuna51 said, let's say you have a 51EX track.

Q: How do you know it was made from a genuine 61/71 source?
A: you can't, unless a proper 61/71 release was made. It's possible to flag a traditional 51 source, or a real 61 source, as EX. You may or may not get a discrete sounding BC when you decode. It could be coincidental, or good mixing, you can't be sure.

As for encoding 51EX from 71, the actual gain could vary a lot since it's possible to make audio which conflicts or makes the EX encoding useless. Any down-matrixing loses information, so it's suggested to retain the original channel count. It's also possible to have 71 audio which is 51 downmix incompatible (eg, original BD of The Lion King).

FuzzyNutz
4th March 2022, 23:15
Must be remaped always, seems a problem with the Audition included encoder, can't recognize the standard WAV/W64 channel order FL,FR,FC,LFE,BL,BR,SL,SR and asign BL,BR to Ls,Rs instead to Rls,Lls.

Audition accepts some flac input files. Would 7.1 flac files need to be created with the same remapping required for 7.1 wav/w64 files?

tebasuna51
5th March 2022, 04:12
Audition accepts some flac input files. Would 7.1 flac files need to be created with the same remapping required for 7.1 wav/w64 files?

Yes, the problem is not when Audition read the input file (tested ok with wav, w64 and flac) but when the encoder fail to remap the channels to the internal eac3 channel order.

FuzzyNutz
5th March 2022, 17:08
Yes, the problem is not when Audition read the input file (tested ok with wav, w64 and flac) but when the encoder fail to remap the channels to the internal eac3 channel order.

Therefore, 7.1 flac channel order is the same as wav/w64?

tebasuna51
6th March 2022, 10:25
Yes, from https://xiph.org/flac/format.html#format_overview

FRAME_HEADER
...
Channel assignment

0000-0111 : (number of independent channels)-1. Where defined, the channel order follows SMPTE/ITU-R recommendations. The assignments are as follows:
1 channel: mono
2 channels: left, right
3 channels: left, right, center
4 channels: front left, front right, back left, back right
5 channels: front left, front right, front center, back/surround left, back/surround right
6 channels: front left, front right, front center, LFE, back/surround left, back/surround right
7 channels: front left, front right, front center, LFE, back center, side left, side right
8 channels: front left, front right, front center, LFE, back left, back right, side left, side right
is the same than WAV/W64 and is read in the same order correctly by Audition, but when the EAC3 encoder make a 'L R C LFE Ls Rs Rls Rrs' must asign 'back left, back right' to 'Rls Rrs' instead to 'Ls Rs'

tormento
8th April 2022, 14:02
I finally put my hands on TotalCode Studio, that I can admit produces very nice quality Dolby Digital Plus files but it's really slow.

I have two questions for the "audio specialists" here.

Unfortunately it's really picky about the audio format it can ingest and doesn't support something as THD at all or DTS when not in a "commercial" container, so the only idea I had for now was to use ffmpeg and convert THD and DTS to WAV(s) with the command line

ffmpeg.exe" -i "input.thd" -rf64 auto "output.wav"

but thus I lose both metadata and channel order.

TotalCode has 2 configuration panels:

https://i3.lensdump.com/i/rhSGii.png (https://lensdump.com/i/rhSGii)

https://i.lensdump.com/i/rhSa9o.png (https://lensdump.com/i/rhSa9o)

Do you have any hint to correctly use it with the various audio streams that I can encounter?

filler56789
8th April 2022, 14:07
Try eac3to instead of ffmpeg.

richardpl
8th April 2022, 16:49
eac3 is not supporting 7.1

tebasuna51
8th April 2022, 17:30
but thus I lose both metadata and channel order.
Atmos metadata of course is losed but the channel order is correctly stored in ChannelMask of WAVE_FORMAT_EXTENSIBLE header of WAV/W64/RF64 (FL FR FC LF BL BR SL SR) for 7.1

If the encoder of TotalCode Studio can't read the ChannelMask of input files, like seems do the encoder of Adobe Audition you must use the same remap with eac3to (https://forum.doom9.org/showthread.php?p=1963144#post1963144) or ffmpeg (https://forum.doom9.org/showthread.php?p=1963170#post1963170)

Do you have any hint to correctly use it with the various audio streams that I can encounter?

You must know the source, with MediaInfo for instance, and read this (https://mediaarea.net/AudioChannelLayout)

Simplified and in the wav order:
MediaInfo WAV EAC3 DTS
--------- --- --- ---
Front Left L FL L L
Front Right R FR R R
Front Center C FC C C
Low-frequency Effects LFE LFE LFE LFE
Rear Left Surround Lb BL Lrs Lsr
Rear Right Surround Rb BR Rrs Rsr
Front Left Center Lc FLC Lc Lc
Front Right Center Rc FRC Rc Rc
Back Centre Cb BC Cs Cs
Surround Left Ls SL Ls Ls
Surround Right Rs SR Rs Rs
Top Centre Tc TC Ts Oh
Top Front Left Tfl TFL Vhl Lh
Top Front Centre Tfc TFC Vhc Ch
Top Front Right Tfr TFR Vhr Rh
Top Back Left Tbl TBL Lhr
Top Back Centre Tbc TBC Chr
Top Back Right Tbr TBR Rhr
In a 7.1 wav standard the channels 4-5 are Lrs-Rrs, and channels 6-7 are Ls-Rs

tebasuna51
8th April 2022, 17:35
eac3 is not supporting 7.1

We are talking about TotalCode Studio and Adobe Audition like encoders.

eac3to can decode Thd/DTSHD 7.1

tormento
8th April 2022, 19:05
In a 7.1 wav standard the channels 4-5 are Lrs-Rrs, and channels 6-7 are Ls-Rs
Thank you, I will apply on my next encode :)

Can you please complete the table with THD, DTS and PCM up to 7.1?

And the most important question: does FFMPEG honor that order when decoding to WAV?

tebasuna51
8th April 2022, 21:36
Can you please complete the table with THD, DTS and PCM up to 7.1?

I add the DTSHD column because some encoders need mono wavs, but I don't know the names for THD encoders and we don't need know at all the internal names and order.

And the most important question: does FFMPEG honor that order when decoding to WAV?

Of course, all actual decoders than I know change the internal codec channel order to the wav order and fill the ChannelMask field of WAVE_FORMAT_EXTENSIBLE header.

And all actual encoders than I know read wav input ChannelMask and create the equivalent internal channel order if is available (if not show a error). If wav input have a simple header (without ChannelMask) assign a default channel map for each number of channels.

For instance for qaac encoder:
In addition to mono/stereo, following channel layouts are supported for AAC and ALAC with slight variations.
When channel layout is unknown, one of the layouts indicated by asterisk is assumed as default.
# chn input layout output layout codec
----------- --- --------------------------------- ----------------------- ------------
3ch* 3 FL FR FC C L R LC, ALAC
4ch 4 FL FR FC BC C L R Cs LC, ALAC
4ch * 4 FL FR BL BR (SL SR) L R Ls Rs LC, HE
5ch * 5 FL FR FC BL BR (SL SR) C L R Ls Rs LC, ALAC
5.1ch * 6 FL FR FC LF BL BR (SL SR) C L R Ls Rs LFE LC, HE, ALAC
6ch 6 FL FR FC BL BR BC (SL SR) C L R Ls Rs Cs LC
6.1ch * 7 FL FR FC LF BL BR BC (SL SR) C L R Ls Rs Cs LFE LC, ALAC
7ch 7 FL FR FC BL BR SL SR C L R Ls Rs Rls Rrs LC
7.1ch front 8 FL FR FC LF BL BR FLC FRC (SL SR) C Lc Rc L R Ls Rs LFE LC, HE, ALAC
7.1ch rear* 8 FL FR FC LF BL BR SL SR C L R Ls Rs Rls Rrs LFE LC, HE
8ch 8 FL FR FC BL BR BC SL SR C L R Ls Rs Rls Rrs Cs LC

(SL SR) is accepted like BL BR to output Ls Rs
Rls Rrs is here MediaInfo Lb Rb (or wav BL BR or EAC3 Lrs Rrs)
Like you see the order and name aren't the same but the encoder do the job atomatically.

tebasuna51
11th April 2022, 14:52
I make a test also with TotalCode Studio.

We can configure it like with Audition with some differences:

1) For big files like movie tracks we need rf64 input files (without support for .w64).
And need remap or use the internal remap showed in the image. We can use eac3to:

eac3to 8v341.dtshd 8v341_R.rf64 -0,1,2,3,6,7,4,5

2) The max bitrate is also 1024 Kb/s but there are different channel layouts (see the images).
Without the (L R C LFE Ls Rs Vhl Vhr) than work fine with my audio system 3D 5.2.1.

3) Is fast than Audition.
In my previous old PC (Intel i5-3550 3.30GHz, DDR3 2+2 GB PC3-10700 (667 MHz), SATA ST2000DL003-9VT166 2TB) a source file (Jurasic Park 2h 6m 37s) converted previously to rf64 take 10m 36s to be converted to .ec3.
Audition take 4m to load the .w64 and after 14m to convert it to ec3.

tormento
12th April 2022, 14:59
And need remap or use the internal remap showed in the image. We can use eac3to
I prefer to use ffdshow -rf64 auto because it has updated decoders.

Would you please try to use it and tell me if I need channel remapping?

I currently have 2.0 HT here, so I encode to DD+ for archive purpose only and can't directly test.

tebasuna51
12th April 2022, 15:34
I prefer to use ffdshow -rf64 auto because it has updated decoders.

Don't work for me:
[NULL @ 000001c14431ee00] Unable to find a suitable output format for 'C:\tmp\8v341.dtshd_.rf64'
C:\tmp\8v341.dtshd_.rf64: Invalid argument

Would you please try to use it and tell me if I need channel remapping?

Of course:
-filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5"

tormento
12th April 2022, 17:44
Don't work for me
You need to output a WAV file, as RF64 is just a header.

Such as:

ffmpeg.exe -i whatever.thd -rf64 auto whatever.wav

Try and tell me.

tebasuna51
12th April 2022, 20:47
You need to output a WAV file, as RF64 is just a header.

I tried with a small file and just output a wav with RIFF header.

Seems need to be a big file (>4 GB) to create a RF64 header.
No problem, if TotalCode Studio accept .wav with RF64 header, instead the .rf64 extension.

tormento
12th April 2022, 21:00
I tried with a small file and just output a wav with RIFF header.
Yes, that is the purpose of the auto parameter.

Unfortunately EAC3TO development is frozen, that is why I suggest to use ffmpeg, at least for the decoding part.

The command line that you gave me was for ffmpeg or EAC3TO? And for TotalCode or Audition?

tebasuna51
13th April 2022, 10:39
With ffmpeg:

ffmpeg.exe -i whatever.thd -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -rf64 auto -acodec pcm_s24le whatever.wav

Needed for both, TotalCode or Audition, when the source is a standard 7.1 and the output is remapped to FL FR FC LFE SL SR BL BR in the order to obtain the EAC3 L R C LFE Ls Rs Lrs Rrs

With TotalCode you can do the remap inside the dialog 'Channels' window.

tebasuna51
13th April 2022, 11:16
WARNING:

By default the ffmpeg output is downsize to 16 bitdepth, no mather the source bitdepth:

Input #0, dts, from 'D:\Test\MA71.dts':
Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
Stream mapping:
Stream #0:0 -> #0:0 (dts (dca) -> pcm_s16le (native))
Output #0, wav, to 'D:\Test\MA71.dts_.wav':
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s16, 6144 kb/s
encoder : Lavc59.18.100 pcm_s16le

eac3to check the input bitdepth, even if is marked wrong, an output the correct bitdepth, you can lose precission with the actualized decoders (without changes for dtsma/thd standard for longtime ago)

With ffmpeg you must know the source bitdepth or add always -acodec pcm_s24le. Now:
Input #0, dts, from 'D:\TestMA71.dts':
Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
Stream mapping:
Stream #0:0 -> #0:0 (dts (dca) -> pcm_s24le (native))
Output #0, wav, to 'D:\Test\MA71.dts_.wav':
Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s32, 9216 kb/s
encoder : Lavc59.18.100 pcm_s24le

tebasuna51
13th April 2022, 13:11
How I do the job (see the image):

1) Load the input file in UsEac3to, and let use the eac3to bitdepth detection

2-4) Select (or write yourself) the desired parameters for ffmpeg

5-6) Click 'A/V Recode' and Replace the decoder by the ffmpeg parameters

7) Select output file 'WAV'
UsEac3to select like encoder "-acodec pcm_s16le" for 16 bit DTSMA or "-acodec pcm_s24le" for 24 bit DTSMA or THD by default.
Many THD are marked as 24 even when are only 16 (detected by eac3to) but if after is recoded to eac3 it is not a problem.

The command line generated is like (without paths to input and output folders):
ffmpeg -i "INPUT" -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -rf64 auto -acodec pcm_s24le "INPUT_.wav"

tormento
13th April 2022, 15:14
Needed for both, TotalCode or Audition, when the source is a standard 7.1
Is it ffmpeg fault or wav format fault in your opinion?

Do we need the same remap for 7.1 DTS, 5.1 THD and 5.1 DTS?

tebasuna51
13th April 2022, 15:22
Is a encoder fault than ignore the channelmap stored in the wav header, writed correctly by ffmpeg.

AAC, FLAC and OPUS encoders don't need remap at all.

5.1 don't need remap, 7.1 standard always with these encoders.
The 5.1.2 in Audition don't need remap.

tormento
15th April 2022, 14:07
Is a encoder fault than ignore the channelmap stored in the wav header, writed correctly by ffmpeg.
Thanks!

Please explain me how to check if a encoder loses channel configuration and how to understand the proper channel "wiring" to be done.

tormento
15th April 2022, 18:54
UsEac3to select like encoder "-acodec pcm_s16le" for 16 bit DTSMA or "-acodec pcm_s24le" for 24 bit DTSMA or THD by default.
What does it choose for already existing EAC3?

Let us say I want to lower bitrate from 896 to 640. Would it use 24 or 16 bits?

Does it need channel remap when 7.1 or is it in the right order as wav from eac3?

tebasuna51
16th April 2022, 09:58
What does it choose for already existing EAC3?

Let us say I want to lower bitrate from 896 to 640. Would it use 24 or 16 bits?
Only lossless encodes (TrueHD, DTS-MA, FLAC,...) have a bitdepth

Lossy encodes don't have bitdepth. Decoders work internally in float format, eac3to can output until 64 bits float, but it is enough 24 bits int (human ear can difference only to 20 bits).

Does it need channel remap when 7.1 or is it in the right order as wav from eac3?

The correct wav order is always the same, no mather the source codec, then always must be remapped for that encoders.
Thanks!

Please explain me how to check if a encoder loses channel configuration and how to understand the proper channel "wiring" to be done.

Download the channel test in https://forum.doom9.org/showthread.php?p=1963170#post1963170

If you don't have a 7.1 system to listen you always can "see" the order, the first image is the correct the second is a wrong order:

tormento
16th April 2022, 15:46
Download the channel test
Thanks!

Do you know some audio editor that can open THD, DTSHD and so?

What is that one?

tebasuna51
16th April 2022, 20:03
Audo editors only work with uncompressed audio.

Decode anything to wav/w64 before edit.

I work with Goldwave from longtime ago, but you can use Audacity also.

tormento
20th April 2022, 16:39
Many THD are marked as 24 even when are only 16 (detected by eac3to) but if after is recoded to eac3 it is not a problem.
Is there a way to find the correct bitdepth?

tebasuna51
21st April 2022, 03:05
Let eac3to decode it.
It analyze all decoded samples to see how many bits have info.

tormento
30th May 2022, 17:38
Let eac3to decode it.
I have found a (I think) strange 6.1 (7?) audio DTS from Ghost in the shell 2.0 BD.

mediainfo:
Audio #1
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : DTS ES XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Muxing mode : Stream extension
Codec ID : 134
Duration : 1 h 23 min
Bit rate mode : Variable / Constant / Constant
Bit rate : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s) : 7 channels / 7 channels / 6 channels
Channel layout : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless / Lossy / Lossy
Language : Italian
Source : 00009.m2ts

Audio #2
ID : 4353 (0x1101)
Menu ID : 1 (0x1)
Format : DTS ES XXCH XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Muxing mode : Stream extension
Codec ID : 134
Duration : 1 h 23 min
Bit rate mode : Variable / Constant / Constant
Bit rate : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s) : 7 channels / 7 channels / 6 channels
Channel layout : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossless / Lossy / Lossy
Language : Japanese
Source : 00009.m2ts

eac3to:

DTS Master Audio, 5.1 channels, 24 bits, 48kHz
(core: DTS-ES, 5.1 channels, 1509kbps, 48kHz)

DTS Master Audio, 6.1 channels, 16 bits, 48kHz
(core: DTS-ES, 6.1 channels, 1509kbps, 48kHz)
Can you suggest me the correct decoding channel parameters for them, in ffmpeg format?

SeeMoreDigital
30th May 2022, 17:43
I have found a (I think) rare 6.1 audio DTS from Ghost in the shell 2.0 BD.

mediainfo:
General
Complete name : F:\In\1_26 Ghost in the shell 2.0 (Dynit)\[jpn]6116.dts
Format : DTS ES XXCH XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
File size : 1.26 GiB
Overall bit rate mode : Variable / Constant / Constant

Audio
Format : DTS ES XXCH XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Bit rate mode : Variable / Constant / Constant
Bit rate : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s) : 7 channels / 7 channels / 6 channels
Channel layout : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossless / Lossy / Lossy

eac3to:

DTS Master Audio, 6.1 channels, 16 bits, 48kHz
(core: DTS-ES, 6.1 channels, 1509kbps, 48kHz)
Can you suggest me the correct decoding channel parameters for it, in ffmpeg format?
Have you extracted the lossy DTS-ES core from the lossless DTS-HD MA audio stream?

tormento
30th May 2022, 17:56
Have you extracted the lossy DTS-ES core from the lossless DTS-HD MA audio stream?
Nope, just demuxed the 2 streams from m2ts.

I think eac3to went nuts. :o

I forgot to say: I need the wave remapping (if any) to have the correct 6.1 (or whatever) DD+ TotalCode Studio (or Audition) encoding.

ffprobe gives me:
Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit)

Stream #0:0: Audio: dts (DTS-HD MA), 48000 Hz, 6.1, s16p

tebasuna51
31st May 2022, 19:48
You don't need nothing to remap for the first one 5.1

The second one (16 bits) is decoded to 6.1 (FL FR FC LFE BC SL SR) and if you want to encode to EAC3 6.1 (L,R,C,LFE,Ls,Rs,Cs) you must remap the BC in wav to the last position:

ffmpeg -i "[jpn]6116.dts" -filter_complex "pan=6.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c5|c5=c6|c6=c4" -acodec pcm_s16le "6.1_Channels_R.w64"

for Audition or, for TotalCode Studio with
-rf64 auto -acodec pcm_s16le "6.1_Channels_R.wav"

tormento
31st May 2022, 20:07
for Audition or, for TotalCode Studio with
-rf64 auto -acodec pcm_s16le "6.1_Channels_R.wav"
Thanks a lot.

I was literally waiting for your help :)

tebasuna51
1st June 2022, 12:56
DTS Master Audio, 5.1 channels, 24 bits, 48kHz
(core: DTS-ES, 5.1 channels, 1509kbps, 48kHz)


Seems the first one [ita] can be (DTS-ES) a matrixed 6.1, there are only 5.1 physical channels but maybe you can enable the EX flag when encode the 5.1 (without remap).

In Audition: BitStream Information -> Dolby Digital Surround EX mode -> Enabled
Maybe TotalCode Studio can set that flag also, I don't remember.

pcroland
5th June 2022, 19:34
I created a wrapper for DEE's DD, DDP and TrueHD encoder: Doom9 (https://forum.doom9.org/showthread.php?p=1969949), GitHub (https://github.com/pcroland/deew)

tormento
9th June 2022, 10:35
I created a wrapper for DEE's DD, DDP and TrueHD encoder
That is awesome.

I have tried and it works flawlessly.

tormento
11th June 2022, 09:13
@tebasuna51

I was thinking about using Dolby Reference Player to properly decode audio. Did you ever used it? I think it should be launched from CLI for the decoding part.

tebasuna51
11th June 2022, 09:31
I will test it but I don't have much time now.

Enverex
3rd August 2022, 14:11
My god, I can finally post.

Anyway, I got the Plex DDP encoder working standalone and creating 7.1 content. Everything works great and correct, except for ONE issue. It appears to be adding forced processing to the audio in some way - it sounds like dialogue enhancement or something. Every time there's audio in the center channel (typically dialogue) it abruptly ducks the volume of the surround speakers and unducks it the moment the center channel goes quiet again.

No dynamic compression, enhancement, etc is enabled on the listening end, so this effect seems like it's getting hard baked into the audio and is ruining what would otherwise be perfect 7.1 encodes.

Anyone know why this may be happening and how to stop EAE from doing it?

tebasuna51
4th August 2022, 09:10
... it sounds like dialogue enhancement or something. Every time there's audio in the center channel (typically dialogue) it abruptly ducks the volume of the surround speakers and unducks it the moment the center channel goes quiet again.
It is well know than Plex encoder add Dynamic Range Compression to the eac3 tracks, and I don't know how avoid that.

No dynamic compression, enhancement, etc is enabled on the listening end,
By default the decoders must obey the DRC info and the players must disable explicitly the DRC to avoid that effect.
What is the player used?

Balling
4th August 2022, 12:32
It is well know than Plex encoder add Dynamic Range Compression to the eac3 tracks, and I don't know how avoid that.


By default the decoders must obey the DRC info and the players must disable explicitly the DRC to avoid that effect.
What is the player used?

The way it is done in ffmpeg decoder itself is -drc_scale 0. You do not need to avoid that in encoding. See https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200201193443.22419-1-rcombs@rcombs.me/


Ffmpeg's encoder has never supported generating it.

pcroland
4th August 2022, 19:03
It is well know than Plex encoder add Dynamic Range Compression to the eac3 tracks, and I don't know how avoid that.


By default the decoders must obey the DRC info and the players must disable explicitly the DRC to avoid that effect.
What is the player used?

With DEE you can only choose from these DRC settings:
['film_light', 'film_standard', 'music_light', 'music_standard', 'speech']
You can't disable it in any way.

When it comes to dialnorm, you can set it between -31 and -1dB, and 0 will automatically calculate it (and you can't skip measrement even if you set it manually). You can also set a metering_mode and a speech_threshold for it, but they produce bit identical files no matter what you set these.

Balling
5th August 2022, 00:01
With DEE you can only choose from these DRC settings:
['film_light', 'film_standard', 'music_light', 'music_standard', 'speech']
You can't disable it in any way.

When it comes to dialnorm, you can set it between -31 and -1dB, and 0 will automatically calculate it (and you can't skip measrement even if you set it manually). You can also set a metering_mode and a speech_threshold for it, but they produce bit identical files no matter what you set these.

'You can't disable it in any way."

The whole point of DRC (not really dialnorm, that is separate) is that you can remove the compression if you do not care about your neighbours.

pcroland
5th August 2022, 06:46
I know you can disable it in other encoders but not with DEE for some reason.

tebasuna51
5th August 2022, 10:52
I know you can disable it in other encoders but not with DEE for some reason.
If DEE can't use the None preset at least use always the Music Light preset.
DRC six presets available to choose from, including None.

Music Light Music Standard Film Light Film Standard Speech
dB range (ratio) dB range (ratio) dB range (ratio) dB range (ratio) dB range (ratio)
---------- ------- ---------- ------- ---------- ------- ---------- ------- ---------- -------
Max Boost (fix): < -65 (12 dB) < -55 (12 dB) < -53 ( 6 dB) < -43 ( 6 dB) < -50 (15 dB)
Boost Range: -65 to -41 (2:1) -55 to -31 (2:1) -53 to -41 (2:1) -43 to -31 (2:1) -50 to -31 (2:1)
Null Band Width: -41 to -21 (1:1) -31 to -26 (1:1) -41 to -21 (1:1) -31 to -26 (1:1) -31 to -26 (1:1)
Early Cut Range: nothing -26 to -16 (2:1) -21 to -11 (2:1) -26 to -16 (2:1) -26 to -16 (2:1)
Cut Range: -21 to +9 (2:1) -16 to +4 (20:1) -11 to +4 (20:1) -16 to +4 (20:1) -16 to +4 (20:1)

Not problem with Max Boost below -65 dB, the big Null Band.
And without the ratio 20:1, the culprit of abrupt volume changes.

Balling
5th August 2022, 17:08
I know you can disable it in other encoders but not with DEE for some reason.

I was talking about decoder. You can disable it in a decoder. DRC is required to get good quality in AN ENCODER. FFmpeg not having it may be one of key reasons it perfoms bad for eac3.

Balling
5th August 2022, 17:14
If you encode flac to eac3 to get decoder close to flac you need to turn off DRC in the decoder. See this audacity patch, that uses ffmpeg and requires drc_scale 0. Last comment is mine: https://github.com/audacity/audacity/issues/631

Balling
5th August 2022, 18:13
Only lossless encodes (TrueHD, DTS-MA, FLAC,...) have a bitdepth

Lossy encodes don't have bitdepth. Decoders work internally in float format, eac3to can output until 64 bits float, but it is enough 24 bits int (human ear can difference only to 20 bits).





TrueHD is always 24 bit, it does not have a bitdepth by your definition. Flac can be even 8 bit.

SeeMoreDigital
5th August 2022, 20:20
TrueHD is always 24 bit, it does not have a bitdepth by your definition. A fair amount has been padded from 16 to 24-bit!

Flac can be even 8 bit.Maybe, but only if the source was 8-bit.... But who would do that? Certainly no commercial provider!

tebasuna51
6th August 2022, 00:44
... DRC is required to get good quality in AN ENCODER. FFmpeg not having it may be one of key reasons it perfoms bad for eac3.
The metadata DRC can help for old and slow decoders, but with modern and fast decoders the metadata in DD encodes aren't needed at all.
There are filters like 'night mode' than can do the job on the fly over any codec.
For that ffmpeg not need at all create those unnecesary DRC metadata.

Balling
7th August 2022, 16:17
A fair amount has been padded from 16 to 24-bit!

Maybe, but only if the source was 8-bit.... But who would do that? Certainly no commercial provider!

Yes, but there is no way to tell that before decoding, okay? The metadata is not there, which means you should decode always to 24 bits. The variant of TrueHD called MLP does have such metadata.

pcroland
11th August 2022, 01:09
If DEE can't use the None preset at least use always the Music Light preset.
Changed the default DRC to music_light in deew, thanks for the info.
deew 2.6.0:
- changed default DRC to music_light, which is closer to the missing
none preset: https://forum.doom9.org/showpost.php?p=1972689&postcount=136
- fixed DRC option not being applied for stereo TrueHD encodes
- colorized argparse's help a little bit
- renamed -t/--threads to -in/--instances to be more accurate,
since one DEE instance can use 2 threads. see -h for more info
I'm thinking about implementing the none preset with a binary edit. Do you know which bits should be replaced with what? If i recall correctly you have to do that for every frame, right?

tebasuna51
12th August 2022, 11:31
...
I'm thinking about implementing the none preset with a binary edit. Do you know which bits should be replaced with what? If i recall correctly you have to do that for every frame, right?
Read the E/AC3 syntax here (https://web.archive.org/web/20110626050743/http://www.atsc.org/cms/standards/a_52-2010.pdf)

Each frame have 6 Audio Blocks (point 5.2 in pdf) and for each Audio Block there are the DRC values (7.7): "The bit code of ‘0000 0000’ indicates 0 dB (unity) gain"

You must replace by 0's in each Audio Block in each audio frame, the problem is locate these bits. You must know the size of bsi (5.3) and the audblk syntax (5.4.3)

pcroland
12th August 2022, 14:21
So it's not that easy to implement. Do you know a working tool for it by any chance?

tebasuna51
14th August 2022, 09:32
No, sorry.

BuccoBruce
16th August 2022, 00:05
Yes, the sample I created in that post was using the "audiotool" I wrote here (https://github.com/ymgenesis/AudioTool). The command would be the same as I quoted in the Plex forum post. I don't believe an internet connection is needed. On Mac, it requires the structure from here (https://github.com/ymgenesis/AudioTool#dependencies-and-folder-structure). Variables for the Codecs and Encoder folder need to be set properly (folder with dylibs, probably dlls in Windows, and the Plex Transcoder executable). It needs EasyAudioEncoder executable and the license file. This license file is the permission file to be able to use EasyAudioEncoder executable, so I don't think an internet connection is needed. Keep in mind all these resources (including EasyAudioEncoder and its license file) are insalled when installing Plex. They get updated every once and a while when Plex updates. EasyAudioEncoder must be running for the encode to work, as you can see I execute EasyAudioEncoder first in the background here (https://github.com/ymgenesis/AudioTool/blob/904d3f56abd13e01857a686deb611a0ef8103e8f/audiotool.sh#L329) before executing the Plex Transcoder executable here (https://github.com/ymgenesis/AudioTool/blob/904d3f56abd13e01857a686deb611a0ef8103e8f/audiotool.sh#L331) a couple lines later. Of course, this is Unix.

Sorry I can't be more help with Windows. The process isn't exactly clean, as it requires the proper environment variables, and needs a running EasyAudioEncoder instance before executing the Plex Transcoder (ffmpeg) command.

And as I mentioned before, I paid for Plex Pass, which may have allowed me EasyAudioEncoder for 7.1 transcoding when playing on Plex (existence of EasyAudioEncoder and license file). BUT, I don't know that 100%, I actually suspect it is included with the free version. So, if someone wants to try, they can sign up for a free Plex account at plex.tv and download my sample from here (https://www.mediafire.com/file/sicv8mizm2tsnov/sample.mkv/file) (same sample as on the Plex forums), add it to your server once setup, and see if it'll transcode the first audio track (TrueHD) to EAC3 7.1 when playing back on your 7.1-capable TV/box & AV setup. If it does, EasyAudioEncoder exists and can be used in a manner like my "audiotool".

If you can explain which environment variables EAE/Plex Transcoder actually require, and what conditions they need in order to avoid halting them midway through, I can re-write this properly to work under Windows.

I don't understand enough about how .sh scripts work to properly re-write it for Windows (bc I don't know what it's doing most of the time) but I was able to somewhat successfully run this under msys2 in Windows with some re-writes. The access to out.txt is still throwing "safe_fopen: CreateFileW failed: 2" errors, but it does seem to work. With the "| tee" to out.txt still included in the thd/dts functions, it was halting the encode after a few seconds (a few minutes of output). Without them, it finishes the encode, although the time-left function is now buggered.

frame= 0 fps=0.0 q=-1.0 size= 285755kB time=00:05:52.67 bitrate=6637.6kbits/
safe_fopen: CreateFileW failed: 2
safe_fopen: CreateFileW failed: 2
safe_fopen: CreateFileW failed: 2
frame= 0 fps=0.0 q=-1.0 Lsize= 296962kB time=00:05:53.69 bitrate=6878.0kbits/s speed=4.94x

Terminating EasyAudioEncoder...
Terminated

https://pastebin.com/LDPXXmm2

Required ??? folder structure:
\\AudioTool\audiotool.sh
\\AudioTool\audiotool.win.sh
\\AudioTool\Codecs\367b3d4-3654-windows-x86\aac_decoder.dll
snip
\\AudioTool\Codecs\367b3d4-3654-windows-x86\wmv3_decoder.dll
\\AudioTool\Codecs\ffmpeg.exe
\\AudioTool\Codecs\ffprobe.exe
\\AudioTool\Encoder\eae-license.txt
\\AudioTool\Encoder\EasyAudioEncoder.exe
\\AudioTool\Encoder\ffmpeg.exe
\\AudioTool\Encoder\ffprobe.exe
\\AudioTool\Encoder\Windows\avcodec-58.dll
\\AudioTool\Encoder\Windows\avfilter-7.dll
\\AudioTool\Encoder\Windows\avformat-58.dll
\\AudioTool\Encoder\Windows\avutil-56.dll
\\AudioTool\Encoder\Windows\cyggcc_s-1.dll
\\AudioTool\Encoder\Windows\cygwin1.dll
\\AudioTool\Encoder\Windows\fmt.dll
\\AudioTool\Encoder\Windows\Plex Transcoder.exe
\\AudioTool\Encoder\Windows\swresample-3.dll
\\AudioTool\Encoder\Windows\swscale-5.dll
\\AudioTool\ffmpeg.exe
\\AudioTool\ffprobe.exe
\\AudioTool\README.md


ffmpeg/ffprobe are in every folder because with ffprobe only in \AudioTool, msys couldn't find it, even though .\ffprobe.exe outside of the script was working. They don't come with ffmpeg, I used statically compiled ones separately.

BuccoBruce
16th August 2022, 02:21
PSA to anyone using Plex Transcoder/EasyAudioEncoder - Plex's ffmpeg implementation / DCA decoder are not decoding DTS-HD MA 7.1. If I were a betting man, I would bet they're decoding the core DTS 5.1 audio. I can double check to confirm with a "known" decode of the core DTS track using eac3to and then comparing the PCM data, but given that EAE seems to be applying some unwanted DRC, I doubt I'll bother. My university copy of Audition 2015.2 still seems to work even though it complains about a serial number.

Q:\AudioTool\Encoder\Windows>"Plex Transcoder.exe" -c:v:0 h264 -c:a:0 dca -noaccurate_seek -analyzeduration 20000000 -probesize 20000000 -i "Q:\AudioTool\Hawaiian.Vacation.2011.mkv" -c:a pcm_s24le -vn -sn -avoid_negative_ts disabled -hide_banner -start_at_zero -stats -v debug "Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv"
Splitting the commandline.
Reading option '-c:v:0' ... matched as option 'c' (codec name) with argument 'h264'.
Reading option '-c:a:0' ... matched as option 'c' (codec name) with argument 'dca'.
Reading option '-noaccurate_seek' ...Rescanning for external libs: 'Q:/AudioTool/Codecs/367b3d4-3654-windows-x86/'
Loading external lib Q
Error loading external lib: The specified module could not be found.
Loading external lib /AudioTool/Codecs/367b3d4-3654-windows-x86/aac_decoder.dll
/snip/
Loading external lib /AudioTool/Codecs/367b3d4-3654-windows-x86/wmv3_decoder.dll
matched as option 'accurate_seek' (enable/disable accurate seeking with -ss) with argument 0.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '20000000'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument '20000000'.
Reading option '-i' ... matched as input url with argument 'Q:\AudioTool\Hawaiian.Vacation.2011.mkv'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'pcm_s24le'.
Reading option '-vn' ... matched as option 'vn' (disable video) with argument '1'.
Reading option '-sn' ... matched as option 'sn' (disable subtitle) with argument '1'.
Reading option '-avoid_negative_ts' ... matched as AVOption 'avoid_negative_ts' with argument 'disabled'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-start_at_zero' ... matched as option 'start_at_zero' (shift input timestamps to start at 0 when using copyts) with argument '1'.
Reading option '-stats' ... matched as option 'stats' (print progress report during encoding) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option 'Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Applying option start_at_zero (shift input timestamps to start at 0 when using copyts) with argument 1.
Applying option stats (print progress report during encoding) with argument 1.
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url Q:\AudioTool\Hawaiian.Vacation.2011.mkv.
Applying option c:v:0 (codec name) with argument h264.
Applying option c:a:0 (codec name) with argument dca.
Applying option noaccurate_seek (enable/disable accurate seeking with -ss) with argument 0.
Successfully parsed a group of options.
Opening an input file: Q:\AudioTool\Hawaiian.Vacation.2011.mkv.
[NULL @ 0081ec00] Opening 'Q:\AudioTool\Hawaiian.Vacation.2011.mkv' for reading
[file @ 00812cc0] Setting default whitelist 'file,crypto'
[matroska,webm @ 0081ec00] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
st:2 removing common factor 1000000 from timebase
st:3 removing common factor 1000000 from timebase
st:4 removing common factor 1000000 from timebase
st:5 removing common factor 1000000 from timebase
[matroska,webm @ 0081ec00] Before avformat_find_stream_info() pos: 6676 bytes read:35388 seeks:2 nb_streams:6
[h264 @ 00827100] nal_unit_type: 7(SPS), nal_ref_idc: 3
snip
[h264 @ 00827100] ct_type:0 pic_struct:0
Last message repeated 1 times
[matroska,webm @ 0081ec00] All info found
[matroska,webm @ 0081ec00] After avformat_find_stream_info() pos: 1476424 bytes read:1505136 seeks:2 frames:163
Input #0, matroska,webm, from 'Q:\AudioTool\Hawaiian.Vacation.2011.mkv':
Metadata:
title : Hawaiian Vacation (2011)
encoder : libebml v1.3.0 + libmatroska v1.4.1
creation_time : 2014-08-18T18:18:23.000000Z
Duration: 00:05:53.73, start: 0.000000, bitrate: 30402 kb/s
Chapter #0:0: start 0.000000, end 161.453000
Metadata:
title : 00:00:00.000
Chapter #0:1: start 161.453000, end 248.832000
Metadata:
title : 00:02:41.453
Chapter #0:2: start 248.832000, end 353.728000
Metadata:
title : 00:04:08.832
Stream #0:0, 25, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088) blah blah
Metadata:
title : MPEG-4 AVC Video / 24884 kbps / 1080p / 23,976 fps / 16:9 / High Profile 4.1
BPS : 24664310
BPS-eng : 24664310
DURATION : 00:05:53.687000000
snip
Stream #0:1(eng), 102, 1/1000: Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit), 1536 kb/s (default)
Metadata:
title : English / DTS-HD Master Audio / 7.1 / 48 kHz / 5370 kbps / 24-bit (DTS Core: 5.1 / 48 kHz / 1509 kbps / 24-bit)
BPS : 5372315
BPS-eng : 5372315
DURATION : 00:05:53.696000000
snip
Stream #0:2(eng), 33, 1/1000: Audio: ac3, 48000 Hz, stereo, s16p, 320 kb/s
Metadata:
title : Commentary / Dolby Digital Audio / 2.0 / 48 kHz / 320 kbps
snip
Stream #0:3(eng), 2, 1/1000: Subtitle: hdmv_pgs_subtitle, 1920x1080
blah blah blah more subtitles
Successfully opened the file.
Parsing a group of options: output url Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv.
Applying option c:a (codec name) with argument pcm_s24le.
Applying option vn (disable video) with argument 1.
Applying option sn (disable subtitle) with argument 1.
Successfully parsed a group of options.
Opening an output file: Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv.
File 'Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv' already exists. Overwrite ? [y/N] y
[file @ 038e06c0] Setting default whitelist 'file,crypto'
Successfully opened the file.
Stream mapping:
Stream #0:1 -> #0:0 (dts (dca) -> pcm_s24le (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
detected 24 logical cores
[graph_0_in_0_1 @ 0083e340] Setting 'time_base' to value '1/48000'
[graph_0_in_0_1 @ 0083e340] Setting 'sample_rate' to value '48000'
[graph_0_in_0_1 @ 0083e340] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_1 @ 0083e340] Setting 'channel_layout' to value '0x60f'
[graph_0_in_0_1 @ 0083e340] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_0 @ 0083e600] Setting 'sample_fmts' to value 's32'
[auto_resampler_0 @ 0083d980] Setting 'output_sample_bits' to value '24'
[format_out_0_0 @ 0083e600] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0397ffc0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 0083d980] [SWR @ 02d7a340] Using fltp internally between filters
[auto_resampler_0 @ 0083d980] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:s32 r:48000Hz
Output #0, matroska, to 'Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv':
Metadata:
blah blah
Stream #0:0(eng), 0, 1/1000: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 5.1(side), s32, 6912 kb/s (default)
Metadata:
blah

I noticed when I ran the same AudioEncoder.sh script with -v debug:

"Plex Transcoder.exe" -c:v:0 h264 -c:a:0 dca -noaccurate_seek -analyzeduration 20000000 -probesize 20000000 -i "Q:\AudioTool\Hawaiian.Vacation.2011.mkv" -filter_complex "[0:a:0] aresample=async=1:ocl='7.1':rematrix_maxval=60.000000dB:osr=48000[0]" -map [0] -metadata:s:a title="EAC3 7.1 from DTS" -metadata:s:a language=eng -c:a eac3_eae -b:a 1280k -vn -sn -avoid_negative_ts disabled -hide_banner -start_at_zero -stats -v debug "Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv"
[file @ 03921640] Setting default whitelist 'file,crypto'
Successfully opened the file.
Stream mapping:
Stream #0:1 (dca) -> aresample
aresample -> Stream #0:0 (eac3_eae)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
detected 24 logical cores
[Parsed_aresample_0 @ 02781880] Setting 'async' to value '1'
[Parsed_aresample_0 @ 02781880] Setting 'ocl' to value '7.1'
[Parsed_aresample_0 @ 02781880] Setting 'rematrix_maxval' to value '60.000000dB'
[Parsed_aresample_0 @ 02781880] Setting 'osr' to value '48000'
[graph_0_in_0_1 @ 027819c0] Setting 'time_base' to value '1/48000'
[graph_0_in_0_1 @ 027819c0] Setting 'sample_rate' to value '48000'
[graph_0_in_0_1 @ 027819c0] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_1 @ 027819c0] Setting 'channel_layout' to value '0x60f'
[graph_0_in_0_1 @ 027819c0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_0 @ 02781700] Setting 'sample_fmts' to value 'flt|s16'
[format_out_0_0 @ 02781700] Setting 'sample_rates' to value '48000'
[format_out_0_0 @ 02781700] Setting 'channel_layouts' to value '0x60f|0x63f'
[AVFilterGraph @ 039edfc0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[Parsed_aresample_0 @ 02781880] picking flt out of 2 ref:fltp
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] Using fltp internally between filters
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] Matrix coefficients:
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] FL: FL:1.000000 FR:0.000000 FC:0.000000 LFE:0.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] FR: FL:0.000000 FR:1.000000 FC:0.000000 LFE:0.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] FC: FL:0.000000 FR:0.000000 FC:1.000000 LFE:0.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] LFE: FL:0.000000 FR:0.000000 FC:0.000000 LFE:1.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] BL: FL:0.000000 FR:0.000000 FC:0.000000 LFE:0.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] BR: FL:0.000000 FR:0.000000 FC:0.000000 LFE:0.000000 SL:0.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] SL: FL:0.000000 FR:0.000000 FC:0.000000 LFE:0.000000 SL:1.000000 SR:0.000000
[Parsed_aresample_0 @ 02781880] [SWR @ 02de9fc0] SR: FL:0.000000 FR:0.000000 FC:0.000000 LFE:0.000000 SL:0.000000 SR:1.000000
[Parsed_aresample_0 @ 02781880] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:8 chl:7.1 fmt:flt r:48000Hz
Output #0, matroska, to 'Q:\AudioTool\Hawaiian.Vacation.2011.out.mkv':

If I add icl='7.1' and try to decode to PCM, it still only detects 5.1
Stream mapping:
Stream #0:1 (dca) -> aresample
aresample -> Stream #0:0 (pcm_s24le)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
detected 24 logical cores
[Parsed_aresample_0 @ 026f9900] Setting 'async' to value '1'
[Parsed_aresample_0 @ 026f9900] Setting 'icl' to value '7.1'
[Parsed_aresample_0 @ 026f9900] Setting 'rematrix_maxval' to value '60.000000dB'
[Parsed_aresample_0 @ 026f9900] Setting 'osr' to value '48000'
[graph_0_in_0_1 @ 026fa240] Setting 'time_base' to value '1/48000'
[graph_0_in_0_1 @ 026fa240] Setting 'sample_rate' to value '48000'
[graph_0_in_0_1 @ 026fa240] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_1 @ 026fa240] Setting 'channel_layout' to value '0x60f'
[graph_0_in_0_1 @ 026fa240] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_0 @ 026fa100] Setting 'sample_fmts' to value 's32'
[AVFilterGraph @ 03950b40] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[Parsed_aresample_0 @ 026f9900] [SWR @ 02d4a300] Using fltp internally between filters
[Parsed_aresample_0 @ 026f9900] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:s32 r:48000Hz

And the ffmpeg binary Plex built from is ancient:
Q:\AudioTool\Encoder\Windows>"Plex Transcoder.exe" -codecs
ffmpeg version 1.6-367b3d4c85-1 Copyright (c) 2000-2019 the FFmpeg developers
D.A.LS dts DCA (DTS Coherent Acoustics) (decoders: dca )
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 52.100 / 58. 52.100
libavformat 58. 27.104 / 58. 27.104
libavfilter 7. 49.100 / 7. 49.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100

It's loading its DTS decoder externally from "dca_decoder.dll" in the codecs folder. It's probably worth mentioning that I am deliberately using an old as hell Plex version, because I got sick of them breaking AMD hardware transcoding...

Yes, the sample I created in that post was using the "audiotool" I wrote here (https://github.com/ymgenesis/AudioTool).

I'm not sure if your aresample filtergraph is necessary? I might try it with a 7.1 pcm_s24le source later, but I may not bother. If your installation of Plex is up to date, double check that the transcoder is actually decoding DTS-HD MA in 7.1.

I almost have this running under Windows natively, but it halts on:
[eac3_eae @ 02764cc0] got broken frame from EAE
Audio encoding failed

These were the environment variables I had to change. If you're on Windows and you don't want to risk this stuff persisting afterwards, just run "SETLOCAL" first in cmd.exe

SETLOCAL
SET EAE_ROOT=Q:\AudioTool\Encoder
SET FFMPEG_EXTERNAL_LIBS=Q:/AudioTool/Codecs/367b3d4-3654-windows-x86/
SET X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx

EAE itself is in another cmd window spitting out endless errors just like it did in msys2, but the encode actually worked from there.
Q:\AudioTool\Encoder>EasyAudioEncoder.exe
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.
safe_fopen: CreateFileW failed: 2
safe_fopen: CreateFileW failed: 2
safe_fopen: CreateFileW failed: 2 ad infinitum

BuccoBruce
16th August 2022, 02:32
It's loading its DTS decoder externally from "dca_decoder.dll" in the codecs folder. It's probably worth mentioning that I am deliberately using an old as hell Plex version, because I got sick of them breaking AMD hardware transcoding...

I'm not sure if your aresample filtergraph is necessary? I might try it with a 7.1 pcm_s24le source later, but I may not bother. If your installation of Plex is up to date, double check that the transcoder is actually decoding DTS-HD MA in 7.1.


For what it's worth, I did not find any meaningful change log entries for DTS decoding, 7.1 channels, etc. between my currently installed version of PMS and their latest release https://forums.plex.tv/t/plex-media-server/30447/ DTS isn't mentioned after July of 2019. https://files.catbox.moe/v715bz.png emphasis mine :scared:

Perhaps they should focus on basic A/V functionality, like AV1 support and proper DTS-HD MA decoding, before they add more u$ele$$ feature$ like TIDAL, vidja, and "free" shovelware from the media conglomerates ;) :D wish I'd never paid them a dime...

BuccoBruce
16th August 2022, 03:45
Yep. It's only decoding the core. I found a creative way to "force" a test,


Get vuvuzela sounds
Get a 5.1 source
Mix the vuvuzelas in as Lsr/Rsr
Invert the vuvuzelas, add them to the pre-existing audio for Lss/Rss
Confirm your 5.1 downmix settings have both Lss/Lsr at 0 dB for the Ls downmix and Rss/Rsr 0dB for Rs downmix. The opposite rear surround should be set to -INF. Do not invert anything, you've already done so in your cursed source audio. This dictates how the DTS Core stream is created as well!
?
Profit


https://files.catbox.moe/meaped.png

https://files.catbox.moe/8s2el9.png

It goes without saying that there are vuvuzelas on this, so turn your speakers down:

DIDNEYWORL.mkv (https://mega.nz/file/DjJkGbBA#4i4wjY_rf4WuiK1NuAnq-1_6mSAexXvpwqVejesDxxM)


DTS-HD MA 7.1 - "Cursed Castle" feat. Vuvuzelas
Extracted DTS Core - Side/Rear Vuvuzelas Canceled Out!
Plex/EAE E-AC-3 - No Vuvuzelas!
eac3to.exe DIDNEYVOOVINVF.dtshd DIDNEYVOOVINVF.dtshd_.flac
eac3to -0,1,2,3,6,7,4,5 FLAC -> E-AC-3 (Adobe Audition 2015.2) = BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ


Audio #1

ID : 2
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 15s 595ms
Bit rate mode : VBR
Bit rate : 4433 Kbps
Channel(s) : 8 channel
Channel layout : C L R LFE Lb Rb Lss Rss
Sampling rate : 48.0 KHz
Frame rate : 93.750 fps (512 SPF)
Bit depth : 24 bit
Compression mode : Lossless
Stream size : 8.24 MiB (28%)
Title : Inverted Vuvuzela Test
Language : English
Default : Yes
Forced : No

Audio #2

ID : 3
Format : DTS
Format/Info : Digital Theater Systems
Codec ID : A_DTS
Duration : 15s 595ms
Bit rate mode : CBR
Bit rate : 1509 Kbps
Channel(s) : 6 channel
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 KHz
Frame rate : 93.750 fps (512 SPF)
Compression mode : Lossy
Stream size : 2.81 MiB (10%)
Title : Extracted DTS Core
Language : English
Default : Yes
Forced : No

Audio #3

ID : 4
Format : E-AC-3
Format/Info : Enhanced AC-3
Commercial name : Dolby Digital Plus
Codec ID : A_EAC3
Duration : 15s 616ms
Bit rate mode : CBR
Bit rate : 1024 Kbps
Channel(s) : 8 channel
Channel layout : L R C LFE Ls Rs Lb Rb
Sampling rate : 48.0 KHz
Frame rate : 31.250 fps (1536 SPF)
Bit depth : 32 bit
Compression mode : Lossy
Stream size : 1.91 MiB (7%)
Title : EAC3 7.1 from DTS (Plex/EAE)
Language : English
Service kind : Complete Main
Default : Yes
Forced : No

Audio #4

ID : 5
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 15s 595ms
Bit rate mode : VBR
Bit rate : 5416 Kbps
Channel(s) : 8 channel
Channel layout : L R C LFE Lb Rb Ls Rs
Sampling rate : 48.0 KHz
Frame rate : 11.735 fps (4090 SPF)
Bit depth : 24 bit
Compression mode : Lossless
Stream size : 10.1 MiB (35%)
Title : eac3to.exe DIDNEYVOOVINVF.dtshd DIDNEYVOOVINVF.dtshd_.flac -progressnumbers -log=UsEac3To.log
Writing library : libFLAC 1.2.1 (UTC 2007-09-17)
Language : English
Default : Yes
Forced : No

Audio #5

ID : 6
Format : E-AC-3
Format/Info : Enhanced AC-3
Commercial name : Dolby Digital Plus
Codec ID : A_EAC3
Duration : 15s 648ms
Bit rate mode : CBR
Bit rate : 1024 Kbps
Channel(s) : 8 channel
Channel layout : L R C LFE Ls Rs Lb Rb
Sampling rate : 48.0 KHz
Frame rate : 31.250 fps (1536 SPF)
Compression mode : Lossy
Stream size : 1.91 MiB (7%)
Title : eac3to -0,1,2,3,6,7,4,5 FLAC -> E-AC-3 (Adobe Audition 2015.2)
Language : English
Service kind : Complete Main
Default : Yes
Forced : No

tebasuna51
16th August 2022, 09:37
Yep. It's only decoding the core. I found a creative way to "force" a test,

The easy way to test encoders/decoders/players is use a channel_test like I upload here (https://forum.doom9.org/showthread.php?p=1963170#post1963170)

1) Decode it to wav/wavs (w64 not needed because it is short)
2) Encode it to codec to test
3) Decode it with the decoder to test and see (*) the output in an audio editor or listen it in the player to test

(*) The order and images must be like:

SeeMoreDigital
16th August 2022, 12:51
Perhaps the DTS talk should be split off into its own topic...

Balling
16th August 2022, 19:49
The only reencoder that can preserve Atmos when going from TrueHD to eac3 is in LG TVs. Would be interesting to get that.

pcroland
17th August 2022, 09:05
The only reencoder that can preserve Atmos when going from TrueHD to eac3 is in LG TVs. Would be interesting to get that.
It's not the only one. I'm planning to implement it to deew. DEE can encode DDP Atmos but you have to use DRP (Dolby Reference Player) for decoding.

Enverex
17th August 2022, 14:34
It is well know than Plex encoder add Dynamic Range Compression to the eac3 tracks, and I don't know how avoid that.

By default the decoders must obey the DRC info and the players must disable explicitly the DRC to avoid that effect.
What is the player used?

I've tried both VLC, MPC and WMF via Windows Media Player.

Shame about Plex's encoder doing the weird DRC effect though, it's the ONE thing stopping me being able to create perfect results in the project I was working on. If anyone's actually able to figure out why it's doing that and how to stop it, I'd be eternally grateful.

Regarding the DTS decoding issues, the Plex encoder is ancient so I transcode to FLAC then let EAE convert it to EAC3 to avoid issues like the DTS one you're hitting here. It doesn't even support MP3!

tebasuna51
17th August 2022, 21:39
I've tried both VLC, MPC...

In both you need disable the DRC like the images, but if the E/AC3 is sended passtrough by SPDIF/HDMI to your AVR, is the AVR who needs be disabled.

BuccoBruce
18th August 2022, 02:06
Perhaps the DTS talk should be split off into its own topic...

I've tried both VLC, MPC and WMF via Windows Media Player.

Shame about Plex's encoder doing the weird DRC effect though, it's the ONE thing stopping me being able to create perfect results in the project I was working on. If anyone's actually able to figure out why it's doing that and how to stop it, I'd be eternally grateful.

Regarding the DTS decoding issues, the Plex encoder is ancient so I transcode to FLAC then let EAE convert it to EAC3 to avoid issues like the DTS one you're hitting here. It doesn't even support MP3!

Sorry, I got a little carried away. There's no need for that, since a. DCA can't do 7.1 anyways b. encoding DTS-ES or DTS-HD MA isn't as walled off as E-AC-3 or THD.

But uh, yeah, Plex devs confirmed that they do not decode anything other than DCA 5.1 core audio from any DTS streams (for legal reasons? of all things...) so it is still worth noting as a PSA for anyone using EAE to encode E-AC-3. Like you mentioned, you can still get around it by just feeding it 7.1 FLAC or PCM instead.

It doesn't even support MP3!

Plex's transcoder is fucking weird. They --disable-decoders when they compile ffmpeg and then use external libraries for everything.

The easy way to test encoders/decoders/players is use a channel_test like I upload here (https://forum.doom9.org/showthread.php?p=1963170#post1963170)

1) Decode it to wav/wavs (w64 not needed because it is short)
2) Encode it to codec to test
3) Decode it with the decoder to test and see (*) the output in an audio editor or listen it in the player to test

(*) The order and images must be like:

I could've just used Fraunhofer's 7.1 AAC channel test since i have that one saved, but where is the fun in that? The vuvuzela clip makes a statement!

Balling
19th August 2022, 04:59
BTW, wanted to paste docx (ETSI insider) documentaion of EAC3. It is very nice, docx from which public pdf was done. https://www.upload.ee/files/14428160/ea3specdocx.zip.html

Balling
19th August 2022, 07:44
tried the same with my plexserver and get this:


C:\Program Files (x86)\Plex\Plex Media Server\Plex Transcoder.exe" -i "C:\tmp\cut.mkv" -map v:0 -map a:0 -c:v copy -c:a:0 eac3_eae -b:a:0 1280k plex_convert.mkv

[truehd_eae @ 02a6f400] No EAE watchfolder set!
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (truehd (truehd_eae) -> eac3 (eac3_eae))
Error while opening decoder for input stream #0:1 : Generic error in an external library

ideas?

As you can see from its source code https://github.com/Diagonactic/plex-new-transcoder/blob/3cf85fd34bfa94f679ca934ebf9e2a31ff0bb0eb/plex-ffmpeg-source/NewPlexTranscoder/libavcodec/eae.c#L235

you need to SET EAE_ROOT to something like your user folder and create 8 folders there (it will not do mkdir for you). After that you need to lauch EasyAudioEncoder.exe and it must see its license file (key, that is, not GPL 2.0 license text) online keygen from plex itself is here: https://github.com/pabloromeo/clusterplex/issues/125#issuecomment-1216753569

After you got the .exe or ELF file, you should launch it, after that transcoder.exe will work like ffmpeg.exe.

Balling
19th August 2022, 09:43
"And as I mentioned before, I paid for Plex Pass, which may have allowed me EasyAudioEncoder for 7.1 transcoding when playing on Plex (existence of EasyAudioEncoder and license file). BUT, I don't know that 100%, I actually suspect it is included with the free version"

It is not included, no, but you can just download it on the direct link (do not forget to activate it) or open any sdr video with .thd inside for plex do it for you.


E.g. (do not forget to apt-get install xq):

└─# curl -s "https://plex.tv/api/codecs/easyaudioencoder?build=windows-x86_64-standard&deviceId=c34abbdd-77d6-4fcf-8e9d-3a86d1b98f4f&oldestPreviousVersion=1%2E28%2E0%2E5999-97678ded3&version=1785" | xq
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer friendlyName="myPlex" identifier="com.plexapp.plugins.myplex" title="Codec Downloads" codec="easyaudioencoder" version="1785" size="1">
<Codec url="https://downloads.plex.tv/codecs/1785/windows-x86_64-standard/EasyAudioEncoder-windows-x86_64-standard.zip" fileSha="f5433e0e4e487b90018dcffabe0bf9d5a9e3148b" fileSha256="59a4ccc00c4d7742f0da2535d55628330c7a3d89bac8c7d8c8c1df0aed6600b4" fileName="EasyAudioEncoder-windows-x86_64-standard.zip" build="windows-x86_64-standard" license="1663058784 4475d0cda9afb4c554efedb263f4e808a0b6f2c0a00ea2ef40279e548fe4 8c82bc73403f1f0c12b69eb598e70189cbf064153afa88e0f6a1b6512365f78c"/>
</MediaContainer>

Put license key above to eae-license.txt in the same folder.

Enverex
22nd August 2022, 17:29
In both you need disable the DRC like the images, but if the E/AC3 is sended passtrough by SPDIF/HDMI to your AVR, is the AVR who needs be disabled.

This was the first thing I tried when I initially ran into the problem, it made no difference as though the volume was actually changing in the audio stream, not a DRC issue.

This also wouldn't work even if it was the issue as I obviously can't have everyone disable DRC...

Balling
22nd August 2022, 20:03
Anyway, could not help myself changing two bytes in EAE.exe in IDA pro 7.7. https://github.com/pabloromeo/clusterplex/files/9396885/EasyAudioEncoder.zip

BTW, priming samples in eac3 of Mediaconcept SFK in eae.exe is ~1760 samples compared to 256 in ffmpeg. And of course mp4 container is not fixing priming in editlist's media time (just set to 0). Not cool.

Also, it can correctly do fully packed 24 bit TrueHD in all cases (https://trac.ffmpeg.org/ticket/5054) and it can even decode mono truehd correctly, our decoder in ffmpeg when it was not broken was not lossless apparently (https://trac.ffmpeg.org/ticket/1726#comment:7).

Who can compare Audiotion 2017 and Plex? I can do, I have both now!

Balling
24th August 2022, 16:51
Apparently mlp decoder in ffmpeg is not lossless compared to what EAE.exe gives!!! (That was on DVD, Blu-ray uses TrueHD.) https://trac.ffmpeg.org/ticket/4786#comment:4

Just like mono TrueHD.

Also it applies DRC by default for some TrueHD!! So it also makes it lossy. Wow.

Channels in wav are all in correct place, though.

Balling
25th August 2022, 17:34
Who knows how to delete thd DRC? It is really crazy that lossless format has such metadata. It is one thing to apply DR and Gain...

richardpl
25th August 2022, 21:24
Stop spreading your nonsense misinformation.

speedy
28th August 2022, 06:32
Should I be able to use pcroland/deew these days instead of ymgenesis/audiotool for TrueHD 7.1 to EAC3 7.1 conversion?

How about for the following as well?
1) TrueHD 5.1 to EAC3 5.1
2) DTS XLL 7.1 to EAC3 7.1
3) DTS XLL 5.1 to EAC3 5.1
4) TrueHD Atmos to EAC3 Atmos

Thanks!

pcroland
29th August 2022, 18:56
ymgenesis/audiotool uses ffmpeg, which is way worse than using a Dolby certified encoder like DEE (that deew uses).

richardpl
29th August 2022, 22:24
pcroland's "software" uses certified software illegally. Breaking Dolby's company intellectual property rights and never asked permission to use Dolby utility, not even asked Plex for permission to write this so called wrapper.

rwill
30th August 2022, 04:08
pcroland's "software" uses certified software illegally. Breaking Dolby's company intellectual property rights and never asked permission to use Dolby utility, not even asked Plex for permission to write this so called wrapper.

Can you please elaborate further ?

--
I post on my own and not in the name of the company I work for.

pcroland
30th August 2022, 08:04
pcroland's "software" uses certified software illegally. Breaking Dolby's company intellectual property rights and never asked permission to use Dolby utility, not even asked Plex for permission to write this so called wrapper.
It's not included in deew and it has nothing to do with Plex. Have you even looked at the repo? You shouldn't say bullshit like that if you have no clue what you talk about.

Balling
31st August 2022, 09:19
pcroland's "software" uses certified software illegally. Breaking Dolby's company intellectual property rights and never asked permission to use Dolby utility, not even asked Plex for permission to write this so called wrapper.

You are not a laywer, are you? Because a) it does not use Plex, it uses DEE that is 400$USD, b) it is not illegal to automate licensed Plex EAE.exe and it is not illegal to use ffmpeg (Plex Transcoder.exe) to use EAE.exe.

And anyway, unless it is commercial, there is no way to prosecute endusers for that, there is almost no precedent.

Enverex
31st August 2022, 18:06
pcroland's "software" uses certified software illegally. Breaking Dolby's company intellectual property rights and never asked permission to use Dolby utility, not even asked Plex for permission to write this so called wrapper.

I don't remember anyone asking you. Also they aren't distributing the DD encoder OR EAE, so what are you talking about? Please don't derail this thread with this garbage, it's very important to some of us.

Balling
1st September 2022, 20:40
Atmos open source decoder (EAC3 only for now), Paul, please implement this (Huffman tables are on ETSI side):

https://github.com/VoidXH/Cavern/blob/81fc7366ac637b9a3181f794e5c50527be791413/Cavern.Format/Decoders/EnhancedAC3/JointObjectCodingDecoder.cs

Here is Huffman entry point: https://github.com/VoidXH/Cavern/search?q=Huffman

FFmpeg did a lot of stuff to add 9.1.6 and other even more complex ambysonic layouts. Of course flac does not support 16 channles, only wv does, yet wavpack decoder (not encoder) in ffmpeg does not support producing 16 channels.

https://forum.ixbt.com/post.cgi?id=attach:61:2844:6486:1.png

Balling
2nd September 2022, 07:39
Checked some real DVDA. MLP is after all decoded same as in ffmpeg!

Instead of setting any cmd.exe variables with SET you can just use Plex Transcoder.exe (ffmpeg) option -eae_root C:\Users\Name.

So that (hacked Easyaudioencoder.exe) and eae_root in Plex Transcoder.exe allow very simple and very nice workflow!

Balling
4th September 2022, 10:55
Checked EAC3 too!!! Apprently it applies DRC there too, not cool!! eac3_eae that is, on the left here: https://imgur.com/a/odapgAC

while on the right is FFmpeg decoder. eac3_mf that is in the binary too is also a little different.

QUESTION: is eac3 like TrueHD? 24 bit really, because encoding directly to flac produces 24 bit mode of flac, not 16 (as that is just the default for wav). TrueHD is like that, 100%.

tebasuna51
4th September 2022, 11:28
QUESTION: is eac3 like TrueHD? 24 bit really...

Lossy encodes (eac3) don't have bitdepth at all, the precission is always less than 16 bits (can't recover the source bitdepth exactly).

BTW, like decoders works with float samples, is always better recover the decodec sources at float 32 or at least 24 int.

Balling
4th September 2022, 14:59
Latest commit from https://github.com/VoidXH/Cavern can now create per object 16 channel ADM with iXML. Commit before fixed key problem with decoding atmos. So it is now production ready. Unity app requires .wav and .mkv with eac3 inside to play objects' Brownian motion: see https://photos.app.goo.gl/biAubMWnT8AM18Xm6

We really need to compare ADMs.

Balling
5th September 2022, 08:40
You can also create a separate XML + WAV file!! That is done on the last saving state in explorer.exe window.

I also opened an issue that talks about how EAC3 is more than 16 bit technically (and even provided a workaround to force initial 24 bit), I checked two 24 bit file (silence is 0x00 in to 24 bit, but 0xFF in case of doing 16 bit --> 24 bit), one of which was done from default 16 bit ffmpeg wav (a bug really, I asked everyone on the team to fix it, but I suppose they are afraid it will break too much).

I also created an ADM with iXML inside and detached XML using that workaround!! Guys, please check in Dolby Tools and Nuendo + Davinci (no need to use detached XML). Thanks! I want to know it renders the 16 objects correctly using panning position metadata! https://disk.yandex.ru/d/adBuxVIZAG_5wg

Ah, yes, newest verion of CavernizeGUI with ADM and WAV+ADM XML: https://github.com/VoidXH/Cavern/files/9487389/caverngui.zip

Balling
5th September 2022, 08:49
Lossy encodes (eac3) don't have bitdepth at all, the precission is always less than 16 bits (can't recover the source bitdepth exactly).

BTW, like decoders works with float samples, is always better recover the decodec sources at float 32 or at least 24 int.

The precision even in flac is not always the same bits! That is not argument, if only 10 bits are needed to preserve the wav file. It may have some parts less than 16 bits, but may have some more.

tebasuna51
5th September 2022, 10:47
I also opened an issue that talks about how EAC3 is more than 16 bit technically
Encoders convert source time samples (like stored in WAV files) to frequency domain using float maths. Decoders convert frequency domain data to time samples, even until 64 bits float, try:

eac3to input.ac3 output.wav -full
...
Decoding with libav/ffmpeg...
...
The processed audio track has a constant bit depth of 64 bits.
It is not a upsize, are real outputs from libav decoders.

If the source is only 16 bits int how we have now 64 bits float?
But lossy encoders do not guarantee recover the same 16 bits than source, only a good approximation, better with more bitrate (more frequency domain data) was used to encode. For that the quality in lossy encoders is mesured in bitrate and don't have any exact bitdepth.

Lossless encoderst guarantee recover the same 16 bits than source.

I checked two 24 bit file (silence is 0x00 in to 24 bit, but 0xFF in case of doing 16 bit --> 24 bit)
Samples in wav have 3 bytes signed_le from 0x7FFFFF (stored FFFF7F=+1), 0x000000 (0),0xFFFFFF (-0.000001), 0x800000 (stored 000080=-1)

one of which was done from default 16 bit ffmpeg wav (a bug really...)

A bug? Select the bitdepth desired decoding lossy formats.
If you decode lossless and upsize (16 ->24) read about dither (https://en.wikipedia.org/wiki/Dither).

The precision even in flac is not always the same bits! That is not argument, if only 10 bits are needed to preserve the wav file. It may have some parts less than 16 bits, but may have some more.
Without sense.

With lossless encoders the original source can be recovered with all bits exacts.
Average human ears can difference sounds until a precision of 20 bits,
All parts in a lossless encode have the same bitdepth precision,

Balling
5th September 2022, 17:07
The bug is that TrueHD decodes to 16 bit wav. That is always wrong. 20 bit encoding is not supported by THD encoder (TODO), decoder always decodes to 24 bit anyway. And I argued that, but people said 16 bit is the default for wav since 24 bit wav can break some old devices. It is a bug, 100%. The problem is 24 bit md5 is not the same as 16 bit and if 24 bit file has bits outside 64 bit for EAC3 is certainly too big. I do know ffmpeg support 64 bit int PCM, sure.

There is a bug in ffmpeg that talks ahout how 24 bit decode of TrueHD is not correct! EAE correctly decodes.

Dither is not needed when changing bitdepth. Only when changing frequency, and anyway, as I said, sox may be better, though Paul (richardpl) argued ffmpeg code is now better...

tebasuna51
10th September 2022, 12:13
Anyway, could not help myself changing two bytes in EAE.exe in IDA pro 7.7. https://github.com/pabloromeo/clusterplex/files/9396885/EasyAudioEncoder.zip
...
Who can compare Audiotion 2017 and Plex? I can do, I have both now!
There are a way to use EAE in windows without install PLEX?

Seems EAE have the same problem than DEE (https://forum.doom9.org/showthread.php?p=1974383#post1974383): the 'none' DRC

And we can obtain (FL FR FC LF SL SR TFL TFR) channel map 3D 5.1.2 with EAE?

For these 2 options my choice is now Audition 2017, I doubt we can discover quality differences between the two encoders.

tebasuna51
10th September 2022, 13:10
There is a bug in ffmpeg that talks ahout how 24 bit decode of TrueHD is not correct! EAE correctly decodes.

ffmpeg truehd decoder work fine for me with 24 bits, same output than Dolby Reference Player (drp.exe)

Latest commit from https://github.com/VoidXH/Cavern can now create per object 16 channel ADM with iXML.

Decoding Atmos is offtopic here, I open a new thread (https://forum.doom9.org/showthread.php?t=184364) for it

Kuler087
10th September 2022, 15:05
how do you use EAE? is it a cmd-line tool? is there documentation on how to use it, I can't find any?

Balling
13th September 2022, 05:03
I suppose I was wrong, and Atmos EAC3 on Blu-ray is still using worse quality AC3 inside, but it is not AC3 separate sound, it is hidden inside the EAC3 audio.

"how do you use EAE? is it a cmd-line tool? is there documentation on how to use it, I can't find any?"

Download https://downloads.plex.tv/codecs/1785/windows-x86_64-standard/EasyAudioEncoder-windows-x86_64-standard.zip

Change two bytes in hex editor (this changes one [jump] instruction and its jump destination):

9F 00 00 85 C0 0F 89 12

to
9F 00 00 85 C0 0F 88 88

(Or directly use patched https://github.com/pabloromeo/clusterplex/files/9396885/EasyAudioEncoder.zip)

Then you can encode, after you first launch EasyAudioEncoder.exe server app:

"C:\Program Files\Plex\Plex Media Server\Plex Transcoder.exe" -eae_root C:\Users\XXXX -c:a eac3_eae -i "C:\Users\XXXX\01 - Yello - Waba Duba.ac3" adawsdaq_micro.flac

Encoding to flac will force 24 bit decoder.

But we do not know how to turn off DRC yet, so please only encode with eac3_eae for now!

Balling
13th September 2022, 05:11
ffmpeg truehd decoder work fine for me with 24 bits, same output than Dolby Reference Player (drp.exe)



Decoding Atmos is offtopic here, I open a new thread (https://forum.doom9.org/showthread.php?t=184364) for it

It does work the same for some sample without DRC meta and without 24 bit silence. But were you decoding to 24 bit? Force it with flac or -c:a pcm_s24le.

Kuler087
13th September 2022, 23:34
@Balling thanks a lot.

tebasuna51
14th September 2022, 10:30
... after you first launch EasyAudioEncoder.exe server app:

"C:\Program Files\Plex\Plex Media Server\Plex Transcoder.exe" -eae_root C:\Users\XXXX -c:a eac3_eae -i "C:\Users\XXXX\01 - Yello - Waba Duba.ac3" adawsdaq_micro.flac

But you need:
1) install PLEX
2) create a account (it can be free?)
3) and remain conected to internet when encode

is OK?

Balling
14th September 2022, 18:23
But you need:
1) install PLEX
2) create a account (it can be free?)
3) and remain conected to internet when encode

is OK?

1) No, you can just copy Plex Transcoder
2) No?
3) Certainly no.

tebasuna51
16th September 2022, 11:08
@Balling thanks a lot.

Seems than now Plex Transcoder.exe works for you,
Like you are a windows user please explain how.

In your edited post there are a command line without success:
"C:\Program Files\Plex\Plex\Plex Transcoder.exe" -eae_root "D:\EasyAudioEncoder.exe" -c:a eac3_eae -i D:\1.mka test.eac3
What is the correct one?
And how run EasyAudioEncoder.exe? Before or after Plex Transcoder.exe?

I try different options always with errors.

Kuler087
18th September 2022, 14:10
I can't get it to work as well... :(
@bailling, More info please, how can i encode 7.1 lossless audio to EC3 7.1

cmd:
"C:\Program Files\Plex\Plex\Plex Transcoder.exe" -eae_root D:\other\EAE\ -c:a eac3_eae -i D:\other\EAE\1.ac3 test.eac3

with mkv/mka(with THD) input:
udc input failed with 1011
decoder returned no data
No data written!
safe_fopen: CreateFileW failed: 2

Guessed Channel Layout for Input Stream #0.1 : 7.1
Input #0, matroska,webm, from 'D:\other\EAE\1.mkv':
Metadata:
encoder : libebml v1.4.2 + libmatroska v1.6.4
Duration: 00:07:01.92, start: 0.000000, bitrate: 8100 kb/s
Stream #0:0: Video: hevc, none, 3840x2160, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
BPS : 12119622
DURATION : 00:02:01.789000000
NUMBER_OF_FRAMES: 2920
NUMBER_OF_BYTES : 184504593
_STATISTICS_WRITING_APP: mkvmerge v68.0.0 ('The Curtain') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
Stream #0:1(eng): Audio: eac3, 48000 Hz, 7.1, s16p (default)
Metadata:
BPS : 4556864
DURATION : 00:06:59.904000000
NUMBER_OF_FRAMES: 503885
NUMBER_OF_BYTES : 239180708
_STATISTICS_WRITING_APP: mkvmerge v68.0.0 ('The Curtain') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
BPS : 13
DURATION : 00:06:24.009000000
NUMBER_OF_FRAMES: 39
NUMBER_OF_BYTES : 662
_STATISTICS_WRITING_APP: mkvmerge v68.0.0 ('The Curtain') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'test.eac3' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:1 -> #0:0 (eac3 (eac3_eae) -> eac3 (eac3_eae))
Press [q] to stop, [?] for help
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 62 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 19 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 25 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 37 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 46 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 35 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 38 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 15 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 16 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 15 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 19 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 35 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 20 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 19 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 17 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 23 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 35 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 35 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 28 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 40 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 20 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 13 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
Error while decoding stream #0:1: Error number -16976906 occurred
Last message repeated 9 times
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
[eac3_eae @ 00000275a5a93e80] error reading output
Error while decoding stream #0:1: Unknown error occurred
[eac3_eae @ 00000275a5a980c0] No EAE watchfolder set!
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!


with just AC3 input:


[ac3 @ 00000256aafa8300] Estimating duration from bitrate, this may be inaccurate
Input #0, ac3, from 'D:\other\EAE\1.ac3':
Duration: 00:07:01.47, start: 0.000000, bitrate: 640 kb/s
Stream #0:0: Audio: eac3, 48000 Hz, 5.1(side), s16p, 640 kb/s
File 'test.eac3' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (eac3 (eac3_eae) -> eac3 (eac3_eae))
Press [q] to stop, [?] for help
[eac3_eae @ 00000256aafe2540] No EAE watchfolder set!
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

tebasuna51
18th September 2022, 20:11
The same here, can't use EAE


(your mkv have eac3 already, nor THD)

Kuler087
18th September 2022, 20:30
(your mkv have eac3 already, nor THD)
I know the log says that but the mka or mkv I'm testing have TrueHD 7.1 audio only.

Balling
18th September 2022, 23:35
Thanks to richardpl we now have both Mono decoder fixed (it is now bitperfect with Plex, so I was right, ffmpeg never before decoded mono thruehd correctly, though there are just 9 more samples (zeroes) in Plex decoder) and 24 bit full decoder fixed too!! Only DRC is left.

Mono encoder now works and decodes to mono wav. All's good!

Balling
18th September 2022, 23:43
-eae_root "D:" is a folder. It may or may not contain EasyAudioEncoder.exe. But it must contain 6 folders of derivatives.

Convert to Dolby Digital (High Quality - 640 kbps)

Convert to Dolby Digital (Low Quality - 384 kbps)

Convert to Dolby Digital Plus (High Quality - 384 kbps)
Convert to Dolby Digital Plus (Max Quality - 1024 kbps)
Convert to WAV (to 2ch or less)
Convert to WAV (to 8ch or less)

>And how run EasyAudioEncoder.exe? Before or after Plex Transcoder.exe?

Before, as I said. It is server app, Plex Transcoder will need it.

Kuler087 is testing encoder, I said decoder works: "C:\Program Files\Plex\Plex\Plex Transcoder.exe" -eae_root D:\other\EAE\ -c:a eac3_eae -i D:\other\EAE\1.ac3 test.flac

To make encoder work use:

"C:\Program Files\Plex\Plex Media Server\Plex Transcoder.exe" -eae_root C:\Users\XXXX -c:a eac3_eae -i "C:\Users\XXXX\01 - Yello - Waba Duba.ac3" -eae_root C:\Users\XXXX adawsdaq8.eac3

BTW, Powershell 7 requires adding "& " before those commands.

tebasuna51
19th September 2022, 11:06
In that folder:
Directorio de C:\Users\Pepe
...
15/09/2022 00:49 <DIR> Convert to Dolby Digital (High Quality - 640 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital (Low Quality - 384 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital Plus (High Quality - 384 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital Plus (Max Quality - 1024 kbps)
19/09/2022 11:10 <DIR> Convert to WAV (to 2ch or less)
16/09/2022 18:33 <DIR> Convert to WAV (to 8ch or less)
13/09/2022 13:12 139.404.590 Core.thd
22/08/2022 15:30 1.999.872 EasyAudioEncoder.exe
...

I open a CML window and execute:
C:\Users\Pepe>EasyAudioEncoder.exe
...
udc input failed with 1001
...
decoder returned no data
No data written!
safe_fopen: CreateFileW failed: 2
udc input failed with 1011
...
udc input failed with 1001
decoder returned no data
No data written!
safe_fopen: CreateFileW failed: 2
udc input failed with 1011
...
udc input failed with 1001
decoder returned no data
No data written!
^C
C:\Users\Pepe>

In other CML window I execute just after EasyAudioEncoder:
C:\Users\Pepe>"C:\tmp\Plex\Plex Media Server\Plex Transcoder.exe" -eae_root C:\Users\Pepe -c:a eac3_eae -i "C:\Users\Pepe\Core.thd" -eae_root C:\Users\Pepe core.eac3
ffmpeg version c4efa15-4365 Copyright (c) 2000-2021 the FFmpeg developers
built with Plex clang version 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
configuration: --disable-static ...
libavutil 56. 63.101 / 56. 63.101
libavcodec 58.117.101 / 58.117.101
libavformat 58. 65.101 / 58. 65.101
libavfilter 7. 96.100 / 7. 96.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
[truehd @ 027ef900] Estimating duration from bitrate, this may be inaccurate
Input #0, truehd, from 'C:\Users\Pepe\Core.thd':
Duration: 06:27:14.10, start: 0.000000, bitrate: 48 kb/s
Stream #0:0: Audio: eac3, 48000 Hz, 3.0(back), s16p, 48 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (eac3 (eac3_eae) -> eac3 (eac3_eae))
Press [q] to stop, [?] for help
Error while decoding stream #0:0: Error number -16976906 occurred
Last message repeated 29 times
[eac3_eae @ 027f0080] error reading output
Error while decoding stream #0:0: Unknown error occurred
Error while decoding stream #0:0: Error number -16976906 occurred
Last message repeated 18 times
...
Last message repeated 16 times (412 times)
Output #0, eac3, to 'core.eac3':
Metadata:
encoder : Lavf58.65.101
Stream #0:0: Audio: eac3, 48000 Hz, 5.1(side), s16, 128 kb/s
Metadata:
encoder : Lavc58.117.101 eac3_eae
size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
Conversion failed!
C:\Users\Pepe>

tebasuna51
19th September 2022, 11:11
I know the log says that but the mka or mkv I'm testing have TrueHD 7.1 audio only.

You are right, even with .thd the log say eac3 [3.0(back)]???.

Kuler087
19th September 2022, 15:01
same for me... It only works when the input is AC3.

Balling
19th September 2022, 16:08
In that folder:
Directorio de C:\Users\Pepe
...
15/09/2022 00:49 <DIR> Convert to Dolby Digital (High Quality - 640 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital (Low Quality - 384 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital Plus (High Quality - 384 kbps)
15/09/2022 00:49 <DIR> Convert to Dolby Digital Plus (Max Quality - 1024 kbps)
19/09/2022 11:10 <DIR> Convert to WAV (to 2ch or less)
16/09/2022 18:33 <DIR> Convert to WAV (to 8ch or less)
13/09/2022 13:12 139.404.590 Core.thd
22/08/2022 15:30 1.999.872 EasyAudioEncoder.exe
...

I open a CML window and execute:


In other CML window I execute just after EasyAudioEncoder:

You cannot decode thruehd with eae_eac3, this is ffmpeg 101. Use truehd_eae. Also, thruehd decoding requires -c:a pcm_s24le.

Kuler087
19th September 2022, 17:25
ha thank you for the clarification, now it's working.
Now I hope it works on my TV, the DEE EC3 7.1 tracks are not playing correctly.

tebasuna51
19th September 2022, 19:48
For me works now with wav sources (always 24 bit, 48000 Hz), I'm not need transcode, only encode.

1) Run in a CLI window:
C:\Users\Pepe>EasyAudioEncoder.exe
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.



2) Run in other CLI window:
C:\Users\Pepe>"C:\tmp\Plex\Plex Media Server\Plex Transcoder.exe" -c:a pcm_s24le -i "C:\Users\Pepe\Core.wav" -eae_root C:\Users\Pepe core.eac3
ffmpeg version c4efa15-4365 Copyright (c) 2000-2021 the FFmpeg developers
built with Plex clang version 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
configuration: --disable-static ...
libavutil 56. 63.101 / 56. 63.101
libavcodec 58.117.101 / 58.117.101
libavformat 58. 65.101 / 58. 65.101
libavfilter 7. 96.100 / 7. 96.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
Input #0, wav, from 'C:\Users\Pepe\Core.wav':
Metadata:
encoder : Lavf59.27.100
Duration: 00:03:07.94, bitrate: 9216 kb/s
Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 7.1, s32 (24 bit), 9216 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s24le (native) -> eac3 (eac3_eae))
Output #0, eac3, to 'core.eac3':
Metadata:
encoder : Lavf58.65.101
Stream #0:0: Audio: eac3, 48000 Hz, 7.1, flt (24 bit), 128 kb/s
Metadata:
encoder : Lavc58.117.101 eac3_eae
size= 23496kB time=00:03:07.93 bitrate=1024.2kbits/s speed=20.9x
video:0kB audio:23496kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
EasyAudioEncoder.exe send error messages, but seems can be ignored.
We need Ctrl+C to stop run.

And I obtain the core.eac3 7.1 1024 Kb/s
Decoded with ffmeg -drc_scale 0 the output is equivalent to input Core.wav


- Using a 3D input wav:
Input #0, wav, from 'C:\Users\Pepe\8w3D.wav':
Duration: 00:00:20.04, bitrate: 9216 kb/s
Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 8 channels (FL+FR+FC+LFE+SL+SR+TFL+TFR), s32 (24 bit), 9216 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s24le (native) -> eac3 (eac3_eae))
Output #0, eac3, to '8w3D.eac3':
Metadata:
encoder : Lavf58.65.101
Stream #0:0: Audio: eac3, 48000 Hz, 5.1(side), flt (24 bit), 128 kb/s
Metadata:
encoder : Lavc58.117.101 eac3_eae
size= 940kB time=00:00:20.03 bitrate= 384.6kbits/s speed=27.9x
video:0kB audio:940kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

The channels TFL+TFR are ignored (not mixed, ignored). Then for me EAE is useless.

NOTE: To obtain "C:\tmp\Plex\Plex Media Server\Plex Transcoder.exe" I download Plex and install it in a PC without internet conexion.
I copy the folder "C:\Program Files\Plex" to "C:\tmp\Plex" and I uninstall Plex.
I don't know if the full Plex folder is needed, at least shared ffmeg dll's like avcodec-58.dll, avformat-58.dll, avutil-56.dll, ...

Kuler087
19th September 2022, 20:19
I didn't test yet because I'm not home but looking at audacity waves, it seems the audio volume is very low?

https://slow.pics/c/AGvZoOf2

tebasuna51
19th September 2022, 23:26
I didn't test yet because I'm not home but looking at audacity waves, it seems the audio volume is very low?

https://slow.pics/c/AGvZoOf2
Audacity don't read eac3 files. It can use old ffmpeg libs, but a 7.1 eac3 was readed like 5.1 here.
Your image have only 5 channels.

Decode it to wav/w64 before:

ffmpeg.exe -drc_scale 0 -i "sample.eac3" -c:a pcm_s24le "sample.wav"

Kuler087
20th September 2022, 00:01
thanks for the info.

Unfortunately, DDP produced by EAE gives me the same problem as DEE using my LG C2 ARC to Denon AVR. The AVR reports 7.1 audio DD+ but it plays in slow motion.
If I encode 7.1 EC3 1536kbps with an AC3 core(bd compatible) in DEE, then my AVR reports PCM (no idea if it's the 5.1 core or the 7.1 DD+ that plays). PLEX reports 7.1 audio but I have a feeling that only the 5.1 core is played.
EC3 5.1 1536kbps produced by ffmpeg plays properly and AVR reports 5.1 DD+.

Nvidia Shield: everything works and AVR reports DD+ 7.1.
X800m2: DD+ 7.1 with core plays and AVR reports DD+ 7.1. ... DD+ 7.1 without core= same issue as the TV, it plays in slow motion.

I guess I'll stick to ffmpeg DD+ 5.1 1536kbps even though my TV EDID clearly says that it supports DD+ 7.1 :(

Balling
20th September 2022, 03:28
ha thank you for the clarification, now it's working.
Now I hope it works on my TV, the DEE EC3 7.1 tracks are not playing correctly.

Why would they not?? You did tick bitstream eas3 in lavfilters, right? Sample of DEE??

Balling
20th September 2022, 03:31
Audacity don't read eac3 files. It can use old ffmpeg libs, but a 7.1 eac3 was readed like 5.1 here.
Your image have only 5 channels.

Decode it to wav/w64 before:

ffmpeg.exe -drc_scale 0 -i "sample.eac3" -c:a pcm_s24le "sample.wav"

No, audacity does support it, just download latest nightly, only then you will be able to use head of master of ffmpeg. Api changes were frozen around 4.1.3, so it should be compatible for a while until API breaking version. Audacity does not do two option as above, so sure decoding to w64 is better.

Kuler087
20th September 2022, 04:08
Sample of DEE??

https://drive.google.com/drive/folders/1LXhKdhDXu8sB7FAUneGd2PoRk1uznjuK?usp=sharing

Why would they not?? You did tick bitstream eas3 in lavfilters, right?

I'm talking about TV internal player playback with ARC to my AVR.

Balling
20th September 2022, 06:18
I didn't test yet because I'm not home but looking at audacity waves, it seems the audio volume is very low?

https://slow.pics/c/AGvZoOf2

It is very low because of horrible drc on TrueHD files (not on your file on google drive, that .thd has no DRC), and they are supposed to be lossless, LOL!! The fact is FFmpeg does not support DRC on TrueHD (only EAC3 and AC3), it just decodes lossless.

Use this: decode with normal ffmpeg:

ffmpeg.exe -i file.thd -c:a pcm_s24le wa1.wav

Then encode with Plex to eac3.

Balling
20th September 2022, 06:34
>The channels TFL+TFR are ignored (not mixed, ignored).

Top front left and top front right require EX or Atmos, do they not?

pcroland
20th September 2022, 21:03
DEE EC3 7.1 tracks are not playing correctly.
Have you tried both the standard and the bluray profile?

Kuler087
20th September 2022, 22:54
yes as said previously (https://forum.doom9.org/showthread.php?p=1974917#post1974917)...

LG C2 internal player:
Standard profile = AVR reports DD+ 7.1 but the audio stutter
Bluray profile = AVR reports PCM and I suspect it's playing only the 5.1 core but it doesnt stutter.

tebasuna51
21st September 2022, 19:44
Unfortunately, DDP produced by EAE gives me the same problem as DEE using my LG C2 ARC to Denon AVR. The AVR reports 7.1 audio DD+ but it plays in slow motion.
If I encode 7.1 EC3 1536kbps with an AC3 core(bd compatible) in DEE, then my AVR reports PCM

I have a TV Samsung UE40NU7125 conected by SPDIF to a Denon AVR-X1500H (HDMI without ARC option) than play, and show DD+, all kind of eac3 encodes (EAE, DEE st or bd, Audition, TotalCode and ffmpeg)

When play from PC connected by HDMI to the AVR Denon of course all eac3 is fine, and HD, Atmos, etc.

(no idea if it's the 5.1 core or the 7.1 DD+ that plays). PLEX reports 7.1 audio but I have a feeling that only the 5.1 core is played.
To know if is a real 7.1 or any mix use a channel test (https://forum.doom9.org/showthread.php?p=1963170#post1963170) (recoded to the format desired) instead samples like you use.
Listen the sound only in appropiated speakers.

Kuler087
22nd September 2022, 00:34
thank you, that test file is very useful.
As suspected, I'm not getting 7.1 audio on the LG C2 --> AVR with EC3 (bluray profile) audio. LFE is not even working (AAC is fine but also 5.1 only).

EDIT: Ok, I just learned something, my AVR was set to Top/surround and the back channels don't work that way. So I changed to back/surround and now the back channel works but still no LFE.
Interestingly, now 7.1 EC3 standard profile works without stuttering. all the channels + LFE work.
Test file i used: https://drive.google.com/file/d/10VPaqPt9-Ek7YxK17Ie8W8uyiIxRhZYe/view?usp=sharing

SeeMoreDigital
22nd September 2022, 17:57
thank you, that test file is very useful.
As suspected, I'm not getting 7.1 audio on the LG C2 --> AVR with EC3 (bluray profile) audio. LFE is not even working (AAC is fine but also 5.1 only).

EDIT: Ok, I just learned something, my AVR was set to Top/surround and the back channels don't work that way. So I changed to back/surround and now the back channel works but still no LFE.
Interestingly, now 7.1 EC3 standard profile works without stuttering. all the channels + LFE work.
Test file i used: https://drive.google.com/file/d/10VPaqPt9-Ek7YxK17Ie8W8uyiIxRhZYe/view?usp=sharing
Just so you know... With the exception of the AAC file, the 'side' and 'rear' channels of all the other encodes are the wrong way round. As tested using my OPPO UDP-203.

Kuler087
22nd September 2022, 23:51
, the 'side' and 'rear' channels of all the other encodes are the wrong way round.

indeed... It looks like my DEE settings are incorrect, I did a couple of tests and it keep inverting the Side and Back channels.
https://slow.pics/c/8QFfx2Wv
Can anyone help ? Do you see whats wrong in my xml file?

<?xml version="1.0" encoding="utf-8"?>
<job_config>
<input>
<audio>
<wav version="1">
<file_name>1.wav</file_name>
<timecode_frame_rate>not_indicated</timecode_frame_rate>
<offset>auto</offset>
<ffoa>auto</ffoa>
<storage>
<local>
<path>D:\TEMP_folder\</path>
</local>
</storage>
</wav>
</audio>
</input>
<filter>
<audio>
<pcm_to_ddp version="3">
<loudness>
<measure_only>
<metering_mode>1770-3</metering_mode>
<dialogue_intelligence>true</dialogue_intelligence>
<speech_threshold>20</speech_threshold>
</measure_only>
</loudness>
<encoder_mode>ddp71</encoder_mode>
<bitstream_mode>complete_main</bitstream_mode>
<downmix_config>off</downmix_config>
<data_rate>1024</data_rate>
<timecode_frame_rate>not_indicated</timecode_frame_rate>
<start>0:00:00.005333</start>
<end>end_of_file</end>
<time_base>file_position</time_base>
<prepend_silence_duration>0.0</prepend_silence_duration>
<append_silence_duration>0.0</append_silence_duration>
<lfe_on>true</lfe_on>
<dolby_surround_mode>yes</dolby_surround_mode>
<dolby_surround_ex_mode>no</dolby_surround_ex_mode>
<user_data>-1</user_data>
<drc>
<line_mode_drc_profile>music_light</line_mode_drc_profile>
<rf_mode_drc_profile>music_light</rf_mode_drc_profile>
</drc>
<custom_dialnorm>0</custom_dialnorm>
<lfe_lowpass_filter>true</lfe_lowpass_filter>
<surround_90_degree_phase_shift>false</surround_90_degree_phase_shift>
<surround_3db_attenuation>false</surround_3db_attenuation>
<downmix>
<loro_center_mix_level>-3</loro_center_mix_level>
<loro_surround_mix_level>-3</loro_surround_mix_level>
<ltrt_center_mix_level>-3</ltrt_center_mix_level>
<ltrt_surround_mix_level>-3</ltrt_surround_mix_level>
<preferred_downmix_mode>loro</preferred_downmix_mode>
</downmix>
<allow_hybrid_downmix>false</allow_hybrid_downmix>
<embedded_timecodes>
<starting_timecode>off</starting_timecode>
<frame_rate>auto</frame_rate>
</embedded_timecodes>
</pcm_to_ddp>
</audio>
</filter>
<output>
<ec3 version="1">
<file_name>"THD.TEST.ec3"</file_name>
<storage>
<local>
<path>D:\</path>
</local>
</storage>
</ec3>
</output>
<misc>
<temp_dir>
<clean_temp>true</clean_temp>
<path>D:\TEMP_folder\</path>
</temp_dir>
</misc>
</job_config>

Balling
23rd September 2022, 08:32
Nuts, guys, Youtube added eac3 for 5.1.

yt-dlp.exe -F https://www.youtube.com/watch?v=xrYLJnrdae0

format 328.

328 m4a audio only │ 11.13MiB 384k https │ audio only ec-3 384k 48k high, THROTTLED, m4a_dash

filler56789
23rd September 2022, 08:52
Nuts, guys, Youtube added eac3 for 5.1.

yt-dlp.exe -F https://www.youtube.com/watch?v=xrYLJnrdae0

format 328.

328 m4a audio only │ 11.13MiB 384k https │ audio only ec-3 384k 48k high, THROTTLED, m4a_dash

Yes, that's a party 0_o

256 m4a audio only 6 | 5.66MiB 195k https | audio only mp4a.40.5 195k 24k low, m4a_dash
380 m4a audio only 6 | 11.13MiB 384k https | audio only ac-3 384k 48k high, m4a_dash
328 m4a audio only 6 | 11.13MiB 384k https | audio only ec-3 384k 48k high, m4a_dash
258 m4a audio only 6 | 11.24MiB 388k https | audio only mp4a.40.2 388k 48k high, m4a_dash

tebasuna51
23rd September 2022, 12:56
It looks like my DEE settings are incorrect, I did a couple of tests and it keep inverting the Side and Back channels.
Can anyone help ? Do you see whats wrong in my xml file?

It is not a problem of your xml file, a wav file have this channel order:
FL FR FC LF BL BR SL SR
and all eac3 7.1 encoders are wrong and ignore that order (only EAE based in ffmpeg know that), even if the wav file have the correct channelmask, and read it like:
L R C LFE Ls Rs Rls Rrs
(Ls=SL, Rrs=BR)

The input wav files must be remaped always, the deew (https://forum.doom9.org/showthread.php?t=184175) (DEE Wrapper: automatic channel swapping for 7.1 sources) make the job for you,
or manually (https://forum.doom9.org/showthread.php?p=1967342#post1967342) for Audition (https://forum.doom9.org/showthread.php?p=1963144#post1963144) or TotalCode (https://forum.doom9.org/showthread.php?p=1967227#post1967227)

Kuler087
23rd September 2022, 15:02
all eac3 7.1 encoders are wrong and ignore that order (only EAE based in ffmpeg know that), even if the wav file have the correct channelmask, and read it like:
L R C LFE Ls Rs Rls Rrs
(Ls=SL, Rrs=BR)[/URL]

wow, incredible. Well done Dolby. Thanks a lot(again) for the all info.

pcroland
23rd September 2022, 15:30
indeed... It looks like my DEE settings are incorrect, I did a couple of tests and it keep inverting the Side and Back channels.
Use deew, it swaps the channels automatically so DEE will encode it correctly.

Kuler087
23rd September 2022, 15:48
Use deew, it swaps the channels automatically so DEE will encode it correctly.

thanks but I already wrote my own script that converts UHD-BD to profile 8 DV with EC3 7.1. So @tebasuna51 manual solution works well, I just tried.

%ffmpeg_path% -drc_scale 0 -i %input_path% -map 0:%ID% -filter_complex "pan=7.1|c0=c0|c1=c1|c2=c2|c3=c3|c4=c6|c5=c7|c6=c4|c7=c5" -rf64 auto -c pcm_s24le %TEMP%temp.wav

EDIT:

This whole story got me curious and I checked an original BD with a 7.1 EC3 track and the channels are also out of order.. seriously Dolby wtf?

https://slow.pics/c/diDhad6t

Balling
24th September 2022, 09:17
This whole story got me curious and I checked an original BD with a 7.1 EC3 track and the channels are also out of order.. seriously Dolby wtf?

https://slow.pics/c/diDhad6t

Your EAC3 has DRC applied... are we sure there is no any metadata in EAC3?

I imagine this is why most Blu-rays have no EAC3. And of course EAC3 having AC3 inside.

Balling
24th September 2022, 13:07
Yesterday Audacity Stable was released, BTW with support of HEAD of ffmpeg.

Kuler087
24th September 2022, 14:49
Your EAC3 has DRC applied... are we sure there is no any metadata in EAC3?

I dont know how to check if a file has DRC.
check your PM I sent you a link to the whole 7.1 EC3 Atmos track from the Justice League BD.

filler56789
24th September 2022, 19:07
1)
This whole story got me curious and I checked an original BD with a 7.1 EC3 track and the channels are also out of order.. seriously Dolby wtf?

https://slow.pics/c/diDhad6t

2)
It is not a problem of your xml file, a wav file have this channel order:
FL FR FC LF BL BR SL SR
and ALL eac3 7.1 encoders are wrong and ignore that order
(only EAE based in ffmpeg know that),
even if the wav file have the correct channelmask, and read it like:
L R C LFE Ls Rs Rls Rrs
(Ls=SL, Rrs=BR)

conclusion: friends don't let friends use 7.1 "enhanced"-AC-3. :-|

Balling
26th September 2022, 01:13
First of all what is this:
L R C LFE Ls Rs Tfl Tfr

Never saw it on blu-ray, nor did I ever see Bit rate: 1 512 kb/s for eac3.
Duration: 4 h 2 min on Blu-ray was also a shock, but yeah, long movie... There is no EAC3 sound on Blu-ray... There is AC3 core on your sample in my DM. So that at leasy checks out (00001F47 strmtyp: 1 (0x1) - (2 bits)):

Type 1: These frames comprise a dependent substream. The programme shall be decoded in conjunction with the independent substream with which it is associated.

SeeMoreDigital
26th September 2022, 08:59
There is no EAC3 sound on Blu-ray... There is AC3 core on your sample in
Are you referring to EAC3 being present on a particular Blu-ray disc or EAC3 (without an AC3 core) being available on the Blu-ray format in general? If it's the latter then you are wrong...

tebasuna51
26th September 2022, 11:32
First of all what is this:
L R C LFE Ls Rs Tfl Tfr

The same than (L R C LFE Ls Rs Vhl Vhr) (https://mediaarea.net/AudioChannelLayout) a EAC3 channel map than can be obtained with Audition 2017 (https://forum.doom9.org/showthread.php?p=1963144#post1963144).

And is played in my AVR like it was a Atmos 3D 5.1.2 front (https://forum.doom9.org/showthread.php?p=1963264#post1963264)

Of course aren't in BD's but if Atmos tracks are recoded to (L R C LFE Ls Rs Vhl Vhr) can save space and sended by SPDIF (my TV SAMSUNG player to AVR-DENON). It is my only interest in eac3 8 channels, for me 2D 5.1 and 7.1 are the same.

Kuler087
26th September 2022, 12:11
First of all what is this:
L R C LFE Ls Rs Tfl Tfr

Never saw it on blu-ray, nor did I ever see Bit rate: 1 512 kb/s for eac3.
Duration: 4 h 2 min on Blu-ray was also a shock, but yeah, long movie... There is no EAC3 sound on Blu-ray... There is AC3 core on your sample in my DM. So that at leasy checks out (00001F47 strmtyp: 1 (0x1) - (2 bits)):

Type 1: These frames comprise a dependent substream. The programme shall be decoded in conjunction with the independent substream with which it is associated.

The track come from this bluray:
https://www.blu-ray.com/movies/Zack-Snyders-Justice-League-Blu-ray/288273/

Balling
26th September 2022, 12:42
Are you referring to EAC3 being present on a particular Blu-ray disc or EAC3 (without an AC3 core) being available on the Blu-ray format in general? If it's the latter then you are wrong...

The first, but apparently there is such a Blu-ray.

Balling
27th September 2022, 14:11
BTW, "C:\tmp\Plex\Plex Media Server\Plex Transcoder.exe" -c:a pcm_s24le -i "C:\Users\Pepe\Core.wav" -eae_root C:\Users\Pepe core.eac3

This command uses -c:a pcm_s24le, but it is not needed here, wav encoding defaults to 24 bit to flac, eac3, truehd (with newer ffmpeg with activated 24 bit TrueHD that is). No, the only time it is needed is if you decode .thd to wav or .eac3 to wav. BTW, I still think drc_scale and normal native ffmpeg should be used to decode.

tormento
27th September 2022, 16:11
And is played in my AVR like it was a Atmos 3D 5.1.2 front
Waiting for proper support in deew of Atmos, is there a way to have 5.1.2 instead of 7.1?

Balling
27th September 2022, 17:02
The same than (L R C LFE Ls Rs Vhl Vhr) (https://mediaarea.net/AudioChannelLayout) a EAC3 channel map than can be obtained with Audition 2017 (https://forum.doom9.org/showthread.php?p=1963144#post1963144).

And is played in my AVR like it was a Atmos 3D 5.1.2 front (https://forum.doom9.org/showthread.php?p=1963264#post1963264)

Of course aren't in BD's but if Atmos tracks are recoded to (L R C LFE Ls Rs Vhl Vhr) can save space and sended by SPDIF (my TV SAMSUNG player to AVR-DENON). It is my only interest in eac3 8 channels, for me 2D 5.1 and 7.1 are the same.

I understand that Vhl is Tfl. And Vhr is Tfr. The problem is I never saw something like that on Blu-ray. And I never saw such high bitrate. Again, this is native Blu-ray. This cannot be Audition 2017, because the eac3 sample is JOC, i.e. Atmos.

tebasuna51
28th September 2022, 10:45
Waiting for proper support in deew of Atmos, is there a way to have 5.1.2 instead of 7.1?

Like I say in the Deew thread (https://forum.doom9.org/showthread.php?p=1974383#post1974383) I don't know how pass the correct channel map (5.1.2) to Dolby Encoder Engine, and dee.exe ignore the channel mask of wav file input and output always 7.1

tebasuna51
29th September 2022, 15:08
Some off topic posts moved to https://forum.doom9.org/showthread.php?t=184364 and https://forum.doom9.org/showthread.php?t=184175

Balling
30th September 2022, 07:28
Like I say in the Deew thread (https://forum.doom9.org/showthread.php?p=1974383#post1974383) I don't know how pass the correct channel map (5.1.2) to Dolby Encoder Engine, and dee.exe ignore the channel mask of wav file input and output always 7.1

Well, Netflix somehow encodes Artmos into 5.1 EAC3. Even 16 objects.

Balling
1st October 2022, 21:03
BTW. Be careful with leaked Dolby media encoder. It does not produce lossless TrueHD with stereo wav (it is mostly lossless though, I tried Plex decoder of TrueHD and ffmpeg's), did not check what happens with leaked Encoding Engine.

Balling
2nd October 2022, 00:01
BTW, you can turn off "DRC default on" and plex will not do DRC.

filler56789
2nd October 2022, 07:20
Friendly reminder that the title of this thread is
"Looking for a(n) eac3 7.1 encoder".
Also, it is not safe to discuss wärexxx on this board :-|

junh1024
2nd October 2022, 08:57
Like I say in the Deew thread (https://forum.doom9.org/showthread.php?p=1974383#post1974383) I don't know how pass the correct channel map (5.1.2) to Dolby Encoder Engine, and dee.exe ignore the channel mask of wav file input and output always 7.1

If you want to encode 71sh/512sh, DTSHR supports it in DTSMAS & Mainconcept Totalcode, but you may need to play with NeuralX & Speaker setup settings.

tormento
2nd October 2022, 11:07
I don't know how pass the correct channel map (5.1.2) to Dolby Encoder Engine
How is it done with other, more friendly, software, such as Totalcode Studio or, perhaps, Dolby Media encoder? I really have no interest in 7.1 but 5.1.2 would be nice to have.

tormento
2nd October 2022, 11:08
If you want to encode 71sh/512sh, DTSHR supports it in DTSMAS & Mainconcept Totalcode, but you may need to play with NeuralX & Speaker setup settings.
I have little (almost zero) interest in DTS but I'd like to encode Dolby Atmos from object model to 5.1.2.

SeeMoreDigital
2nd October 2022, 11:44
I have little (almost zero) interest in DTS but I'd like to encode Dolby Atmos from object model to 5.1.2.Me too... I guess a dedicated 'Looking for an Atmos encoder' topic will now need creating...

tebasuna51
2nd October 2022, 18:36
Like I say Mainconcept Totalcode (https://forum.doom9.org/showthread.php?p=1967227#post1967227) do not offer the 5.1.2 layout, I don't know if Dolby Media encoder can do it, not Dolby Encoder Engine.

I can encode to DTSMA to C L R Ls Rs LFE Vhl Vhr (see image) and play fine in my AVR 5.1.2 like the Atmos or Audition eac3 encodes.

139.404.590 CoreAT.thd Source TrueHD Atmos
7.1
81.928.230 Core71.thd Source without Atmos metadata
216.505.028 Core71.wav Decoded to 71
98.373.524 Core71.dts Encodec to DTS-MA
71.615.788 Core71.flac Encodec to Flac
5.1.2
216.505.004 Core3D.wav Atmos decoded to 5.1.2 with Dolby Ref Pla
117.133.232 Core3D.dts Encodec to DTS-MA
88.144.518 Core3D.flac Encodec to Flac
24.064.000 Core3D_k24.ec3 Audition recoded to 1024 Kb/s
9.024.000 Core3D_384.ec3 Audition recoded to 384 Kb/s

I still don't know if my AVR can play 5.1.2 when it is send like PCM (from wav, decoded flac/aac/...). Don't work even with last LAV filters 0.76.1.3 and GraphStudioNext.

pcroland
3rd October 2022, 19:53
BTW. Be careful with leaked Dolby media encoder. It does not produce lossless TrueHD with stereo wav (it is mostly lossless though, I tried Plex decoder of TrueHD and ffmpeg's), did not check what happens with leaked Encoding Engine.
DME uses DEE. I think it has 3db attenuation and 90 degree phase shifting enabled just like in the xml templates for DEE, but I never used DME.

Balling
4th October 2022, 03:52
BTW. Be careful with leaked Dolby media encoder. It does not produce lossless TrueHD with stereo wav (it is mostly lossless though, I tried Plex decoder of TrueHD and ffmpeg's), did not check what happens with leaked Encoding Engine.

IT is possible our decoder and (100%) encoder in ffmpeg is not conformal (opened https://trac.ffmpeg.org/ticket/9958)!! Plex decodes encoded with ffmpeg with the same artefacts as LG C9, very nice!

>I think it has 3db attenuation and 90 degree phase shifting enabled just like in the xml templates for DEE, but I never used DME

No, the bug is just some off-by-ones. Plex decoder and ffmpeg decoder agree (besides some zeroes in the end). Besides 3 db is just for EAC3, no...

Balling
6th October 2022, 06:29
Carl accepted the bug. So hope will be fixed! Mono thd is not affected.

Balling
9th October 2022, 05:28
So about that EAC3 sound from Justice League. I think it is correct, cause thise strange flipped channels are then decoded by Atmos in totally different places. IMHO. It created a crazy construct.

tormento
31st October 2022, 20:24
You don't need nothing to remap for the first one 5.1
I have found another 6.1+5.1 DTS HDMA. How to extract the 5.1 part?

SeeMoreDigital
31st October 2022, 21:01
I have found another 6.1+5.1 DTS HDMA. How to extract the 5.1 part?
If your are referring to the 5.1 dts core, I use TSmuxer GUI...

tormento
31st October 2022, 21:41
If your are referring to the 5.1 dts core, I use TSmuxer GUI...

I want to extract the 1509 kb/s 5.1 channel DTS.

Audio
Format : DTS ES XXCH XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Bit rate mode : Variable / Constant / Constant
Bit rate : Unknown / 1 509 kb/s / 1 509 kb/s
Channel(s) : 7 channels / 7 channels / 6 channels
Channel layout : C L R Ls Rs LFE Cb / C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossless / Lossy / Lossy

Edit: using downconvert to DTS of TSMuxer I get another 6.1 file...

Audio
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
Duration : 1 h 40 min
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 7 channels / 6 channels
Channel layout : C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.06 GiB (100%)

SeeMoreDigital
31st October 2022, 21:53
Okay... Here's an example: -

https://i.ibb.co/0qjbXkf/Capture.png (https://ibb.co/VVW4Ndv)


Cheers

SeeMoreDigital
31st October 2022, 22:56
I want to extract the 1509 kb/s 5.1 channel DTS.

Edit: using downconvert to DTS of TSMuxer I get another 6.1 file...

Audio
Format : DTS ES XXCH
Format/Info : Digital Theater Systems
Commercial name : DTS-ES Discrete
Duration : 1 h 40 min
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 7 channels / 6 channels
Channel layout : C L R Ls Rs Cb LFE / C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 1.06 GiB (100%)

Yep... Obtaining an lossy DTS-ES core is becoming quite common... Some of my Blu-ray audio discs occasionally offer DTS 96/24 cores ;)

tebasuna51
31st October 2022, 23:48
I have found another 6.1+5.1 DTS HDMA. How to extract the 5.1 part?

Seems you have a DTS-MA 6.1 with a core DTS ES 6.1 also.

The core 1509 Kb/s is accepted to be passed by SPDIF and played by DVD players 5.1 only but if you want encode to AC3 you need downmix it, from the MA or from the core.

If you want encode to DDP: Audition and TotalCode have the equivalent channel layout 3/3 L R C LFE Ls Rs Cs.
Like in this century Ls/Rs is decoded to SL/SR we need remap the wav order FL FR FC LFE BC SL SR -> ...|c4=c5|c5=c6|c6=c4

tormento
1st November 2022, 09:40
The core 1509 Kb/s is accepted to be passed by SPDIF and played by DVD players 5.1 only
That's a real pity.
If you want encode to DDP
Yes, that's the way I will follow. It's so weird that DEE can't encode it.

tebasuna51
1st November 2022, 11:29
The core 1509 Kb/s is accepted to be passed by SPDIF and played by DVD players 5.1 only

I want say than old players can play it, but not only them of course.

SeeMoreDigital
1st November 2022, 16:31
I currently don't have my AVR handy (it's in the loft), but the last time I checked sending a DTS-ES bit-stream to it from my OPPO via HDMI, the 'DTS-ES' icon lit up on the AVR. Same goes with DTS 96/24 content ;)

I didn't try the SPDIF optical or electrical outputs from my OPPO to the AVR.

tormento
1st November 2022, 22:02
If you want encode to DDP: Audition and TotalCode have the equivalent channel layout 3/3 L R C LFE Ls Rs Cs. Like in this century Ls/Rs is decoded to SL/SR we need remap the wav order FL FR FC LFE BC SL SR -> ...|c4=c5|c5=c6|c6=c4
Is your channel swapping correct for my file? TotalCode asks FL FR FC LFE BC SL SR but I have C L R Ls Rs LFE Cb in DTS file (according to MediaInfo).

tebasuna51
2nd November 2022, 03:20
Yes.
TotalCode asks for 3/3 L R C (LFE) Ls Rs Cs, forget MediaInfo order please, when you decode the DTS to WAV/W64 the order is FL FR FC LFE BC SL SR then you need remap the BackCenter to the end (c6=c4) to match the CenterSurround

tebasuna51
2nd November 2022, 11:03
@tormento, post moved to https://forum.doom9.org/showthread.php?p=1977643#post1977643

Balling
5th November 2022, 01:14
"The core 1509 Kb/s is accepted to be passed by SPDIF"

Also a bug: https://trac.ffmpeg.org/ticket/7730#comment:1

Balling
31st January 2023, 11:52
BTW. Be careful with leaked Dolby media encoder. It does not produce lossless TrueHD with stereo wav (it is mostly lossless though, I tried Plex decoder of TrueHD and ffmpeg's), did not check what happens with leaked Encoding Engine.

Oh, god. I just tried all 0xFF from infamous issue: https://trac.ffmpeg.org/ticket/5054 and it did not produce even close to lossless binary. LOL!! Also "Optimize data rate" further corrupts it, apparently??? LOL. Not to mention that the file is bigger than with Dolby Media Encoder SE (standalone edition), the previous version of this app...

Anyway, DEE is lossless but bigger than DME SE, so whatever.

tebasuna51
31st January 2023, 13:27
Please Balling this thread is not for ffmpeg DTS or THD bugs, is for eac3 7.1 encoders.

SeeMoreDigital
31st January 2023, 16:52
Please Balling this thread is not for ffmpeg DTS or THD bugs, is for eac3 7.1 encoders.
Agreed... How about splitting all the DTS Q&A's out of this topic into their own topic?

Balling
4th March 2023, 06:28
Apparently EAC3 from Youtube app only works on my Galaxy S22 Ultra if it has Atmos action icon enabled. Nice. In fact if you disable it app switches to opus seamlessly, ON THE FLY. Nuts, Google knows how to code?! Tested on the new infamous video: https://youtu.be/MbdVuStrEV8

Also, apparently mp4 files must have special secret spatial atom for atmos to be recognized on Android https://trac.ffmpeg.org/ticket/9996#comment:5
No, ffmpeg does not write it, but since these two commits it now recognizes atmos EAC3 JOC and TrueHD which allows to write code for this issue.

https://github.com/FFmpeg/FFmpeg/commit/a4e5b946332dd625affd0e259eb787575e5c32f2
https://github.com/FFmpeg/FFmpeg/commit/96ed043afa44d468ff3629095f90d391450c4e60

aqpmlyscbw
9th September 2023, 16:23
Must be remaped always, seems a problem with the Audition included encoder, can't recognize the standard WAV/W64 channel order FL,FR,FC,LFE,BL,BR,SL,SR and asign BL,BR to Ls,Rs instead to Rls,Lls.

eac3to and VLC detects an EAC3 core 5.1 on my 7.1 track, is this normal? did I do something wrong?

SeeMoreDigital
9th September 2023, 17:46
eac3to and VLC detects an EAC3 core 5.1 on my 7.1 track, is this normal? did I do something wrong?
Are you able to provide a download link to your sample encode?

tebasuna51
9th September 2023, 20:35
eac3to and VLC detects an EAC3 core 5.1 on my 7.1 track, is this normal? did I do something wrong?

Welcome to Doom9 forum.

I don't know for what you quote my post about an Audition encode.
Audition CC 2017 can't create eac3 files with ac3 core, maybe your eac3 7.1 track was created with other encoder.

And yes, eac3 tracks can have frames 5.1 ac3 inside (core) and extra frames until 7.1.

aqpmlyscbw
9th September 2023, 22:24
Are you able to provide a download link to your sample encode?

Of course

https://drive.filen.io/d/809c1db3-a5dc-424d-ad1e-694da6bcb2ed#evf4Cj4QNBiAjeehfT5XreuPkh3DX7CC

aqpmlyscbw
9th September 2023, 22:49
Welcome to Doom9 forum.

I don't know for what you quote my post about an Audition encode.
Audition CC 2017 can't create eac3 files with ac3 core, maybe your eac3 7.1 track was created with other encoder.

And yes, eac3 tracks can have frames 5.1 ac3 inside (core) and extra frames until 7.1.

Thanks.

I used Audition CC 2017 with channel mapping and parameters.
eac3to reads that file as follows:

E-AC3, 7.1 channels, 0:01:35, 896kbps, 48kHz
(core: E-AC3, 5.1 channels, 0:01:35, 502kbps, 48kHz)

tebasuna51
10th September 2023, 11:07
Your link don't work for me but you are right.
Sorry, my mistake is read AC3 core instead E-AC3 core like you say.

An EAC3 stream can have 3 types of frames:
0 Independents
1 Dependents
2 AC3
When it have AC3 frames we can extract the AC3 core, but we can extract the EAC3 core extracting the independents frames.
The Dependent frames have the extra channels/bitrate

I make a eac3 7.1 sample and I extract the eac3 core with eac3to.
With my tool LeeAudBi you can compare the info:
File: 7.1.ec3 File: 7.1_core.eac3
Size: 2243584 bytes Size: 1257008 bytes
----------------------------------------- First Frame Info ----------------------------------------- First Frame Info
StrmTyp .....................: 0 (0=Ind, 1=Dep, 2=AC3) StrmTyp .....................: 0 (0=Ind, 1=Dep, 2=AC3)
SubStreamID .................: 0 SubStreamID .................: 0
FrameSize....................: 2008 bytes (502 Kb/s) FrameSize....................: 2008 bytes (502 Kb/s)
SampleRate ..................: 0 (48000 Hz) SampleRate ..................: 0 (48000 Hz)
NumBlksCod ..................: 3 (6 Blocks) NumBlksCod ..................: 3 (6 Blocks)
Audio coding mode (acmod) ...: 7 (3/2 - L, C, R, SL, SR) Audio coding mode (acmod) ...: 7 (3/2 - L, C, R, SL, SR)
Low frequency effects channel: 1 (Present) Low frequency effects channel: 1 (Present)
Version (bsid) ..............: 16 (Enhanced sintax) Version (bsid) ..............: 16 (Enhanced sintax)
Dialogue normalization ......: -31 dB Dialogue normalization ......: -31 dB
Dynamic Range gain ..........: -0.27 dB Dynamic Range gain ..........: -0.27 dB
Mixing metadata exist (ignoring rest) Mixing metadata exist (ignoring rest)
----------------------------------------- Revised EAC3 Info ----------------------------------------- Revised EAC3 Info
Dyn. Range min/max : -10.55/3.34 dB Dyn. Range min/max : -10.55/3.34 dB
Frames Tot/Ind/AC3.: 1252 / 626 / 0 Frames Tot/Ind/AC3.: 626 / 626 / 0
Bitrate average... : 896 Kb/s (Bitrate ...........: 502 Kb/s)
Duration ..........: 20032 ms (0 h. 0 m. 20.032 s.) Duration ..........: 20032 ms (0 h. 0 m. 20.032 s.)
------------------------------------------------- End Info ------------------------------------------------- End Info


The 7.1 have 626 independents frames 5.1 and other 626 dependents for extra channels/bitrate with the average bitrate of 896 Kb/s

The 7.1_core have only the 626 independents frames 5.1 with the fix bitrate of 502 Kb/s and less size of course.

But don't exist AC3 frames like others encoders can create.

aqpmlyscbw
10th September 2023, 15:32
Your link don't work for me but you are right.
Sorry, my mistake is read AC3 core instead E-AC3 core like you say.

An EAC3 stream can have 3 types of frames:
0 Independents
1 Dependents
2 AC3
When it have AC3 frames we can extract the AC3 core, but we can extract the EAC3 core extracting the independents frames.
The Dependent frames have the extra channels/bitrate

I make a eac3 7.1 sample and I extract the eac3 core with eac3to.
With my tool LeeAudBi you can compare the info:
File: 7.1.ec3 File: 7.1_core.eac3
Size: 2243584 bytes Size: 1257008 bytes
----------------------------------------- First Frame Info ----------------------------------------- First Frame Info
StrmTyp .....................: 0 (0=Ind, 1=Dep, 2=AC3) StrmTyp .....................: 0 (0=Ind, 1=Dep, 2=AC3)
SubStreamID .................: 0 SubStreamID .................: 0
FrameSize....................: 2008 bytes (502 Kb/s) FrameSize....................: 2008 bytes (502 Kb/s)
SampleRate ..................: 0 (48000 Hz) SampleRate ..................: 0 (48000 Hz)
NumBlksCod ..................: 3 (6 Blocks) NumBlksCod ..................: 3 (6 Blocks)
Audio coding mode (acmod) ...: 7 (3/2 - L, C, R, SL, SR) Audio coding mode (acmod) ...: 7 (3/2 - L, C, R, SL, SR)
Low frequency effects channel: 1 (Present) Low frequency effects channel: 1 (Present)
Version (bsid) ..............: 16 (Enhanced sintax) Version (bsid) ..............: 16 (Enhanced sintax)
Dialogue normalization ......: -31 dB Dialogue normalization ......: -31 dB
Dynamic Range gain ..........: -0.27 dB Dynamic Range gain ..........: -0.27 dB
Mixing metadata exist (ignoring rest) Mixing metadata exist (ignoring rest)
----------------------------------------- Revised EAC3 Info ----------------------------------------- Revised EAC3 Info
Dyn. Range min/max : -10.55/3.34 dB Dyn. Range min/max : -10.55/3.34 dB
Frames Tot/Ind/AC3.: 1252 / 626 / 0 Frames Tot/Ind/AC3.: 626 / 626 / 0
Bitrate average... : 896 Kb/s (Bitrate ...........: 502 Kb/s)
Duration ..........: 20032 ms (0 h. 0 m. 20.032 s.) Duration ..........: 20032 ms (0 h. 0 m. 20.032 s.)
------------------------------------------------- End Info ------------------------------------------------- End Info


The 7.1 have 626 independents frames 5.1 and other 626 dependents for extra channels/bitrate with the average bitrate of 896 Kb/s

The 7.1_core have only the 626 independents frames 5.1 with the fix bitrate of 502 Kb/s and less size of course.

But don't exist AC3 frames like others encoders can create.

Link is up again, my mistake.

I understand, I just have a question.

EAC3 to WAV64 file in eac3/GUI:

E-AC3, 7.1 channels, 0:01:35, 896kbps, 48kHz
(core: E-AC3, 5.1 channels, 0:01:35, 502kbps, 48kHz)
Extracting E-AC3 core...
Decoding with libav/ffmpeg...
Reducing depth from 64 to 24 bits...
Writing W64...
Creating file "C:\Test\Dolby_EAC3_7.1_track.eac3_.w64"...
eac3to processing took 1 second.
Done.

What command should I use to convert the main 7.1 audio? Foobar2000/FFmpeg decodes it correctly.

tebasuna51
10th September 2023, 19:57
EAC3 to WAV64 file in eac3/GUI:
What GUI?

The libav decoder in eac3to is very old (2015) and don't support decode dependent frames, use always ffmpeg.

With the UsEac3to GUI you must use the 'A/V Recode' button to decode/recode EAC3 with ffmpeg.

aqpmlyscbw
10th September 2023, 21:03
What GUI?

The libav decoder in eac3to is very old (2015) and don't support decode dependent frames, use always ffmpeg.

With the UsEac3to GUI you must use the 'A/V Recode' button to decode/recode EAC3 with ffmpeg.

I understand, thanks for your clarifications.
Any additional suggestions for encoding from Audition?

tebasuna51
11th September 2023, 10:41
You have the options I use in this post (https://forum.doom9.org/showthread.php?p=1963144#post1963144)

But, like I have a audio system 5.1.2 and not 7.1, I use it to recode atmos tracks, decodec with this (https://forum.doom9.org/showthread.php?p=1990804#post1990804), to L R C LFE Ls Rs Vhl Vhr.
That 5.1.2 eac3 is not well recognized by eac3to:

E-AC3, 5.1 channels, 0:00:20, 896kbps, 48kHz
(core: E-AC3, 5.1 channels, 0:00:20, 502kbps, 48kHz)

But yes by MediaInfo: L R C LFE Ls Rs Tfl Tfr
And well decoded with ffmpeg to wav: FL FR FC LF SL SR TFL TFR
And well played by my Denon configured like 5.1.2

The core 5.1 of the 7.1 eac3 have the Side and Back channels mixed.
The core 5.1 of the 5.1.2 eac3 have the Top channels mixed with the Front channels.
I think it is a correct downmix.

aqpmlyscbw
11th September 2023, 15:55
You have the options I use in this post (https://forum.doom9.org/showthread.php?p=1963144#post1963144)

But, like I have a audio system 5.1.2 and not 7.1, I use it to recode atmos tracks, decodec with this (https://forum.doom9.org/showthread.php?p=1990804#post1990804), to L R C LFE Ls Rs Vhl Vhr.
That 5.1.2 eac3 is not well recognized by eac3to:

E-AC3, 5.1 channels, 0:00:20, 896kbps, 48kHz
(core: E-AC3, 5.1 channels, 0:00:20, 502kbps, 48kHz)

But yes by MediaInfo: L R C LFE Ls Rs Tfl Tfr
And well decoded with ffmpeg to wav: FL FR FC LF SL SR TFL TFR
And well played by my Denon configured like 5.1.2

The core 5.1 of the 7.1 eac3 have the Side and Back channels mixed.
The core 5.1 of the 5.1.2 eac3 have the Top channels mixed with the Front channels.
I think it is a correct downmix.

I perceive more clarity/objects (not JOC) compared to AAC on my old soundbar, I'll keep testing on other systems.

Thanks again.

Thunderbolt8
2nd October 2023, 21:42
Does anyone know which would be the best/most useful way to convert a Atmos 7.1 THD track to a DDP 5.1 track? How can I mantain most of the original quality & channel information?

so far Ive used UsEac3to with A/V recode with audio set to DDP 1024 and additional ffmpeg command line '71-51c'

-filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=c3 [r]; [s] pan=stereo|c0=0.5*c4+0.5*c6|c1=0.5*c5+0.5*c7, compand=attacks=0:decays=0:points=-90/-84|-10/-4|-6/-2|-0/-0.3, aformat=channel_layouts=stereo [d]; [r][d] amerge [a]" -map "[a]"

tebasuna51
4th October 2023, 10:35
If you want a DDP 5.1 with ffmpeg (freesoft without a DDP certified encoder) that is my recommended method.

junh1024
6th October 2023, 09:37
If it came from a BD I would suggest extracting the DD/AC3 core instead of making DDP using free DDP encoders. Free DD/DDP encoders are usually lower quality than paid ones.

kurkosdr
13th October 2023, 17:35
I see, thanks.

What happens when you play a EAC3 track on a system that only supports AC3? According to wikipedia and some explanations on Dolby's website, EAC3 is backwards compatible so it supposedly converts it bit perfectly to AC3.
Just to clarify, not every E-AC3 stream has an AC3 stream in it. Basically E-AC3/Dolby Digital Plus refers to three different technologies:

An AC3 5.1 stream extended to have more channels (as encountered in Blu-Ray).

An E-AC3 5.1 stream (which allows conversion to AC3 with minimal quality loss for output via SPDIF by E-AC3 compatible devices), for those cases bandwidth savings are critical, as encountered in some EU broadcasts.

An E-AC3 5.1 stream extended to have more channels or even object audio (as seen in Netflix, which is used to provided Dolby Digital Plus Atmos).

---

And I just realised I have one question: Can you take an AC3 stream and extend it with Atmos? This should allow for low-bitrate (lossy) Atmos on Blu-Ray using just one audio stream.

szabi
16th October 2023, 20:07
This 7.1ch DD+ encoding does not developing quickly.
My first post near 6 years old (https://forum.doom9.org/showpost.php?p=1754063&postcount=170) asking it.

Hi

Since my previous ask now I am in the situation I would like to do it again.
Are there any move forward regarding 7.1ch DD+ encoding?

Regards
szabi

richardpl
17th October 2023, 09:14
Nope, as nobody come to sponsor such feature.

szabi
17th October 2023, 20:00
My first question about it is 8 years old.
This is a said story.

richardpl
21st October 2023, 10:23
It is not sad story when nobody comes around to sponsor additions and expect miracle happens.
There are no miracles.

tebasuna51
21st October 2023, 21:38
Are there any move forward regarding 7.1ch DD+ encoding?

If you want DD+ use any commercial encoder, if you want 7.1 with open encoders use OPUS, the quality/size is equivalent.

szabi
22nd October 2023, 08:26
If you want DD+ use any commercial encoder, if you want 7.1 with open encoders use OPUS, the quality/size is equivalent.

Unfortunately my home theater amplifier does not support OPUS.

SeeMoreDigital
22nd October 2023, 13:32
Are there any move forward regarding 7.1ch DD+ encoding?
Unfortunately my home theater amplifier does not support OPUS.How about 7.1 channel LPCM or 7.1 channel Flac?

Out of interest... What's the make and model number of your AVR. And what playback device are you using to access your surround sound audio files?

szabi
24th October 2023, 18:38
I would prefer dolby digital plus 7.1ch.

SquallMX
2nd November 2023, 18:36
If you want DD+ 7.1 just use Adobe Audition.

j7n
24th November 2023, 08:45
Didn't Adobe remove all their Dolby encoders a couple years ago due to a major disagreement about licensing?

TotalCode seems to have most features exposed. It can do uncommon channel layouts such as Quad, disable the highpass filter, disable dynamic compression. The rear and side channels in 7.1 can be swapped in the GUI. DTS channel order is completely wrong, but AC-3 remapping from WAV order seems to happen within the encoder itself. It takes RF64 without DirectShow, which can be produced in Reaper. To access blu-ray disk encoding mode with an AC-3 core and bitrates over 1 Mbit, you have to pull a Blu-ray preset, and can then remove the video stream. In the normal mode the core is EC-3. The SRC has atrocious quality, and the inputs must be resampled to 48000 Hz if they are not already.

An older version of TotalCode 2.1.0 has impractical bitrates up to 3 Mbit, but only 5.1, and the other sampling frequencies selectable for regular AC-3, and a HD-DVD flavor of EC-3 with small frames. But it reads from DirectShow and may lose samples or quality.

Download the channel test in p=1963170 (https://forum.doom9.org/showthread.php?p=1963170#post1963170)Almost no software of old vintage plays that. Yes, the latest and greatest 64-bit ffmpeg does. AAC wouldn't be my first choice for a surround format. AAC even has a weird default layout for 7.1.

tebasuna51
24th November 2023, 11:21
I tested Adobe Audition 2017 (https://forum.doom9.org/showthread.php?p=1963144#post1963144) but also MainConcept TotalCode Studio v5.3.0 (https://forum.doom9.org/showthread.php?p=1967227#post1967227) but is useless for me because my audio system is 3D 5.1.2 (L R C LFE Ls Rs Vhl Vhr), layout not present in TotalCode, and not the standard 2D 7.1 (L R C LFE Ls Rs Lrs Rrs)

tormento
24th November 2023, 12:22
I tested Adobe Audition 2017 (https://forum.doom9.org/showthread.php?p=1963144#post1963144) but also MainConcept TotalCode Studio v5.3.0 (https://forum.doom9.org/showthread.php?p=1967227#post1967227) but is useless for me because my audio system is 3D 5.1.2 (L R C LFE Ls Rs Vhl Vhr), layout not present in TotalCode, and not the standard 2D 7.1 (L R C LFE Ls Rs Lrs Rrs)


Do you use DEE for that setup? What are the “switches” you touch?

tebasuna51
24th November 2023, 12:53
I test DEE v5.2.0 and only output the standard 2D 7.1 (L R C LFE Ls Rs Lrs Rrs) even if the input wav (RF64) file have a correct 3D 5.1.2 channel mask FL,FR,FC,LFE,SL,SR,TFL,TFR

tormento
24th November 2023, 13:35
I test DEE v5.2.0 and only output the standard 2D 7.1 (L R C LFE Ls Rs Lrs Rrs) even if the input wav (RF64) file have a correct 3D 5.1.2 channel mask FL,FR,FC,LFE,SL,SR,TFL,TFR


So, what do you use?

tebasuna51
24th November 2023, 19:18
If I want less size I use Audition 2017 to recode Atmos sources and I downmix standard 2D 7.1 to 5.1 and encode it to AAC without DN/DRC problems.

tormento
24th November 2023, 21:02
If I want less size I use Audition 2017 to recode Atmos sources and I downmix standard 2D 7.1 to 5.1 and encode it to AAC without DN/DRC problems.


So no 5.1.2?

tebasuna51
24th November 2023, 23:24
5.1.2 only from Atmos sources, I listen a mix of Side (90º) and Back (135º) in my Surround (120º) speakers, does not have sense use my Top Front speakers.

j7n
25th November 2023, 03:15
Looks like Audition 2017 is more complete and probably involves less hassle to prepare the input. I didn't know 5.1.2 layout existed in ec3.

fla56
1st January 2024, 14:44
hi buddy, did you ever get a chance to finish / release the Powerscript?

just going thru Windows 7.1 vs 5.1 transcode hell now, any help much appreciated

The ffmpeg in the transcoder is old, and it doesn't decode dtshdma 7.1 :(. After testing of it's decoding and looking at the resulting audio, its only decoding 5.1 DTS core. This also means when plex thinks its transcoding DTSHDMA -> AAC 7.1, its actually taking 5.1 DTS and upmixing it to 7.1 (probably just copying the side channels to rear). Modern ffmpeg does decode DTSHDMA correctly, so to maintain all channels we can decode 7.1 dtshdma to FLAC or similar lossless with modern ffmpeg, then input the FLAC to Plex transcoder/eae to encode 7.1 EAC3.

eae doesn't seem to respect the bitrate you set with ffmpeg args, it'll always encode at 1024kbps. I'm looking into it too.

I've also written a windows equivalent in powershell (that accepts args) and has an accompanying batchfile with drag and drop functionality. It only works with audio: drop in audio and get out eac3 7.1. that's all I'd use it for, I'd use modern ffmpeg for any other operation. There's no need to pass the transcoder ffmpeg video related information, can just do simple audio conversion.

truehd_eae seemed to decode and produce the same file that modern ffmpeg decodes with its truehd codec, so no issue there. The only useful thing here imo is eac3_eae. After I polish up this powershell implementation i'll look into hooking it nicely into Staxrip or something for ease of use.

BuccoBruce
4th August 2024, 22:26
Interesting that Dolby themselves don't offer 6.1 as an output option at all in DEE/DME, but I guess there really aren't any new 6.1 ES/EX mixes being created. That stanky old version of Audition is useful after all! I only kept it installed because I was too lazy to migrate all of my different effect and effects rack presets.

It works much the same as encoding to 7.1 does, including required channel remapping. Audition's DD+ export (incorrectly) assumes that the channel layout is 3/3 (L R C LFE Ls Rs Cs) whereas anything you import (FLAC with a plugin, WavPack with a plugin, WAV, etc) will all correctly assume L R C LFE Cb Ls Rs when decoded.

If you're using eac3to to decode your DTS-HD-MA-ES/TrueHD6.1 - make sure to add -0,1,2,3,5,6,4. This moves the extra (SPEAKER_BACK_CENTER) channel to where Audition's encoder is expecting it. If you forget, you can use the "channel mixer" effect in Audition, but it's slow and it will gobble up extra temp space because effects have to be applied to the file before you can export, at least in 2015.2.

The rest (bitrate, pre-processing, DRC, etc.) is up to you, but I only ever enable LFE Lowpass if it's needed since it does the filtering in parallel with the encode. 768k is probably overkill when an opus or AAC half the size would do, but at least I don't have to worry about my AVR or Windows or whatever screwing channel mapping up with bitstreamed DD+.

Hopefully this'll help anyone encoding the tiny amount of content out there with a discrete 6.1 mix.

j7n
5th August 2024, 13:59
Is there a way of "labelling" (assigning) channels within Adobe Audition? From some formats it reads the positions (L, R, C, ...) and from others it does not (1, 2, 3, ...). This program is a weird marriage of ancient and modern GUI. Everything is invoked from a single nested Effects menu, and there is no toolbar for basic operations like Fade Out, because toolbars are apparently out of fashion now.

BuccoBruce
5th August 2024, 20:39
Is there a way of "labelling" (assigning) channels within Adobe Audition? From some formats it reads the positions (L, R, C, ...) and from others it does not (1, 2, 3, ...). This program is a weird marriage of ancient and modern GUI. Everything is invoked from a single nested Effects menu, and there is no toolbar for basic operations like Fade Out, because toolbars are apparently out of fashion now.

Short answer: not in a way that would help you when it comes to exporting 7.1 E-AC-3

Long answer: I have noticed that when I import WavPack files (because libsndfile will randomly fail to import specific FLAC files) with the proper channel mask set in the headers, the channels are labeled properly in the UI instead of being "1, 2, 3..." - probably has something to do with the WavPack plugin. However, it (the part of Audition that exports to DDP) still ignores those channel labels and maps the channels incorrectly, reading your channels only in the order it displays in the export menu, whether they're labeled "1, 2, 3..." or "L, R, C..." in Audition's UI.

This idiosyncrasy even extends to their own official DEE/DME - deew handles that for 7.1 by remapping your side/rear channels automatically.

Balling
25th November 2024, 10:24
It is not that simple, dolby media encoder assumes that you use SMPTE style of adm/wav64/wav. It's always backs before sides for Microsoft WAV. For SMPTE wav it is sides before backs.

But I did report it to Adobe, https://community.adobe.com/t5/audition-discussions/7-1-4-wav-is-not-reordered-and-horrible-bug-is-present-why-not-show-backs-before-sides/m-p/13476334

writemaster
12th July 2025, 21:25
I make a test also with TotalCode Studio.

We can configure it like with Audition with some differences:

1) For big files like movie tracks we need rf64 input files (without support for .w64).
And need remap or use the internal remap showed in the image. We can use eac3to:

eac3to 8v341.dtshd 8v341_R.rf64 -0,1,2,3,6,7,4,5

2) The max bitrate is also 1024 Kb/s but there are different channel layouts (see the images).
Without the (L R C LFE Ls Rs Vhl Vhr) than work fine with my audio system 3D 5.2.1.

3) Is fast than Audition.
In my previous old PC (Intel i5-3550 3.30GHz, DDR3 2+2 GB PC3-10700 (667 MHz), SATA ST2000DL003-9VT166 2TB) a source file (Jurasic Park 2h 6m 37s) converted previously to rf64 take 10m 36s to be converted to .ec3.
Audition take 4m to load the .w64 and after 14m to convert it to ec3.


With TotalCode Studio you can make Dolby Digital Plus 7.1 - 1536 bitrate sounds.

tebasuna51
13th July 2025, 10:56
With TotalCode Studio you can make Dolby Digital Plus 7.1 - 1536 bitrate sounds.

I test v5.3.0 and show until 1024, maybe you have other version?

j7n
13th July 2025, 13:57
You can in blu-ray mode with an AC-3 core (starting with a Blu-Ray preset). But it is not a good idea. 5 main channels = 640 kbit/s. 4 rear channels = 896 kbit/s.

writemaster
13th July 2025, 19:58
I test v5.3.0 and show until 1024, maybe you have other version?


I have same version.

https://images2.imgbox.com/f4/17/IWtZyxUA_o.png (https://imgbox.com/IWtZyxUA)

DJ Bobo
13th February 2026, 17:11
I test v5.3.0 and show until 1024, maybe you have other version?
You need to select a Blu-Ray preset under Output in order to show the higher bitrates

tebasuna51
13th February 2026, 19:31
Blu-ray mode (AC3 core) without sense, like j7n say:

You can in blu-ray mode with an AC-3 core (starting with a Blu-Ray preset). But it is not a good idea. 5 main channels = 640 kbit/s. 4 rear channels = 896 kbit/s.

szabi
14th February 2026, 13:26
Hi

Since my previous ask now I am in the situation I would like to do it again.
Are there any move forward regarding 7.1ch DD+ encoding?

Regards
szabi

Hi

Two years passed since quoted post and 10 years since the original asking (https://forum.doom9.org/showpost.php?p=1754063&postcount=170).
Any development?

Regards
szabi

hellgauss
14th February 2026, 19:54
I have written one open source, although it is experimental (and will remain experimental)
https://github.com/HG3112/md71

Nothing so difficult, just 10-20 lines of ffmpeg modification and a simple muxer. I do not know why it is not officially implemented in ffmpeg.

It has two .bat presets in which you can drop your 7.1 audio. Best way to change bitrate is to modify the first lines of .bat.

Doom9 thread: https://forum.doom9.org/showthread.php?t=186249
(the discussion on the tool starts on the second page, in the first one I was trying to modify plex encoder output)

tebasuna51
15th February 2026, 07:43
The hellgauss method work fine to make 7.1 eac3, but maybe you can read my post about Surround 3D (https://forum.doom9.org/showthread.php?p=2017558#post2017558) with my opinion about:

- The 7.1 layout (L R C LFE Ls Rs Lrs Rrs) 2D is only a way to waste money and bitrate because the same Surround 2D can be obtained with the 5.1 Layout (L R C LFE Ls Rs).
- Maybe you want Surround 3D with the layout 5.1.2 (L R C LFE Ls Rs Vhl Vhr), it can be obtained with Audition 2017 but also with a modified hellgauss method (also to AAC 5.1.2 with ffmpeg fdkaac).
- You can convert your 7.1 audio system in a 5.1.2

szabi
15th February 2026, 08:04
I missed that topic.
That is a good news.
Thanks.

Balling
19th May 2026, 15:22
There is now support in this upcoming patch https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21668

hellgauss
19th May 2026, 15:56
Looks great! :thanks:

However I think there is a little imprecision in the code. I have zero experience in collaborating in software development, so I do not know how to post there.

The 1bit compre field in line 218 of eac3enc.c is always set to 0 for a dependent stream (no compression gain)

But in the A/52:2018 (https://www.atsc.org/atsc-documents/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) in Annex E.3.8.5 :

"If multiple associated dependent substreams are present, only the last dependent substream may carry compr and dynrng"

and, most importantly, in the next paragraph

"Therefore, the compre bit in the last dependent substream of a program must be set to 1"

7.1 has only one dependent stream, which is the last. Perhaps is a little ambiguous, but I understood that compr-exists bit should be set to 1 and eventually set to zero compr (8bit). dynrng can be instead completely ignored.

There is also some bit counting to adjust in dep_compute_bit_allocation function (line 2237).