cjmanca / plex-credits-detect

Augments plex's built in intro detection, additionally detecting credits.
MIT License
113 stars 5 forks source link

Not getting any ini in any media folder? #56

Closed tylerreed19 closed 2 years ago

tylerreed19 commented 2 years ago

Hey love the concept. I have v1.1.0, everything seems to be running smooth though when it scanned my TV Shows library it flew through it and only ever showed Detection Took 1 or whatever. Mind you I have over 3,000 TV Shows so I kinda expected it to take a while. Now it is scraping movies and taking much longer but still only 1 movie it shows... Black frames found from 7080.71 to 7322.71. Duration 242.00. Black frames found from 7762.71 to 7783.71. Duration 21.00. Inserting match: from 7080.71 to 7322.71. Duration 242.00 Inserting match: from 7762.71 to 7783.71. Duration 21.00.

Detection took 1:29:32.7674252

The rest just say Detection took etc and I'm not seeing any ini files in any TV show folder, season folder or movie folder. Including the one that spat out the Inserting Match. What's wrong? And I have no Shows with the skip credits option. Yes I have plex pass. Attached is my ini. Redacted name in path with *****

[directories]

[intro]
introStart = 0
introEnd = 0.5
introMaxSearchPeriod = 900

[credits]
creditsStart = 0.75
creditsEnd = 1.0
creditsMaxSearchPeriod = 600

[matching]
useAudio = true
useVideo = false
introMatchCount = 0
creditsMatchCount = 1
quickDetectFingerprintSamples = 5
fullDetectFingerprintMaxSamples = 10
audioAccuracy = 4
stride = 512
sampleRate = 5512
minFrequency = 100
maxFrequency = 2750
videoAccuracy = 2
videoSizeDivisor = 50
frameRate = 1

[silence]
detectSilenceAfterCredits = true
silenceDecibels = -55

[blackframes]
detectBlackframes = true
blackframeOnlyMovies = true
blackframeUseMaxSearchPeriodForEpisodes = true
blackframeUseMaxSearchPeriodForMovies = false
blackframeScreenPercentage = 75
blackframePixelPercentage = 2
blackframeMovieMinimumMatchSeconds = 20

[timing]
shiftSegmentBySeconds = 2
minimumMatchSeconds = 20
PermittedGap = 3
PermittedGapWithMinimumEnclosure = 10

[redetection]
crawlDirectoriesOnStartup = false
recheckBlackframesOnStartup = false
recheckSilenceOnStartup = false
recheckUndetectedOnStartup = false
forceRedetect = false
redetectIfFileSizeChanges = true

[monitoring]
monitorPlexIntros = true
monitorDirectoryChanges = true

[paths]
databasePath = C:\Users\******\AppData\Roaming\plex-credits-detect\database
PlexDatabasePath = C:\Users\******\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db
TempDirectoryPath = C:\Users\******\AppData\Roaming\plex-credits-detect\temp
ffmpegPath = C:\Users\*****\Desktop\plex-credits-detect-1.1.0\net6.0\ffmpeg.exe
tylerreed19 commented 2 years ago

Capture

cjmanca commented 2 years ago

It doesn't create ini files in your media folders. If you create one, then it'll honor those settings and use them to override the global ini, but otherwise it assumes you just want to use the global ini settings for everything.

The black frame detection (used for movies only by default) takes significantly more processing power than the audio matching used for episodes, since it has to analyze the video frames rather than just audio. It's also far from perfect. It can only detect standard "text on solid black background" usually, and won't match animated/stylized credits, or credits on a different colored background other than black.

I've also found that sometimes credits with "walls of text" will cause it to not detect, simply because there's too much non-black on the screen.

Eventually I'd like to write a better replacement for this, but that won't be for some time.

That said - those detection times are significantly longer than I'd expect. For me, it takes about ~2-10 minutes per movie, although I also only have 1080p movies. Not sure how 4k would compare, time wise.

