Plex Transcoder’s transcoding of TrueHD 7.1 to EAC3 7.1 causes some horrible volume fluctuations or pulses in certain loud-volume instances. I actually think it’s an EasyAudioEncoder issue, but I’ll explain.
I suspect this post was trying to get at the same issue.
First, here are the transcoder’s FFmpeg options/arguments that produce the issue. These options are executed by Plex’s Transcoder during any TrueHD 7.1 to EAC3 7.1 transcode:
'-codec:0' 'hevc'
'-codec:2' 'truehd_eae'
'-noaccurate_seek'
'-analyzeduration' '20000000'
'-probesize' '20000000'
'-i' '/path/to/input/file.mkv'
'-map' '0:0'
'-codec:0' 'copy'
'-filter_complex' '[0:a:0] aresample=async=1:ocl='\''7.1''\'':rematrix_maxval=60.000000dB:osr=48000[0]' \
'-map' '[0]' \
'-metadata:s:1' 'language=eng'
'-codec:1' 'eac3_eae'
'-b:1' '1280k'
'-segment_format' 'mpegts'
'-f' 'ssegment'
'-individual_header_trailer' '0'
'-segment_time' '10'
'-segment_start_number' '0'
'-segment_copyts' '1'
'-segment_time_delta' '0.0625'
'-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/osd3f39f8dsjq2b3df9i4jim/3a827eec-46a5-4f9b-bf41-7e19374d9a61/manifest?X-Plex-Http-Pipeline=infinite'
'-segment_list_type' 'csv'
'-segment_list_size' '5'
'-segment_list_separate_stream_times' '1'
'-segment_list_unfinished' '1'
'-max_delay' '5000000'
'-avoid_negative_ts' 'disabled'
'-map_metadata' '-1'
'-map_chapters' '-1'
'media-%05d.ts'
'-start_at_zero'
'-copyts'
'-vsync' 'cfr'
'-y'
'-nostats'
'-loglevel' 'quiet'
'-loglevel_plex' 'error'
'-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/osd3f39f8dsjq2b3df9i4jim/3a827eec-46a5-4f9b-bf41-7e19374d9a61/progress'
I tried to pinpoint if it was the transcoder’s fault, or maybe an option/argument out of place, so I pointed Plex Transcoder & EasyAudioEncoder at the file locally and attempted to remove certain FFmpeg options from the command to see which was the culprit. For more info on doing this locally, see here. I suspected it was the complex filter, as hinted at in the post I linked above.
Putting together my own set of options based on Plex’s, it successfully converts to EAC3 7.1 from TrueHD 7.1, yet still causes the awful volume normalization/fluctuations (it produces the same results as the previous command):
'-c:v:0' 'hevc' \
'-c:a:0' 'truehd_eae' \
'-noaccurate_seek' \
'-analyzeduration' '20000000' \
'-probesize' '20000000' \
'-i' '/path/to/input/file.mkv' \
'-map' '0:v:0' \
'-c:v:0' 'copy' \
'-map' '0:a:0' \
'-c:a:0' 'copy' \
'-map' '0:a:0' \
'-metadata:s:a:1' 'title=EAC3 7.1 from TrueHD' \
'-metadata:s:a:1' 'language=eng' \
'-c:a:1' 'eac3_eae' \
'-b:a:1' '1280k' \
'-c:s' 'copy' \
'-start_at_zero' \
'-copyts' \
'-vsync' 'cfr' \
'-avoid_negative_ts' 'disabled' \
'/path/to/output/file.mkv'
Even when taking out the complex filter, it was still normalizing or limiting the volume harshly in certain loud sections. In a last attempt, I took out various stability/sync options, still with no luck (EAC3 7.1 created successfully, but the volume issue persists):
'-c:v:0' 'hevc' \
'-c:a:0' 'truehd_eae' \
'-i' '/path/to/input/file.mkv' \
'-map' '0:v:0' \
'-c:v:0' 'copy' \
'-map' '0:a:0' \
'-c:a:0' 'copy' \
'-map' '0:a:0' \
'-metadata:s:a:1' 'title=EAC3 7.1 from TrueHD' \
'-metadata:s:a:1' 'language=eng' \
'-c:a:1' 'eac3_eae' \
'-b:a:1' '1280k' \
'/path/to/output/file.mkv'
I’ve also tried upping the bitrate to 5000kbps (don’t think this matters as EasyAudioEncoder seems to only encode DD+ to max 1024kbps), and removing the metadata options, with no luck.
Furthermore, I used the following non-Plex Transcoder/EasyAudioEncoder FFmpeg options to create an EAC3 5.1 track with great results (no audio fluctuations/pulses/limiting/normalization):
-c:v:0 hevc \
-c:a:0 truehd \
-i /path/to/input/file.mkv \
-map 0:v:0 \
-c:v:0 copy \
-map 0:a:0 \
-c:a:0 copy \
-map 0:a:0 \
-metadata:s:a:1 title='EAC3 640kbps' \
-metadata:s:a:1 language=eng \
-c:a:1 eac3 \
-b:a:1 640k \
/path/to/output/file.mkv
Sample
- Audio track 1: Original TrueHD 7.1 at track 1 to show what the audio should sound like.
- Audio track 2: The offending EAC3 7.1 at track 2 shows the affect Plex’s Transcoder+EasyAudioEncoder has on the audio (pulsation/fluctuation).
- Audio track 3: The EAC3 5.1 created by FFmpeg at track 3 shows a working 5.1 non-EasyAudioEncoder decode/encode result.
First thing you’ll notice is a difference in overall volume. The EAC3 7.1 track is significantly quieter (seems there’s some limiting going on). Second, if you turn it up a little to compensate for the limiting, listen for the strange fluctuations/pulses in volume in the EAC3 7.1 at track 2 compared to the TrueHD 7.1 at track 1 and EAC3 5.1 at track 3 (no pulses).
Granted, this sample is loud, but I analyzed the TrueHD audio using level meters and it looks like it was engineered to hit peak (0.0db) without clipping (as any professionally-created audio would be), so I’m not sure why EasyAudioEncoder/Plex Transcoder thinks it’s clipping and needs to normalize/limit it.
My Conclusions
After stripping the Transcoder’s FFmpeg options down only to what was necessary, I can only assume there’s some issue in the actual audio decoding or encoding. In this case that’s EasyAudioEncoder for both decode and encode (truehd_eae to eac3_eae). Maybe it’s a bitrate issue, where EasyAudioEncoder outputs a comparatively low rate to the TrueHD source.
Or, EasyAudioEncoder has a built-in limiter with a threshold set to below 0.0db (or even lower), causing any audio that reaches the threshold to be limited and crushed, which causes the fluctuations/pulses. It happens a lot in the music industry, as well (limiting & side-chaining, and how it crushes audio dynamics at high volumes, see here for more info).
Or, something else I’m not thinking of.
Does Plex develop and updated EasyAudioEncoder? Or is it provided to Plex by another developer that could field these kinds of questions?
Tagging @alshain and @OttoKerner to see if they ever found a solution for this. Also @anon18523487 @sa2000 because you contributed to posts I’ve scoured relating to TrueHD/EAC3 7.1/EasyAudioEncoder issues. Any help would be greatly appreciated!
Server Version#: 1.24.0.4930