Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th August 2022, 00:44   #141  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,503
Quote:
Originally Posted by Balling View Post
... 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.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 7th August 2022, 16:17   #142  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 406
Quote:
Originally Posted by SeeMoreDigital View Post
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.

Last edited by Balling; 8th August 2022 at 00:03.
Balling is offline   Reply With Quote
Old 11th August 2022, 01:09   #143  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 99
Quote:
Originally Posted by tebasuna51 View Post
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.
Code:
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?
pcroland is offline   Reply With Quote
Old 12th August 2022, 11:31   #144  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,503
Quote:
Originally Posted by pcroland View Post
...
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

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)
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 12th August 2022, 14:21   #145  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 99
So it's not that easy to implement. Do you know a working tool for it by any chance?
pcroland is offline   Reply With Quote
Old 14th August 2022, 09:32   #146  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,503
No, sorry.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 16th August 2022, 00:05   #147  |  Link
BuccoBruce
Registered User
 
Join Date: Apr 2022
Posts: 23
Quote:
Originally Posted by ymgenesis View Post
Yes, the sample I created in that post was using the "audiotool" I wrote here. 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. 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 before executing the Plex Transcoder executable here 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 (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.

Code:
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:
Code:
\\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 is offline   Reply With Quote
Old 16th August 2022, 02:21   #148  |  Link
BuccoBruce
Registered User
 
Join Date: Apr 2022
Posts: 23
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"
Code:
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"
Quote:
[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
Quote:
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:
Code:
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...

Quote:
Originally Posted by ymgenesis View Post
Yes, the sample I created in that post was using the "audiotool" I wrote here.
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:
Code:
[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

Code:
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.
Code:
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 is offline   Reply With Quote
Old 16th August 2022, 02:32   #149  |  Link
BuccoBruce
Registered User
 
Join Date: Apr 2022
Posts: 23
Quote:
Originally Posted by BuccoBruce View Post
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

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 wish I'd never paid them a dime...
BuccoBruce is offline   Reply With Quote
Old 16th August 2022, 03:45   #150  |  Link
BuccoBruce
Registered User
 
Join Date: Apr 2022
Posts: 23
Yep. It's only decoding the core. I found a creative way to "force" a test,
  1. Get vuvuzela sounds
  2. Get a 5.1 source
  3. Mix the vuvuzelas in as Lsr/Rsr
  4. Invert the vuvuzelas, add them to the pre-existing audio for Lss/Rss
  5. 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!
  6. ?
  7. Profit




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

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

Code:
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
BuccoBruce is offline   Reply With Quote
Old 16th August 2022, 09:37   #151  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,503
Quote:
Originally Posted by BuccoBruce View Post
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

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:
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 16th August 2022, 12:51   #152  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,089
Perhaps the DTS talk should be split off into its own topic...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 16th August 2022, 19:49   #153  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 406
The only reencoder that can preserve Atmos when going from TrueHD to eac3 is in LG TVs. Would be interesting to get that.
Balling is offline   Reply With Quote
Old 17th August 2022, 09:05   #154  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 99
Quote:
Originally Posted by Balling View Post
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.
__________________
deew (Dolby Encoding Engine Wrapper): GitHub, Doom9 | substoforced
pcroland is offline   Reply With Quote
Old 17th August 2022, 14:34   #155  |  Link
Enverex
Registered User
 
Enverex's Avatar
 
Join Date: Jul 2022
Location: UK
Posts: 4
Quote:
Originally Posted by tebasuna51 View Post
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!
Enverex is offline   Reply With Quote
Old 17th August 2022, 21:39   #156  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,503
Quote:
Originally Posted by Enverex View Post
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.
Attached Images
  
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 18th August 2022, 02:06   #157  |  Link
BuccoBruce
Registered User
 
Join Date: Apr 2022
Posts: 23
Quote:
Originally Posted by SeeMoreDigital View Post
Perhaps the DTS talk should be split off into its own topic...
Quote:
Originally Posted by Enverex View Post
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.

Quote:
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.

Quote:
Originally Posted by tebasuna51 View Post
The easy way to test encoders/decoders/players is use a channel_test like I upload here

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!

Last edited by BuccoBruce; 18th August 2022 at 02:09.
BuccoBruce is offline   Reply With Quote
Old 19th August 2022, 04:59   #158  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 406
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...cdocx.zip.html
Balling is offline   Reply With Quote
Old 19th August 2022, 07:44   #159  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 406
Quote:
Originally Posted by Krautmaster View Post
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-...dec/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/cluste...ent-1216753569

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

Last edited by Balling; 19th August 2022 at 09:51.
Balling is offline   Reply With Quote
Old 19th August 2022, 09:43   #160  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 406
"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):

Quote:
└─# 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.

Last edited by Balling; 19th August 2022 at 10:03.
Balling is offline   Reply With Quote
Reply

Tags
eac3

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.