Removing commercials - An error occurred while postprocessing the recording

There are many docker images to remove commercials. The one I’ve tried is:

uirel/lsio-plex-comskip

I find indeed it does remove most of the commercials from shows. However, every encoding also shows up as an error:

An error occurred while postprocessing the recording

Making it impossible to know if the show really succeeded without watching it.

It seems practically all the docker images are forked from the same source, and they use the same comskip.sh script. One error I noticed is they call mkvpropedit even when the input is a *.ts file. I’ve revised the script as follows:

#!/bin/bash
[ -z "${1##*.mkv}" ] && /usr/bin/mkvpropedit "$1" --edit track:a1 --set language=eng --edit track:v1 --set language=eng
sleep 10
/usr/bin/python /opt/PlexComskip/PlexComskip.py "$1"

But still it always produced the postprocessing recording error flag.

Any ideas?

check your logs, proably same as here while removing folder … wich seems already be gone :wink:
no idea howto really fix this (tried several ways)

in plexcomskip.py i replaced line 85, but thats a dirty solution :wink:

exit_code=CONVERSION_SUCCESS ## EXCEPTION_HANDLED

but this will probably always give success then … but i didnt like the error marks …

another fix (clean code) here

but that didnt work out for me … may give that a try first :wink:

I ended up rewriting the script as:

#!/bin/bash
export TMPDIR=/transcode/
[ -z "${1##*.mkv}" ] && /usr/bin/mkvpropedit "$1" --edit track:a1 --set language=eng --edit track:v1 --set language=eng
sleep 10
nice -n 10 /usr/bin/python /opt/PlexComskip/PlexComskip.py "$1" 2>>/dev/null
exit 0

The exit 0 makes it always successful. The piping the error to /dev/null speeds the script up, as sometimes there is excessive amount of debugging output. The nice keeps it from interfering with the transcoder. The TMPDIR setting keeps it from failing because it fills up /tmp. I also noticed this process is fairly slow. It takes about 22 minutes to process a 30 minute show on my server. Which means if the transcoder is running as well, back to back recordings will attempt to process in parallel. So I end-up turning off the transcoding of DVR files. Turns out to get decent compression, I need to run handbrake over the files, so there is little use in transcoding as the files are recording.