Plex Pass Remove Commercials is Removing Ending Credits

Hello Community,

Lifetime Plex Pass user here. We’ve been installing and configuring Live TV and DVR for the past few weeks and have everything working really well. Plex has been recording shows and movies perfectly as expected and we even have post-processing in place to encode media for storage savings.

There appears to be one problem, however, and we wanted to see if there might be a solution that we’re overlooking. It would seem that the Remove commercials feature of the Plex Pass is removing the ending credits of the shows and movies we’re recording and saving.

So it would seem that Plex Pass is working well and a little too well. :laughing:

It would be great to know if this is a known issue and/or if there is a way to mitigate it. I have tried to modify settings so that shows record five minutes longer than the listed runtime, figuring that the extra time would allow for credits to be recorded, but that didn’t help.

It would seem that as soon as the ending “fade” of a show/program/movie is detected, all following content is removed, and in this case, that would mean the ending credits. Ideally these would be maintained as technically that is still part of the program (and saves a search online for us lazy ones).

Thank you in advance for any assistance you can provide.

This is how Comskip deals with that outside of Plex-DVR:
http://www.kaashoek.com/comskip/viewtopic.php?f=2&t=1035
Looks like, if Comskip dot ini can be located, altering one line to tell Comskip to lay off your credits should do it.
(the number of seconds counting backwards from recording end - to NOT process)

Plex-DVR may have a special way - if the advice above bears no edible fruit.

1 Like

Ah cool @JuiceWSA thank you for your quick reply. The catch here I am assuming is that Plex doesn’t use Comskip or if it does it is rather obscure about it. I did a search for “Comskip” in my Plex server folder and nothing returned, unfortunately.

Plex is indeed using comskip.

Scroll down:
https://support.plex.tv/articles/115003944134-removing-commercials/

1 Like

WOOHOO! Thank you both! That is so cool that Plex integrates comskip, I had no idea. Obviously. :grin:

I have added always_keep_last_seconds=120 to my %Plex Data%\DVR\comskip.ini file. Let’s see how it does. :+1:

EDIT: Ah bummer I can’t mark both of your posts as the solution, so I’ll like them both and set mine as such.

Excellent. Now you know what setting to tweek if it misses the mark,a bit. I seem to recall a similar setting can be deployed for the front end, should you ever need it. Starts and Endings are very confusing for Comskip.

Even better, now I know who to nag if I run into any problems, and it’s not Plex. :grin: Kind of smart in that way. Running a recording now, let’s see how we do.

Fair enough.

You nag me, I’ll nag Otto.
Volunteer Support and Water always find their own level…

:wink:

1 Like

haha… I’m starting to see how things are done around here. :laughing:

Alright, unfortunately that setting did not work so I will get my nag cannon on over at the Comskip community and see what I can find. I will update this thread accordingly.

Closer inspection of the link above reveals:
comskip dot txt
is where the alteration goes…

Edit:
Exploring my own comskip dot txt file (outside Plex-DVR) I find that parameter and it has not been set. My recollection is that at one time I used it and even employed one for the front end, but I’ve been using MCEBuddy/Comskip for a decade - some interactions (on beer 10) may hold a tenuous grip on the available storage…

But I do recall it working.

The plot thickens. With Plex the exe used is Plex Commercial Skipper.exe and it only accepts the ini file from what I can see. I see now that it has a ton of capabilities, the biggest of which is exporting a file to see all the frames it detects. That’s a good first starting point, methinks. :grin:

I didn’t see the edit until now. To be sure ComSkip works amazingly awesome. It’s this last 30 seconds of credits at the end of shows that seem to be slipping out of its domain that is the last remaining matter.

Ideally, here is where a Plex-DVR-Ninja/Employee steps in to clear the waters…

MCEBuddy/Comskip ----> Plex
is a completely different animal than:
Plex-DVR/Comskip

…apparently.

Indeed and through the fog of war I see me doing what we’re doing when I determined there’s just too much going on there for Comskip to effectively deal with - what with the credits flown into a box while the next show starts, different shows being shown in the lower third and all that other nonsense humans can’t even make sense of I decided to just skip those parts… at some point… and I do recall it working as advertised.

Nowadays I only have a single PBS transmitter to receive the main PBS feed and 2 secondaries (Kids and Farm Events/Local/Stuff). The activity is slow enough I can VideoReDo everything before giving it to MCEBuddy without Comskip <— It doesn’t take long to remove ‘…blabla… and viewers like you… thank you’.

I’ll watch with interest however…

best of luck

