Generating New Intro Markers on Existing Show in Library

I’ve got a few shows that I’ve replaced with higher quality versions, as well as some shows, such as The Office that I have replaced with the superfan cuts. Originally, I put the regular episodes in and my intro markers were pretty spot on. Once I replaced them with the superfan cuts, the intro markers are off, or non-existant now for some episodes because the the lengths and intros happen at different times on some episodes. I’ve selected the show and used the “Analyze” function, but that doesn’t seem to do much. Is there a way to force Plex to delete the existing intro markers and generate entirely new ones, because overwriting the existing ones doesn’t seem to be working.

I came across this: GitHub - danrahn/MarkerEditorForPlex: View, edit, add, and delete intro and credit markers for your Plex media., but I assume it most likely doesn’t work because of how old it is.

Does reanalyzing individual seasons/episodes instead of the show help at all? Analyzing at different levels will perform different operations, and IIRC if the underlying file has changed (even if the file name is the same), that should trigger reanalysis of intros.

As for

It should still work (I’m the creator), and I haven’t had any issues on my Windows system running the latest 1.41.4 PMS beta. Plex’s database hasn’t had any significant changes in the last ~6 months that would affect the marker editor, and there is a beta version that’s a bit newer, but I admittedly haven’t had much time for side projects lately. That said, the program is still a hack at its core, modifying the database directly to add/edit/delete markers, and manual adjustments will get overwritten by Plex if the movie/season/episode is ever reanalyzed.

I’ve Analyzed the show at the “Show” level by selecting all seasons and choosing Analyze from the menu. I’ve also done it at the season level, going into each season and selecting all the episodes and choosing Analyze. At the season level, I saw the console detect intros moreso than I did at the show level, but when I went to play an episode, the automatic skip intro setting I had didn’t work. It wasn’t even off by a bit. It simply didn’t skip it at all.

Not sure what’s going on unfortunately, outside of the intro being different enough for some episodes that Plex doesn’t think the intro exists. I’m assuming there aren’t any intro <Marker>s listed when you use Get Info > View XML on the episodes that don’t skip?

<Marker id="175460" type="intro" startTimeOffset="1733" endTimeOffset="98387">
  <Attributes id="175460"/>
</Marker>

The only sure-fire way I can think of to reset things would be to do the Plex Dance with the season/show, but that’s pretty destructive - they’ll show up as recently added and you’ll lose any metadata customizations (and watch status if you don’t have watch state sync enabled). You could also delete the intro detection data from the blobs database directly, but I’d wait to see if anyone has any better advice before doing any manual database tinkering.

Yeah I randomly spot-checked some episodes. Some have the attribute, and some don’t. When I go to analyze the ones I found that didn’t at the episode level, it still didn’t add it in.

Have any of you considered using the PMS scanner command line?

Works for me when I replace items that I have replaced…

You would run this on a per episode basis…

"C:\Program Files\Plex\Plex Media Server\Plex Media Scanner.exe" --analyze --server-action intro --item %RatingKeys% --log-file-suffix " Manual Intro Analysis"

EDIT: Scratch that… I’ve been using this for years now and it used to work but doesn’t any more…

The log file generated shows work is being done, but it doesn’t seem to get written to the DB.

Damn!!

Ok, so everything I try to manually generate intro markers fails to get a result, however I’m pretty sure it will happen naturally when the scheduled tasks run during maintenance, as plenty of other items do have markers.

What makes you think that it will work during a scheduled task? It’s performing the same actions, it’s just whether or not it happens later or forcing it now.

Because items that I replaced after converting them from x264 to x265 now have markers…

Like I said, I’ve been using the command line for some years now and it used to work a treat, but obviously at some point that stopped working.

The above example has obviously been parsed with the scheduled butler and now has markers, so as long as you have set your scheduled tasks appropriately, they should eventually get markers.

This is how I have mine set, and the only reason I chose NOT to do when I add new media is because I am constantly adding and changing new media.

I have a script on my server that runs these items at the time of my choosing, that way I can add and change things and the server won’t be flat out performing these tasks immediately on add / change…

"C:\Program Files\Plex\Plex Media Server\Plex Media Scanner.exe" --analyze-deeply --item %RatingKeys% --log-file-suffix " Manual Deep Analysis"

"C:\Program Files\Plex\Plex Media Server\Plex Media Scanner.exe" --analyze --manual --server-action intro --item %RatingKeys% --log-file-suffix " Manual Intro Analysis"

"C:\Program Files\Plex\Plex Media Server\Plex Media Scanner.exe" --analyze --server-action credits --item %RatingKeys% --log-file-suffix " Manual Credits Analysis"

"C:\Program Files\Plex\Plex Media Server\Plex Media Scanner.exe" --generate --chapter-thumbs-only --item %RatingKeys% --log-file-suffix " Manual Chapter Thumbnails" --force

Like I said, the command line used to work but is obviously now broken, however markers will still be generated by the butler if you have it set.

Great. So now I just have to figure out if this is possible on a QNAP

Yeah, can’t help you with commands on a NAS, but just make sure you have set your library schedules and then wait till tomorrow to see the results…

It’s already set as a scheduled task but idk when it’ll get to the shows I want it to. My library is quite large.

I hope someone has a better solution…

Have you analyzed at the episode level? I believe that selecting all episodes in a season and hitting “analyze” is what can trigger intro detection on my server. I believe I read the entire topic, and didn’t see you explicitly say that you did every episode by selecting each episode, only on a “show” and “season” level.

I’m kind of surprised that it didn’t do an intro detect when you replaced the file, but I have found some files that had bad intro markers after I replaced them with alternates, and they must not have checked intros.

Plex is odd sometimes.

You apparently didn’t read the entire topic. I did explicitly say that on this post. Generating New Intro Markers on Existing Show in Library - #3 by apennismightier. I selected all seasons and all episodes. Analyzed. Doesn’t work.

Can you hit analyze for an episode that doesn’t have the marker then upload the logs? It’s possible it is working and just can’t find the intro.

WebTools NG allows you at least to trigger one or several of the scheduled tasks manually. Which means there is a network server API for that.

1 Like

Here’s a shell script for QNAP to run the scanner

#!/bin/sh
 
# Name of Plex Media Server install directory.
QPKG_NAME="PlexMediaServer"
 
# Location of QPKG conf file.
Config=/etc/config/qpkg.conf
 
# Grab Plex Media Server install directory, regardless of disk layout.
QPKG_DIR=$(getcfg -f $Config $QPKG_NAME Install_path)
 
# Set env
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${QPKG_DIR}/Library"
 
# Path to the scanner
SCANNER="$QPKG_DIR/Plex Media Scanner"
 
"$SCANNER" $1 $2 $3 $4 $5

So copy above to a file, and name it like scanner.sh
Then make sure you can execute it: chmod +x scanner.sh

You can now run the scanner like ./scanner.sh that will give you all the params to use

To list sections (libraries) run it like ./scanner.sh -l

To list contents in a section, like section 36 run it like:
./scanner.sh -l --section 36 which will produce something like:

76949: 2:22
76948: 187 – Eine Tödliche Zahl
76953: Entertainment
76959: Show Me Love

Above shows the item id and the title

Edit: See https://support.plex.tv/articles/201242707-plex-media-scanner-via-command-line/

1 Like

And to kickoff the butler task using the API, it would be a POST request towards the PMS as:
http://{IP-OF-PMS}:32400/butler/ButlerTaskGenerateIntroMarkers?X-Plex-Token={YOUR-TOKEN}&X-Plex-Client-Identifier={SomeRandomString}

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