Commercial Skipper codec

Server Version#: 1.26.2.5797 docker
Tuner Make/Model: HD Homerun Connect

Commercial Skipper does not work, always the same error about codec

The commandline used was:
Plex Commercial Skipper, made using ffmpeg
Donator build
**Unsupported codec!**
**Unsupported codec!ames** in 9.93 sec(124.37 fps), 1.00 sec(122.00 fps), 2%
 0:39:53 - 61116 frames in 513.67 sec(118.98 fps), 1.00 sec(78.00 fps), 99%%
61145 frames decoded in 513.96 seconds (118.97 fps)
        "/usr/lib/plexmediaserver/Plex Commercial Skipper"
        --ini=/usr/lib/plexmediaserver/Resources/comskip.ini
        --output=/data/Videos/ReplayTV/.grab/...
        -t
        --quiet
        "/data/Videos/ReplayTV/.grab/.../
[mpegts @ 0x148d12beb040] start time for stream 5 is not set in estimate_timings_from_pts
Input #0, mpegts, from '/data/Videos/ReplayTV/file.ts':
  Duration: 00:39:17.52, start: 1.400000, bitrate: 8378 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), none(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1[0x101](fra): Audio: eac3 (EAC3 / 0x33434145), 48000 Hz, stereo, s16p
    Stream #0:2[0x102]: Audio: eac3 (EAC3 / 0x33434145), 48000 Hz, stereo, s16p
    Stream #0:3[0x103](fra): Audio: eac3 (EAC3 / 0x33434145), 48000 Hz, stereo, s16p
    Stream #0:4[0x104](fra): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
    Stream #0:5[0x105](fra): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
**Unsupported codec!**
**Could not open video codec**

You’ll need to provide some environment variables to the command line. Note: The example in that particular post is from Windows, so the environment variable will be different.

I’m curious what you’re attempting to accomplish though. Running it manually will not actually modify the file to remove commercials, nor will it update Plex’s database with commercial markers for the file. It will just produce and EDL file and some logging.

When Plex performs commercial skipping after recording, it runs its commercial skipper and then performs additional post-processing using the created EDL file. I’ve not seen anyone reproduce that step of the process directly from the command-line.

You can configure Plex to go back and run its commercial removal/marking process on existing media files; the configuration requirements are described in the post I linked. Just keep in mind that a DVR must be configured in Plex for this to work.

It is plex that runs the commercial skipper and send the error about codec
and it result in a 0 byte TS file
Plex and DVR are well configured like documentation and post here

here the content of the FFMPEG_EXTERNAL_LIBS
-rw-r–r-- 1 nobody users 278536 May 17 14:58 libaac_decoder.so
-rw-r–r-- 1 nobody users 200456 May 17 14:58 libaac_encoder.so
-rw-r–r-- 1 nobody users 143624 May 17 14:58 libac3_decoder.so
-rw-r–r-- 1 nobody users 155176 May 17 14:58 libac3_encoder.so
-rw-r–r-- 1 nobody users 304848 May 17 14:58 libdca_decoder.so
-rw-r–r-- 1 nobody users 1652640 May 17 14:58 libh264_decoder.so
-rw-r–r-- 1 nobody users 1542400 May 17 14:58 libhevc_decoder.so
-rw-r–r-- 1 nobody users 1789960 May 17 14:58 liblibx264_encoder.so
-rw-r–r-- 1 nobody users 131688 May 17 14:58 libmp3_decoder.so
-rw-r–r-- 1 nobody users 652344 May 17 14:58 libmpeg2video_decoder.so
-rw-r–r-- 1 nobody users 874432 May 17 14:58 libmpeg4_decoder.so
-rw-r–r-- 1 nobody users 1770912 May 17 14:58 libvp9_decoder.so

I can’t get Commercial Skipping to work at all on PMS / Linux so I’ve given up on it for now.

so bad Plex team should test the feature before proposing it !!!

File permissions don’t seem to be correct. In a non-docker setup they are owned by plex:plex

it is the correct permissions for docker unraid environnement

Strange. I use PMS on Docker (not Unraid though) and commercial skipping works fine for me. In fact, I’m in the process of running about nine episodes through ad skipping right now and just verified the first couple have succeeded.

I’m running PMS Version 1.27.0.5849 currently, but this has worked consistently through all versions back as far as I can recall.

Full server logs may be needed to shed some light on what’s going on. My previous experience is that issues such as these are almost always caused by permissions problems.

for a new test I set “chmod 777 to libs” still the same error

what is your environnement to compare ?

in my case it’s DVB-T from France received in MPEG4 AVC interlaced
my tuner is a Silicondust HDHomerun Connect

Plex Media Server Logs_2022-06-08_16-13-37.zip (4.7 MB)

I use an HDHomeRun Connect 4K. I’m in the US, which means an ATSC 1.0 signal with mpeg2video (and AC3 audio). The tuner supports ATSC 3.0 which uses HEVC; I may be able to perform a test with that as my area does have ATSC 3.0 broadcasts.

You may want to also ensure that your /tmp directory is 777 as well; I’ve seen some strange issues reported on the forums where the permissions for /tmp were somehow changed such that Plex couldn’t write to it.

yes /tmp is already full access

I also tried the option in plex to convert TV stream from tuner
reencoding is working, so no codecs errors

with commercial skipper activated and converting it fail
Plex comskip binary is not using the same libs maybe

Your logs show that the commercial skipper is actually completing successfully (at least for the attempt in the most recent log):

Jun 08, 2022 16:11:22.612 [0x1549d26dbb38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Commercial Skipper' exit code for process 5648 is 0 (Commercials found)
Jun 08, 2022 16:11:22.613 [0x1549cbe03b38] DEBUG - [Grabber/0442def4734f86fd8d8db95a385d5b5855ba975a/AdDetector] EDL built after 83.4 seconds.

Where it appears to be failing is the next step, where it attempts to actually use Plex Transcoder (ffmpeg) to actually remove the commercials from the file using the segment list (itself built from the EDL):

Jun 08, 2022 16:11:22.621 [0x1549cbe03b38] DEBUG - [Grabber/0442def4734f86fd8d8db95a385d5b5855ba975a/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/994f4ee-4302-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx "/usr/lib/plexmediaserver/Plex Transcoder" -y -safe 0 -skip_before_video_key 1 -skip_before_inpoint 1 -offset_inout 1 -i /data/Videos/ReplayTV/.grab/0442def4734f86fd8d8db95a385d5b5855ba975a-eae8a1c71a1e376267d0bfa4720bce51ec243047/segment-list.txt -map 0 -c copy -loglevel quiet -loglevel_plex error "/data/Videos/ReplayTV/.grab/0442def4734f86fd8d8db95a385d5b5855ba975a-eae8a1c71a1e376267d0bfa4720bce51ec243047/Section de recherches (2006) - S11E07 - Manipulations-comskipped.ts"
Jun 08, 2022 16:11:22.631 [0x1549cbe03b38] DEBUG - [Grabber/0442def4734f86fd8d8db95a385d5b5855ba975a/JobRunner] Jobs: Starting child process with pid 5659
Jun 08, 2022 16:11:22.729 [0x1549c9ba4b38] ERROR - [Transcoder] [h264 @ 0x149f539c95c0] mmco: unref short failure
Jun 08, 2022 16:11:22.729 [0x1549c9ba4b38] ERROR - [Transcoder] [h264 @ 0x149f539c95c0] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
Jun 08, 2022 16:11:23.095 [0x1549c9ba4b38] ERROR - [Transcoder] [h264 @ 0x149f5312bdc0] mmco: unref short failure
Jun 08, 2022 16:11:23.096 [0x1549c9ba4b38] ERROR - [Transcoder] [h264 @ 0x149f5312bdc0] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
Jun 08, 2022 16:11:23.473 [0x1549c9ba4b38] ERROR - [Transcoder] [mpegts @ 0x149f530fd040] sample rate not set
Jun 08, 2022 16:11:23.474 [0x1549c9ba4b38] ERROR - [Transcoder] Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Jun 08, 2022 16:11:23.474 [0x1549c9ba4b38] ERROR - [Transcoder] Error initializing output stream 0:5 -- 
Jun 08, 2022 16:11:23.474 [0x1549c9ba4b38] ERROR - [Transcoder] 
Jun 08, 2022 16:11:23.480 [0x1549d26dbb38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 5659 is 1 (No commercials found)

Have you tried (recently?) just having it mark ads for skipping instead of removing them?

when I tried marking instead of removing I didn’t see the skip button on ads
as you suggest I did the tests again, logs seems OK commercials found

for 4 records 2 do not propose me to skip ads
and the 2 others I have the skip button but after 1mn of ads

so it’s working but not very accurate, I see the comskip.ini I will try to find if there’s better option for my region

Unsure of what I changed but commercial skipping seems to be working now.

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