Jump to content

Plugin: EmbyCredits, detect end credits and add auto skip.


Recommended Posts

frankythedog
Posted

Hello,

 

I tried this plugin.

My library is organized with 2 NAS, and I'm using the samba protocol to reach some files.

While using the plugin, I get a "file not found" error message when the file is reached with samba and seems working well when files are in a local  directory.

An idea why ?

 

Thanks for the good work already done.

credits-detection-debug-2025-12-29T22-59-58.log

  • Thanks 1
Posted (edited)
12 minutes ago, frankythedog said:

Hello,

 

I tried this plugin.

My library is organized with 2 NAS, and I'm using the samba protocol to reach some files.

While using the plugin, I get a "file not found" error message when the file is reached with samba and seems working well when files are in a local  directory.

An idea why ?

 

Thanks for the good work already done.

credits-detection-debug-2025-12-29T22-59-58.log 3.07 kB · 0 downloads

There is a very simple reason for that.. I didn't take SMB into account when i made the plugin. 😵‍💫
I will add support for it now.

Thank you for reporting it!

Edited by yocker
Posted
On 12/28/2025 at 5:00 PM, DarWun said:

Thanks! I did read that post. I'll follow the new instructions to change the container as soon as the scan that is currently in progress finishes.

I did a scan of Buffy the Vampire in my library. The first title card in the end credits is "Executive Producer", which based on the logs was identified by the OCR recognition.

image.png.68c3ca147225707e620ac7ab8f59a5e1.png

The log states end credits were detected. 

2025-12-29 18:30:54.014 Debug Plugin: [OCR Detection] Frame at 41:10: Found 1 keyword(s): executive producer
2025-12-29 18:30:54.014 Info Plugin: [OCR Detection] Found sustained keyword detection: 2 matches within 10s starting at 41:08
2025-12-29 18:30:54.014 Info Plugin: [OCR Detection] Credits detected at 41:08 via OCR keyword matching

Yet no end credit marker has been set.

Log attached with detailed logging enabled.

 

embyserver.txt

Posted (edited)
On 12/28/2025 at 5:00 PM, DarWun said:

Thanks! I did read that post. I'll follow the new instructions to change the container as soon as the scan that is currently in progress finishes.

Sorry for my ignorance on docker, but how do I remove/stop the previous docker installation of Tessaract? I followed the updated instructions, and Tessaract won't install on account of there already being a docker instance. I've tried to stop the previous container using "docker stop $(docker ps -a -q)". But that does not seem to be working.

Updated to add:  Never mind I was able to remove the previous container using "Container Manager" on my Synology NAS. The "docker stop" command did indeed stop it. But it did not actually delete it so that the new container could be installed.

Edited by DarWun
Posted (edited)
51 minutes ago, DarWun said:

I did a scan of Buffy the Vampire in my library. The first title card in the end credits is "Executive Producer", which based on the logs was identified by the OCR recognition.

image.png.68c3ca147225707e620ac7ab8f59a5e1.png

The log states end credits were detected. 

2025-12-29 18:30:54.014 Debug Plugin: [OCR Detection] Frame at 41:10: Found 1 keyword(s): executive producer
2025-12-29 18:30:54.014 Info Plugin: [OCR Detection] Found sustained keyword detection: 2 matches within 10s starting at 41:08
2025-12-29 18:30:54.014 Info Plugin: [OCR Detection] Credits detected at 41:08 via OCR keyword matching

Yet no end credit marker has been set.

Log attached with detailed logging enabled.

 

embyserver.txt 37.24 MB · 0 downloads

Ignore this post for now. After following the instructions to update Tessaract and updating to the most recent .dll I started a new end credit scan. And now end credits are being marked for episodes that they previously were not. I'll let the scan finish overnight and post the final log file.

image.png.7fd291ae01d0552eeea59c74e26bbd7b.png

Edited by DarWun
  • Thanks 1
Posted

Thank you for reporting back on that. :) 

Posted

@gibman
image.thumb.png.d93ba41658c3e3e3919d35df1129ce43.png
Will be in the next version.

  • Like 1
Posted

Last version before new year (v1.1.9.0) is up.

  1. Ability to manually change the time stamps.
  2. Function to skip files that already have had detection done on them and/or already have time stamps.
  3. Paralle processing, this will allow the plugin to process multiple frames at time to make the detection faster, please note this will require extra CPU and might be too much for smaller systems.
  4. Added overwrite option in the backup and restore.