Hrmph… Plex Commercial Remover.exe results in the following when attempting to open a .ts or .mp4 file:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Removed\Night Court (1984) - S08E22 - Harry's Fifteen Minutes-1.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2019-08-06T14:44:02.000000Z
    encoder         : HandBrake 1.2.2 2019022300
  Duration: 00:15:18.10, start: 0.000000, bitrate: 615 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 540x480, 446 kb/s, SAR 8:9 DAR 1:1, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
    Metadata:
      creation_time   : 2019-08-06T14:44:02.000000Z
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 2 channels (default)
    Metadata:
      creation_time   : 2019-08-06T14:44:02.000000Z
      handler_name    : SoundHandler
Unsupported codec!
Could not open video codec
D:\Removed\Night Court (1984) - S08E22 - Harry's Fifteen Minutes-1.mp4: could not open video codec

However, comskip.exe downloaded from comskip.org was able to process the file OK. :man_shrugging:

Very likely you are not allowed to call the Plex version standalone at the command line.
Codec licensing reasons.

Alright I think I figured this out. After spending the afternoon watching some shows in real time, it seems as if most of these stations these days simply do not put a focus on ending credits! That is, for reruns in particular, at least.

As a highlight, Home Improvement, didn’t even run credits and ran right into the next episode! So there appears to be some factors at play here:

  1. If the show is a rerun (like 90% of OTA TV outside of live news I am thinking), credits simply aren’t a priority.
  2. In the case of consecutive shows of the same type (e.g. Home Improvement) being aired one after the other, it would seem that credits aren’t aired until the last episode of the batch. I did not confirm this, but that might explain why credits in shows simply do not show up.
  3. The other scenario that I have noticed is that shows will run credits in a picture-in-picture manner between episodes, starting on the next show during its opening. So, there will be two windows: one with the credits rolling from previous show in left one, and the introduction for the new/next show running in the right one.

That said, I did set always_keep_last_seconds=120 and have set the DVR’s MINUTES AFTER END setting to 1 minute. This ensures that the last two minutes of a recording --whether it’s a commercial or not – are preserved, and there is an extra minute given in the recording just in case.

The other issue we found which is not related to this issue except for the need to edit the comskip.ini file is that some of these sneaky turkeys like to throw in mini-infomercials as a commercial “break” during a film. For instance, we found one with a Life Lock infomercial that went for five minutes (!) and was maintained because the max setting for comskip is 125 seconds. I have boosted this to 360 seconds so we’ll see how that fares.

The whole point of mentioning that is that I wanted to paste my entire comskip.ini file here in case anyone else is interested:

; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
detect_method=43			; 1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
validate_silence=1			; Default, set to 0 to force using this clues if selected above.
validate_uniform=1			; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1			; Default, set to 0 to force using this clues if selected above.
verbose=10				; show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60                       ; frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40                      ; frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25			; maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting
max_commercialbreak=600                 ; maximum length in seconds to consider a segment a commercial break
min_commercialbreak=25			; minimum length in seconds to consider a segment a commercial break
max_commercial_size=360			; maximum time in seconds for a single commercial or multiple commercials if no breaks in between
min_commercial_size=4                   ; mimimum time in seconds for a single commercial
min_show_segment_length=250             ; any segment longer than this will be scored towards show.
non_uniformity=500			; Set to 0 to disable cutpoints based on uniform frames
max_volume=500				; any frame with sound volume larger than this will not be regarded as black frame
min_silence=12				; Any deep silence longer than this amount  of frames is a possible cutpoint
ticker_tape=0				; Amount of pixels from bottom to ignore in all processing
logo_at_bottom=0			; Set to 1 to search only for logo at the lower half of the video, do not combine with subtitle setting
punish=0					; Compare to average for sum of 1=brightness, 2=uniform 4=volume, 8=silence, 16=schange, set to 0 to disable
punish_threshold=1.3			; Multiply when amount is above average * punish_threshold
punish_modifier=2			; When above average * threshold multiply score by this value
intelligent_brightness=0                ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA
logo_percentile=0.92			; if more then this amount of logo is found then logo detection will be disabled
logo_threshold=0.75
punish_no_logo=1			; Default, set to 0 to avoid show segments without logo to be scored towards commercial
aggressive_logo_rejection=0
connect_blocks_with_logo=1		; set to 1 if you want successive blocks with logo on the transition to be regarded as connected, set to 0 to disable
logo_filter=0				; set the size of the filter to apply to bad logo detection, 4 seems to be a good value.
cut_on_ar_change=1			; set to 1 if you want to cut also on aspect ratio changes when logo is present, set to 2 to force cuts on aspect ratio changes. set to 0 to disable
delete_show_after_last_commercial=0	; set to 1 if you want to delete the last block if its a show and after a commercial
delete_show_before_or_after_current=0	; set to 1 if you want to delete the previous and the next show in the recording, this can lead to the deletion of trailers of next show
delete_block_after_commercial=0		; set to max size of block in seconds to be discarded, set to 0 to disable
remove_before=0				; amount of seconds of show to be removed before ALL commercials
remove_after=0				; amount of seconds of show to be removed after ALL commercials
shrink_logo=5				; Reduce the duration of the logo with this amount of seconds
after_logo=0				; set to number of seconds after logo disappears comskip should start to search for silence to insert an additional cutpoint
always_keep_last_seconds=120
padding=0
ms_audio_delay=5
volume_slip=40
skip_b_frames=0				; Set to 1 to force Comskip to skip frames for higher processing speed.
max_repair_size=200			; Will repair maximum 200 missing MPEG frames in the timeline, set to 0 to disable repairing for players that don't use PTS.
disable_heuristics=4			; bit pattern for disabling heuristics, adding 1 disables heristics 1, adding 2 disables heristics 2, adding 4 disables heristics 3, 255  disables all heuristics
delete_logo_file=0			; set to 1 if you want comskip to tidy up after finishing
output_framearray=0			; create a big excel file for detailed analysis, set to 0 to disable
output_data=0				; create a dump of the user data channel, used for CC and XDS (such as V-Chip info). Can be use together with output_framearray to remote debug CC decoding
output_videoredo=0			; The old videoredo format
output_videoredo3=0			; The new videoredo v3 format.
output_womble=0
output_mls=0				; set to 1 if you want MPeg Video Wizard bookmark file output
output_cuttermaran=0
output_mpeg2schnitt=0
output_mpgtx=0
output_dvrcut=0
output_zoomplayer_chapter=0
output_zoomplayer_cutlist=0
output_edl=1
output_dvrmstb=0			; Set to 1 if you're running DVRMS-Toolbox
output_edlx=0
output_vcf=0
output_bsplayer=0
output_btv=0				; set to 1 if you want Beyond TV chapter cutlist output
output_projectx=0			; set to 1 if you want ProjectX cutlist output (Xcl)
output_avisynth=0
output_vdr=0				; set to 1 if you want XBMC to skipping commercials
output_demux=0				; set to 1 if you want comskip to demux the mpeg file while scanning
sage_framenumber_bug=0
sage_minute_bug=0
live_tv=0				; set to 1 if you use parallelprocessing and need the output while recording
live_tv_retries=4			; change to 16 when using live_tv in BTV, used for mpeg PS and TS
dvrms_live_tv_retries=300		; only used for dvr_ms
standoff=0				; change to 8000000 when using live_tv in BTV
cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\""
mpeg2schnitt_options="mpeg2schnitt.exe /S /E /R25  /Z %2 %1"
avisynth_options="LoadPlugin(\"MPEG2Dec3.dll\") \nMPEG2Source(\"%s\")\n"
dvrcut_options="dvrcut \"%s.dvr-ms\" \"%s_clean.dvr-ms\" "
windowtitle="Comskip - %s"

So, I think we’re set here. Thanks again to the two of you @OttoKerner and @JuiceWSA for your assistance and input. :+1:

1 Like

FWIW I cracked this riddle, in case anyone else happens upon this issue. If you look in Plex Media Server\Logs\Plex Media Server.n.log (where n is the differentiating/unique number of the log file), you will find entries such as this example:

Aug 09, 2019 06:31:00.853 [3144] DEBUG - Job running: EAE_ROOT='\\?\Z:\Plex Media Server\Cache\Transcode\Sessions\EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='Z\:\\Plex\ Media\ Server\\Codecs\\dd95667-2434-windows-x86\\' C:\Program Files (x86)\Plex\Plex Media Server\Plex Commercial Skipper.exe "--ini=Z:\Plex Media Server\DVR\comskip.ini" "--output=Z:\Broadcasts\Television Shows\.grab\bae11421040cb3019cf06cb2b01f8787566d0b79" -t --quiet "Z:\Broadcasts\Television Shows\.grab\bae11421040cb3019cf06cb2b01f8787566d0b79\Zane Grey Theater (1956) - S03E25 - Heritage.ts" 

So it would seem that Plex Commercial Skipper.exe is dependent on the FFMPEG_EXTERNAL_LIBS environmental variable as defined above and if it is not defined, the aforementioned error is thrown.

1 Like

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