As for the TV shows going super fast - did it actually show fingerprinting/detecting/inserting? Or just "needs scanning" messages? It builds up it's database of things that it needs to scan initially, and then goes through and scans those things after in alphabetical order, so I suspect that what you thought was going super fast was just it's initial "building up the list of things to scan", and now it's started going through and doing the scanning. I'm guessing your movies library is before your TV library, alphabetically, so it's scanning that first.

You say you have 3000 TV shows though? Or did you mean 3000 episodes? The log shows 456 directories to scan (each movie will probably be it's own directory, but each season of a TV show would also be a directory), and that's far from the 3000 you specified, so it makes me wonder if maybe it had trouble finding some of the paths.

tylerreed19 commented 2 years ago

I did have an issue where my pc restarted last night without me knowing and I have this set to run at startup so it's now only on movies. But I cannot recall what it said for shows unfortunately as it has moved on to only the movie portion now. So I'm guessing I'll have to delete the dB file and check it again? Is there a method to just rescrape tv shoes launching a second window because I really do not want to interrupt the movie one that is currently scanning as it is taking forever on these 4ks. Also it's an old PC I mainly only use for my Plex server which could explain why it's extra slow.

But regardless on no Shows have I seen the skip option for credits and I ran through an episode of each of my shows.

Also yes 3,000 episodes not shows

cjmanca commented 2 years ago

Definitely don't run a second instance. You're just asking for trouble with 2 copies running on the same database.

No need to delete the database just to find the number. If there's a known reason for why it's lower (and restarting during the process explains it), then that's fine. It's designed to be able to resume at any point. I only mention it since it stuck out as a possible issue of not seeing everything.

As for having the skip button on shows - it depends on the show. Keep in mind that it uses the audio to locate the credits. Some shows use different songs for every episode, so it wouldn't be able to find them in that case.

I find that it works particularly well for Anime, since most anime will use the same credits theme in every episode. For western TV shows it can be hit and miss, depending on the show.

To force it to re-scan series that have already been scanned, you can use: recheckUndetectedOnStartup = true crawlDirectoriesOnStartup = true

This will force it to go through the entire directory structure in your media libraries and attempt to re-detect anything that doesn't yet have credits detected. Whether it finds anything new is questionable, but it will attempt it.

tylerreed19 commented 2 years ago

Okay cool that helps explain some things. I am wondering that being that I download every episode individually (for the most part) that the slight changes in audio quality in video files causes it to not pick up certain episodes. For example Family Guy is very consistent with their credits sequence as well as their intro yet even plex only detects about half the intros and I'm noticing your software seems to be preforming the same way.

Good news is it is progressing through my TV Shows now as I have them spread across multiple drives, it seems to start on a drive and run through all libraries (movies and shows) on that drive. So I think I have narrowed it down to what drive it kind of flew through.

It has been running for 3 days straight now. My longest 4k detection took 8 hours. They definitely take more than double 1080p time. I'd say average 1.5-2 hours per. And I have a lot of 4k. Currently on directory 265 out of 456. But I've checked some shows and movies it does insert matches for and it is working.

One annoying thing I've found that Plex itself does is, at least on my Samsung TV Plex app tizen, if I scroll through a show to get to the credits to see if the button will appear, and accidentally fast-forward even a second over the detection time the button will not show, even if I rewind and play.

Also I have noticed a few shows like another user pointed out when I click the initial skip intro for the intro it skips past the whole show to the end of the credits. My question is, is there a way to manually edit the ini for that specific show to type in my own numbers for intro/credit timings?

tylerreed19 commented 2 years ago

20220920_214151 Crazy!

cjmanca commented 2 years ago

This is still on my radar (the foreign key violation). I've seen this show up a couple of times in my installation too, and will be trying to track it down, just been a bit busy this week.

As for the credits button not appearing, etc - most likely specific to that player.

The timings are stored in it's SQLite database, and also in the Plex database it's self. You could use a browser like SQLiteStudio to browse through and see them. When I have a bit more time, I can guide you through trying to get some of the problem timings for me to verify if it's an issue with the timings or just a player bug. If you have some time, you could try to find them yourself though.