Changed:

  1. Changed the UI to be less cluttered.
  2. Various stuff in the code.

Fixed:

  1. Fixed the ETA not working properly.
Posted (edited)
4 hours ago, yocker said:

Last version before new year (v1.1.9.0) is up.

  1. Ability to manually change the time stamps.
  2. Function to skip files that already have had detection done on them and/or already have time stamps.
  3. Paralle processing, this will allow the plugin to process multiple frames at time to make the detection faster, please note this will require extra CPU and might be too much for smaller systems.
  4. Added overwrite option in the backup and restore.

Changed:

  1. Changed the UI to be less cluttered.
  2. Various stuff in the code.

Fixed:

  1. Fixed the ETA not working properly.

Thanks for the latest update @yocker. I stopped the previous scan to install the new version. It had been running for about 18hours and was only about 6% complete, so I didn't lose much. One thing I noticed with v1.1.9.0 is that it no longer provides a live update of failed/successful credit detection like the previous version did.

image.thumb.png.13f4633bb23c9fb08d80c053fdb8a6af.png

Three out of 64 episodes have been scanned. But there is no indication as to whether or not end credits have been detected. In the previous version the plugin was providing realtime updates.

image.png.fafeec4540fd6e2fb3b3a16cfa239d10.png

Was the live update of success/failure removed in v1.1.9.0?

 

Edited by DarWun
Posted
6 minutes ago, DarWun said:

Thanks for the latest update @yocker. I stopped the previous scan to install the new version. It had been running for about 18hours and was only about 6% complete, so I didn't lose much. One thing I noticed with v1.1.9.0 is that it no longer provides a live update of failed/successful credit detection like the previous version did.

Three out of 64 episodes have been scanned. But there is no indication as to whether or not end credits have been detected. In the previous version the plugin was providing realtime updates.

Was the live update of success/failure removed in v1.1.9.0?

I figured it out. The live update of success failure still occurs for a full scan started as a scheduled task. It does not occur if a manual scan is started for a single series.

Are there plans to provide live updates for manual scans of individual series?

Posted (edited)
3 hours ago, DarWun said:

I figured it out. The live update of success failure still occurs for a full scan started as a scheduled task. It does not occur if a manual scan is started for a single series.

Are there plans to provide live updates for manual scans of individual series?

It should work.
image.thumb.png.ba143eb9283d181d474e5e527586d2c5.png

Try and clear the browser cache.

If that doesn't work please start a dry run with debug on a small series and send me the log.
I will see if i have time to look into it before all the festivities start. :) 

Edited by yocker
Posted
On 12/30/2025 at 12:07 AM, frankythedog said:

Hello,

 

I tried this plugin.

My library is organized with 2 NAS, and I'm using the samba protocol to reach some files.

While using the plugin, I get a "file not found" error message when the file is reached with samba and seems working well when files are in a local  directory.

An idea why ?

 

Thanks for the good work already done.

credits-detection-debug-2025-12-29T22-59-58.log 3.07 kB · 1 download

I forgot to write back to you.
The latest version has a fix to SMB that should make it work.

Posted

Your plugin does it indeed create a chapter named "Credits" as I can verify in MKVToolNix GUI tool.

But none of my Emby clients seem to care about this.

I then installed the chapter API plugin and loaded one of the culprit episodes.

What I found out was that the episode "fixed" by the EmbyCredits plugin did not have the correct Type set (see image nr 2).

The name does not seem to matter though. But the type needs to be "CreditsStart".

I think this is written to the internal DB of Emby and not written to the MKV file itself.

 

This working example here renders the "next episode" button in the OSD correctly.
I manually deleted the chapter created by your tool.
Then manually created a new one called AnyName with type "CreditsStart" (rendered in red). Presto it worked.

image.png.eada43c9d859c5e6c3a384285f9775f7.png

 

This example here does not render the "next episode" button in the OSD. This is from an episode fixed by your EmbyCredits plugin.
As you can see the Type is merely set as "Chapter" (green).


image.png.1408516918132ddcde436f77697eb5c1.png

 

So. Am I missing something here or does your tool need to take this into account also ?

 

btw. Happy new year :)

 

Posted
4 minutes ago, gibman said:

Your plugin does it indeed create a chapter named "Credits" as I can verify in MKVToolNix GUI tool.

As far as I know the plugin does not write to your media files, only to Library.db.

