EAC3 decoder not working

Sorry for the wait.

The extras are for direct internet access without Plex.tv in the middle. I have not educated myself on the loadbalancing part - but it is supposed to be good practice…

In the meantime I went for the nuclear option and reencoded all media files with an updated scirpt. All problems solved :slight_smile: The scirpt still has room for imporvement/optimizations and it errors out when it finished. But it works:

#!/bin/bash

############### DISCLAIMER ##################
# ######### USE AT YOUR OWN RISK! ###########
# I am not a professional programmer I have tested this script on my server and it is working.
# I DO NOT TAKE ANY RESPONSIBILITY FOR LOST OR CORRUPTED DATA!
# Read the code an undestand what it does before using it.

############### why and what ################
# No matter what I did inlcuding support by PLEX-Team I could not get eac3 files getting transcoded.
# Browser and Android-App do not have a eac3 decoder. Therfore you cannot play eac3 encoded files there.
# My solution: find all files with eac3 encoding and reencode them as aac while preserving all other streams.
# This is what this script does.
#
############### requirements ################
# in order for this script to work you need to install "mediainfo" from repositories.
# "sed" and "grep" should already be installed other whise do so:
# $ sudo apt install mediainfo sed grep
# copy this file to your preferred location.
#
############### good practice ###############
# since it is a script change owner and rights as follows
# $ sudo chown root:root
# $ sudo chmod 700
#
############### run it ###############
# I use crontab to run it once a day (at 11am)
# $ sudo crontab -e
# add line:
# 0 11 * * * /my/location/convertscript.sh

# ############## SCRIPT ##############
# my tempfolders for generated files
tempfolder=my/temp/folder
# logfile
logfile=my/log/folder/mediafilesconverted.log
# Dates and time  for logfile
dt=$(date '+%d/%m/%Y %H:%M:%S')
echo "Start scirpt " $dt >> $logfile

# change to tempfolder
cd $tempfolder

# note: if you have just one folder you want to check the first loop and subsequent cat is an overkill
# an array for folders you want to check an populate it
folders=(Dokus Movies Serien)

# for every folder in the array get the mediainfo of the files (goes through subdirectories too)
for i in "${folders[@]}"
do
# write path/filename and audio encoding of all files in a csv file
mediainfo "--Inform=General;%CompleteName%|%Audio_Format_List%\r\n" /my/media/folder/${i} >> List.csv
done

# find all path/filename (i.e. lines in the file) that are eac3 encoded and write them to a "toconvert" file that 
grep -E 'E-AC-3' List.csv > toconvert.csv
# line by line remove all text after (and including) the first coma and write it to a txt (you now have a file with path and filename of each mediafile you want to convert).
sed 's/|.*//' toconvert.csv > toconvert.txt
# set variable of target file where to be converted are listed listed (for while loop)
convert=/my/temp/folder/toconvert.txt
# set variable n to number of lines (i.e. files) to convert --> give you an indication how far the scirpt proceeded
i=1
n=$(grep "" -c toconvert.txt)

# converting files in a loop: while loop with integrated "read" function in "file"
while read -r file;
do
# set variable with the path/filename of the ith line
echo "File " $i " of " $n " will be converted." >> $logfile
echo $file >> $logfile
echo "Filesize " $(mediainfo "--Inform=General;%FileSize/String%\r\n" "$file")
ffmpeg -y -loglevel error -stats -i "$file" -map 0:a? -map 0:s? -map 0:v -c:a aac -c:s copy -c:v copy -nostdin "$file".mkv
echo $file "done, continue with renaming an deletion."
# delete original
    if test -f "$file".mkv; then
        echo ""$file" converted. Remove, rename and adjusting rights." >> $logfile
        rm "$file"
        # rename the *mkv.mkv file to the just deleted one setting permissions an owner correctly
        mv "$file".mkv "$file"
        chown user:group "$file"
        chmod 755 "$file"
        i=i+1
    else
        echo ""$file".mkv does not exist." >> $logfile
        i=i+1
    fi
done < $convert

