Very simply, comskip runs over the same files many times. This chews up CPU time and energy for no reason. There don’t appear to be any errors or other failure signals in the logs.
Presumably this is not how the feature is supposed to work as it seems very wasteful.
Here’s an extract from my logs which shows the same recording is scanned for commercials (you’ll have to trust me that this is coming from commercial detection) every night for the last week.
2024-09-20 05:33:57.969
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-21 05:33:07.205
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-22 05:34:49.578
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-23 05:28:21.456
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-24 05:32:22.164
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-25 05:32:03.170
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
2024-09-26 05:35:01.412
"[...]/DVR/TV/Barefoot Contessa Back to Basics (2002)/Season 13/Barefoot Contessa Back to Basics (2002) - S13E17 - Get Grilling.ts"
I would be interested to understand this behaviour if possible.
Please post the entire XML info for one of the files being repeatedly scanned for commercials. It will show if there are commercial markers; if not, it is expected that it will continue to be scanned for them.
It would seem not to have any commercial markers. Presumably this could simply be because the programme doesn’t have commercials (though in this case it does, they’re just not detected), so it seems strange not to have recorded a ‘no commercials found’ marker or similar to prevent endless, futile rework.
I’m not saying that it should be, only that it will be. Plex stores no information about whether or not commercial skipping has been performed on a file; it bases its decision to scan for them upon the presence or absence of the markers.
This is based on experience, and not just conjecture. If you’ve got a library configured to detect commercials, and there are files within which contain none, it will attempt to scan them.
@_j You’re correct, this file has not ad markers and as such will continue to be scanned. I think there may be a feature request to change this behavior, but I can’t find it right now.
I would like to have some kind of “official” info - and if this is not a bug but intended behavior then I need to switch that off permanently in my TV show libraries. Most of my several thousands of episodes have no commercials.
I’m not familiar with this feature (yet).
It looks like you should be able to disable it for each library: ⋮ > Manage Library > Edit... → Advanced > Ad detection = Disabled
On Linux you can review the journal to see what Plex is doing:
sudo journalctl -u plexmediaserver
Should see something like
Plex Commercial Skipper, made using ffmpeg
Donator build
The commandline used was:
[21.0K blob data]
109242 frames decoded in 281.53 seconds (388.03 fps)
"/usr/lib/plexmediaserver/Plex Commercial Skipper"
"--ini=/plex/Library/Application Support/Plex Media Server/DVR/comskip.ini"
"--output=/plex/tv/60 Minutes (1968)/Season 56"
-t
--quiet
"/plex/tv/60 Minutes (1968)/Season 56/60 Minutes (1968) - S56E52 - Crisis at Pearl Harbor; Dr Kuznetsov; Indian Relay.ts"
Setting ini file to /plex/Library/Application Support/Plex Media Server/DVR/comskip.ini as per commandline
Using /plex/Library/Application Support/Plex Media Server/DVR/comskip.ini for initiation values.
Auto selecting the PID.
Commercials were not found.
Commercials weren’t found because there was a stationary storm warning logo that was present through the whole program blocking detection. I just watch and delete, primary reason to keep the DVR libraries separate from the everything else.
This seems to be a regression as PMS-Linux v.1.32.8.7639 didn’t have this issue. After upgrading to the latest version with saved DVR recordings that were present before the upgrade this issue occurs daily. Files with this issue don’t have any commercial skip markers when looking at the XML. I keep some DVR recordings, so this issue is a problem.
The workaround seems to be disabling the Library Ad detection noted here: Commercial detection running every night on same files - #7 by tom80H
and then enabling ad detection per DVR recording as this option is still present in current PMS versions. I have verified that disabling the Library Ad detection does not re-trigger a daily commercial skip scan of DVR recordings.
Edit: I was able to see the issue in the PMS supervisord.log before using the workaround. This OTA DVR recording was set to “Detect and Delete Commercials” from: Live TV / DVR Schedule. Notice the original recording successfully detected and deleted commercials. Afterwards, the feature in “TV Shows Library / Ad detection” ran again since the DVR recording has no ad markers probably since the “Commercial Skipper” feature removed them previously:
PMS supervisord.log of the original OTA DVR recording:
2024-09-30 22:32:02,191 DEBG 'plexmediaserver' stderr output:
1223238 frames decoded in 2821.51 seconds (433.54 fps)
2024-09-30 22:32:03,759 DEBG 'plexmediaserver' stdout output:
"/usr/lib/plexmediaserver/Plex Commercial Skipper"
--ini=/usr/lib/plexmediaserver/Resources/comskip.ini
"--output=/media/Media/TV Shows/.grab/5f1e3913c1b37be2ba75ba17ad02af5e2b90a497-9f0dbe7938b03467e0933e871d1783775ac68ece"
-t
--quiet
"/media/Media/TV Shows/.grab/5f1e3913c1b37be2ba75ba17ad02af5e2b90a497-9f0dbe7938b03467e0933e871d1783775ac68ece/NFL Football (2002) - 2024-09-30 06 00 00 - Seattle Seahawks at Detroit Lions.ts"
Setting ini file to /usr/lib/plexmediaserver/Resources/comskip.ini as per commandline
Using /usr/lib/plexmediaserver/Resources/comskip.ini for initiation values.
Auto selecting the PID.
Commercials were found.
PMS supervisord.log of the TV Shows Library / Ad detection which ran again since the DVR recording has no ad markers probably since the “Commercial Skipper” feature removed them previously:
2024-10-01 03:06:23,135 DEBG 'plexmediaserver' stderr output:
594140 frames decoded in 1438.92 seconds (412.91 fps)
2024-10-01 03:06:23,409 DEBG 'plexmediaserver' stdout output:
"/usr/lib/plexmediaserver/Plex Commercial Skipper"
--ini=/usr/lib/plexmediaserver/Resources/comskip.ini
"--output=/media/Media/TV Shows/NFL Football (2002)/Season 2024"
-t
--quiet
"/media/Media/TV Shows/NFL Football (2002)/Season 2024/NFL Football (2002) - 2024-09-30 06 00 00 - Seattle Seahawks at Detroit Lions.ts"
Setting ini file to /usr/lib/plexmediaserver/Resources/comskip.ini as per commandline
Using /usr/lib/plexmediaserver/Resources/comskip.ini for initiation values.
Auto selecting the PID.
Commercials were found.
Thanks @Bladerun1, that’s particularly interesting as it would strongly imply that this is indeed not the intended behaviour.
I’ve disabled the feature at the library level as you suggest and will observe the results over the next couple of days.
The obvious next question is how this issue would best make its way into a bug report in the proper place (appreciating that it may or may not end up being fixed). Am I right in thinking that this happens effectively by chance—if some suitably empowered person happens to look at this thread and take sufficient interest in it?
Following up on this, unfortunately the suggestion of disabling ad detection at the library level but enabling it at the DVR and programme level does not seem to have had the desired effect. Whilst I can see from the logs that comskip runs and detects commercials at the end of the recording session, when the recording then lands in the library its XML info contains no commercial markers.
The documentation isn’t clear about how the DVR-, programme-, and library-level settings interact. My observations would suggest that turning off at the library level prevents the skip markers being saved after detection. Clarification would be very welcome!
This then, sadly, takes me back to square one: the process re-running over the same files every night if I want to be able to skip commercials. Given power consumption was front and centre at this year’s Plex Pro week, it would be great to find a proper resolution to this somehow.
I was tremendously excited to see the following in yesterday’s release of PMS:
NEW:
(AdDetection) Ad detection can now be run on media add (PM-1988)
After some searching around in the relevant settings pages, I think this is referring to the addition of the following. Sadly, I don’t think this is of any benefit to the issue described here .
Settings →
Library →
Generate ad video markers →
as a scheduled task and when media is added
Please do jump in if I’m missing something. Continuing to hope for some improvement. Further electricity will be wasted in the meantime .