So what ever you see in the file using MKVToolNix was already there, before using the plugin.

Example.

image.png.d5012385b0eaa8d3193a2801af76b3e6.png

image.thumb.png.8f77a174fd2770959c921cb7284e6bcf.png

Here is a episode I have not processed with this plugin.

image.png.c1adbcb6e98877f3a2ca99f62ac698ea.png

image.thumb.png.822da240e5870b14c2a6017caec67d60.png

Those are in the MKV file with out involvement by this Plugin.

  • Thanks 1
Posted

Hi people 😁

@yockerhad to rush out of the house, to get to a New Years parti 🎉🎇🎆

But he / she / it had me test this version.

And its again packed with new features 😁

But it also fixes issues with Dry run with debugging sending logs before job finish.

And Manuel processing not showing Successes / Failed.

Have a go at it, and I guess he / she / it will be back after New years, with more fun stuff 😂🤣 

image.png.e77b290f5f7b922eeeab9116f85ac665.png

EmbyCredits.dll

  • Like 1
frankythedog
Posted (edited)
10 hours ago, yocker said:

I forgot to write back to you.
The latest version has a fix to SMB that should make it work.

Hello,

 

I tried the version 1.1.9.0 and SMB path are always not reachable 😞

I want to clarify that I've checked and Emby can read these files without any problems.

 

credits-detection-debug-2025-12-31T13-28-57.log

Edited by frankythedog
Posted

@frankythedoghow are you smb share mounted?

Is it mounted at OS level?

Or are you using direct smb in emby as a path ?

I mount my network shares at OS level then set it up as a normal path in Emby library.

Like this its working great.

image.png.cd30e85375fdbd3229a9e9d489ab2b8c.png

Using unRaid so it might be different for your OS.

image.thumb.png.99e9e1f65cfdd1b8656e3813a41c8601.png

 

Posted (edited)

I have found an issue with the series averaging methodology for setting the end credit start marker. Episodes of Burn Notice in my library are around 43 to 44minutes long. For the first three seasons, end credit marker start times varied and appeared reasonable.

image.png.9fb2f5ca596d4bd437ce85bba8f50750.png

Then starting with Season 4, no end credits were detected in the OCR scans. This is not surprising, as the end credits were missing from most of the Season 4 episodes in my library. Based on the average time where the end credit marker was set for the prior three seasons, the plugin set the end credit marker at 44:11.

image.png.92711b81f9a409d56834d5e6ca1728d7.png

image.png.57d16edaa4783399da2e80f72f543efd.png

The problem is 44:11 is past the end of the episode as most episodes in Season 4 are only 42minutes long. The average time where end credits started for the prior three seasons based on 23-26 episodes where the end credit scan was successful is actually around 42minutes. But there was one, 1.5hour long movie where the end credits started at 1:29:13. Factoring that in, the average end credit start is around 44minutes. So I understand why the plugin used that time to set the end credit marker. However, the plugin should probably check the length of the episode before doing so. If the episode length is less than the average the plugin has determined, then the end credit marker should not be set.

embyserver.txt

Edited by DarWun
Posted
27 minutes ago, DarWun said:

averaging methodology

Was removed in this version, as it was flaky / wonkery at best.

Not sure if it will return later, in a new form.

Only Dev can answer this, but dev is out of town atm.

  • Thanks 1
Posted
10 minutes ago, Neminem said:

Was removed in this version, as it was flaky / wonkery at best.

Not sure if it will return later, in a new form.

Only Dev can answer this, but dev is out of town atm.

Thanks. Looking at the end credits that have been successfully set over the last 20hours for the scan I started yesterday, the end credits are based on the average for quite a few of them. So I have a bit of clean-up to do to delete the credit markers for those series. Once I've done that I'll update to the new version of the plugin and give it another go.

I think I'll limit my testing to single series moving forward instead of initiating a full library scan.

  • Like 1
Posted
6 minutes ago, DarWun said:

I think I'll limit my testing to single series moving forward instead of initiating a full library scan.

I'm doing the same testing on a separate testing server.

Although same library but mounted as a RO library. 

  • Like 1
frankythedog
Posted
4 hours ago, Neminem said:

@frankythedoghow are you smb share mounted?

Is it mounted at OS level?

Or are you using direct smb in emby as a path ?

I mount my network shares at OS level then set it up as a normal path in Emby library.

Like this its working great.