# delete all files in temp folder to have it empty for next run
rm $tempfolder/*.*
echo "Endtime Script" $(date '+%d/%m/%Y %H:%M:%S') >> $logfile

Again thanks for your help!

Your choice to go the nuclear option, but one thing that you should remove from your script that is blatantly false is the fact that PLEX does in fact have support for transcoding the EAC3 codec to other codecs, as I see it on my server all the time.

Also, I play files all the time from my server with EAC3 audio direct on my Shield TV Pro with no issues. Browser is different as that player is always going to have limited support, but again as PLEX normally can transcode to a different codec (I just tested it and the EAC3 5.1 stream transcoded to AAC stereo), your statement is false and misleading.

If you want to keep that statement in there, you should change it to something like you cannot get EAC3 to transcode with your setup so you went with this nuclear option to re-encode everything.

Out of curiosity, as @ChuckPa tried to help you but that didn’t work, did you ever try not using RAM for your transcoding and use the default setup Plex normally uses to see if that works?

-Shark2k

Hi Shark2k

You are right about the misleading/false title. I thought I changed it 2 weeks ago. Obviously it did not work. Changed it again.

I tried transcoding in my home folder. Unsuccessfully. I will check default settings yet (leave transcoding folder in transcoder settings blank).

Happy new year!

This statement is not true.

Plex has full support for E-AC3

Of course! Corrected.

Checked. Not working…

TO ALL:

  1. DO NOT :boom:

  2. Last night, I saw the EAC-3 fix get applied to the transcoder. (it’s a 1 -line bug)

  3. It will , most likely, be slipped into this next PMS release. (No, I don’t know that date)

The bug caused a transcoder core dump when the player (being overzealous) asked for more input than existed in the source file.

Now it properly does a :stuck_out_tongue: to the player and all is well

:rofl:

2 Likes

Great news!!! I’ll have an eye out for it and let you know!

Did the fix get rolled out in the latest update? I cannot find a comprehensive change log…

Thanx

Version 1.25.3.5409 did not solve the problem. Has the fix been deployed?

Will continue working with :boom: for now :stuck_out_tongue_winking_eye:.

Still no change in 1.25.4.5487 or 1.25.5.5492

Thanks.

I will go hunting :gun: and find out where it’s being held hostage.

Thx :man_police_officer::man_detective:

mmmmh seems to be working now!!! :fireworks: :tada: - will keep testing…

nope… it still does not work, Version 1.26.0.5715
can you confirm it’s been rolled out?

@akreaxun

Please do the following:

  1. Verify DEBUG logging is enabled and VERBOSE is disabled.
  2. Restart Plex – Keeping it completely idle for 3 minutes (4 if a slower CPU)
  3. Now start the playback session.
  4. Wait 30 seconds and then stop
  5. Wait another 20 seconds
  6. Download the logs ZIP file
  7. Attach here please for review.
1 Like

Plex Media Server.zip (76.8 KB)

I read the attached log. The issue seems to be

May 11, 2022 21:46:26.000 [0x7f81e717cb38] ERROR - [Transcoder] [eac3_eae @ 0x7f61a68b3b00] EAE timeout! EAE not running, or wrong folder? Could not read '/tmp/pms-53fe614f-2924-49f1-9d85-4abba4b79ea1/EasyAudioEncoder/Convert to WAV (to 8ch or less)/ej3mi07ij2m6xtc0eizhg52o_727-0-45.wav'
May 11, 2022 21:46:26.000 [0x7f81e7626b38] ERROR - [Transcoder] [eac3_eae @ 0x7f61a68b3b00] error reading output

@akreaxun

You’ve run out of notify slots.

May 11, 2022 21:38:45.496 [0x7f81e7eb4b38] DEBUG - [Notify] Now watching "/var/hda/files/Serien/Zou"
May 11, 2022 21:38:45.496 [0x7f81e7eb4b38] DEBUG - [Notify] Now watching "/var/hda/files/Serien/Zou/Season 1"
May 11, 2022 21:38:45.496 [0x7f81e7eb4b38] DEBUG - [Notify] Now watching "/var/hda/files/Serien/Star Trek TNG"
May 11, 2022 21:38:45.496 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 4" (28: No space left on device)
May 11, 2022 21:38:45.497 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 6" (28: No space left on device)
May 11, 2022 21:38:45.497 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 2" (28: No space left on device)
May 11, 2022 21:38:45.498 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 7" (28: No space left on device)
May 11, 2022 21:38:45.498 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 1" (28: No space left on device)
May 11, 2022 21:38:45.499 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 3" (28: No space left on device)
May 11, 2022 21:38:45.499 [0x7f81e7eb4b38] ERROR - [Notify] Failed to add watch for "/var/hda/files/Serien/Star Trek TNG/Staffel 5" (28: No space left on device)
May 11, 2022 21:38:45.518 [0x7f81e957eb38] DEBUG - Request: [127.0.0.1:34824 (Loopback)] GET /:/plugins/com.plexapp.system/resourceHashes (8 live) GZIP Signed-in Token (akreaxun)
May 11, 2022 21:38:45.518 [0x7f81e957eb38] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /:/plugins/com.plexapp.system/resourceHashes
May 11, 2022 21:38:45.518 [0x7f81e957eb38] DEBUG - HTTP requesting GET http://127.0.0.1:40767/:/plugins/com.plexapp.system/resourceHashes
May 11, 2022 21:38:45.520 [0x7f81e7f3ab38] DEBUG - [HttpClient] HTTP/1.1 (0.0s) 404 response from GET http://127.0.0.1:40767/:/plugins/com.plexapp.system/resourceHash

The transcoder needs 2 to run EAE.

wohoooo - thats the solution!!! Thank you so much - my life just got a lot easier!! Most appreciated.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.