image.png.cd30e85375fdbd3229a9e9d489ab2b8c.png

Using unRaid so it might be different for your OS.

image.thumb.png.99e9e1f65cfdd1b8656e3813a41c8601.png

 

I don't mount them; I use direct SMB access.

Previously, I used an NFS mount, but since my NAS devices each have six disks, I sometimes had unmounting problems, which prevented the NAS devices from shutting down properly automatically.

So, I rebuilt my library, using almost exclusively SMB.

Posted (edited)
9 hours ago, Neminem said:

I'm doing the same testing on a separate testing server.

Although same library but mounted as a RO library. 

 

@yocker@NeminemI cleaned up the credit markers for all episodes that had been set based on the average end credit time. I then installed v1.2.3.0 of the plugin and initiated an end credit scan for a single series in my collection. The plugin is now reporting live success/fail results as individual episode scans are completed for a single series. It definitely was not with v1.1.9.0...I confirmed before updating to v1.2.3.0.

After upgrading I still was not having much success with end credit detection on the one series I chose to test with. OCR detection was picking up the text from the very first end credit title card. But it was not picking up anything past that so the end credit detection was failing. I checked the credits, and the defined key words were there after the first title card...the plugin just wasn't detecting them. That changed when I disabled "Smart Frame Skipping". With that option enabled, the plugin was skipping past the title cards with defined key words that would have fulfilled the criterion for "two key words detected within 10seconds".

My final thought before I log out for the year...do you really need to rely on detection of specific key words to determine end credit start location? On reviewing the logs, I can see that prior to the first credit screen OCR is detecting four characters. Once the credits are reached, OCR detects 20, 100, 200, etc. characters on subsequent images scanned in sequence. Shouldn't multiple detections of screens with a number of characters over a certain threshold be enough to flag that the end credits have been reached? The reliance on key words alone seems unreliable in my tests so far. Credit text varies too much between series, even between episodes for a single series. In my test series the first end credit title card is "Executive Story Editor". I added that as a key word, and credits were marked after doing so. But then the first end credit title card changed to "Director of Photography" part way through the first season. At that point end credits were no longer detected by the plugin even though "Executive Story Editor" still showed up later in the credits along with other key words.

Happy New Year!!!

Edited by DarWun
gibman
Posted

Am I the only one that get a lot of "No frames extracted for OCR analysis" errors in the log (v 1.1.4.0)?
Initially I thought it could be corrupt video files but they seem to playback just fine without any visible corruption.

Also I find I have to restart Emby in order to be able to use the "process selection" for a specific show/episode.
Tried clear queue. Does nothing to remedy this 😕

Once I have used "process selection" I then have to restart if I want to try it again.

yocker
Posted
17 hours ago, DarWun said:

 

@yocker@NeminemI cleaned up the credit markers for all episodes that had been set based on the average end credit time. I then installed v1.2.3.0 of the plugin and initiated an end credit scan for a single series in my collection. The plugin is now reporting live success/fail results as individual episode scans are completed for a single series. It definitely was not with v1.1.9.0...I confirmed before updating to v1.2.3.0.

After upgrading I still was not having much success with end credit detection on the one series I chose to test with. OCR detection was picking up the text from the very first end credit title card. But it was not picking up anything past that so the end credit detection was failing. I checked the credits, and the defined key words were there after the first title card...the plugin just wasn't detecting them. That changed when I disabled "Smart Frame Skipping". With that option enabled, the plugin was skipping past the title cards with defined key words that would have fulfilled the criterion for "two key words detected within 10seconds".

My final thought before I log out for the year...do you really need to rely on detection of specific key words to determine end credit start location? On reviewing the logs, I can see that prior to the first credit screen OCR is detecting four characters. Once the credits are reached, OCR detects 20, 100, 200, etc. characters on subsequent images scanned in sequence. Shouldn't multiple detections of screens with a number of characters over a certain threshold be enough to flag that the end credits have been reached? The reliance on key words alone seems unreliable in my tests so far. Credit text varies too much between series, even between episodes for a single series. In my test series the first end credit title card is "Executive Story Editor". I added that as a key word, and credits were marked after doing so. But then the first end credit title card changed to "Director of Photography" part way through the first season. At that point end credits were no longer detected by the plugin even though "Executive Story Editor" still showed up later in the credits along with other key words.

Happy New Year!!!

You mean character density detection?
Not a bad idea.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...