Jump to content

How can Emby detect end credits from embedded MKV chapters like it detects intro/episode markers?


Recommended Posts

AngelSing
Posted

Hi,

I’m trying to understand how Emby uses embedded MKV chapters to show the Skip Intro button and whether there is a similar way to trigger the end credits / next episode button from MKV chapter names.

I have an anime episode with embedded MKV chapters created/visible in MKVToolNix. The original chapter structure is:

Prologue       00:00:00
Opening        00:01:02
Episode        00:02:31
Credits Start  00:22:14
Credits End    00:23:43

image.png.9765385ebb4430bb857d3f7e8b9d8fbe.png

 

When I import this episode into Emby and refresh metadata, Emby correctly shows the Skip Intro button at the Opening chapter time. When I click the button, it jumps to the Episode chapter time.

image.thumb.png.2f35117517af770a9cda9faeb6aaa7a8.png

 

 

 

 

 

 

 

 

 

 

 

In the Emby chapters tab, I can also see the normal MKV chapters: Prologue, Opening, Episode, Credits Start, and Credits End.

image.thumb.png.4decba56572a028e5dd3a298130845af.png

 

 

 

 

 

 

 

 

When I check the same episode in the Chapter API plugin, I can see that Emby/Chapter API has created or detected special intro markers:

Iniciar intro    Type: IntroStart   00:01:01.691
Finalizar intro  Type: IntroEnd     00:02:31.243

The normal MKV chapters still appear as type Chapter.

image.thumb.png.dbb65fda3b5627c94cb09041f9cac1be.png

 

 

 

 

 

 

 

This confirms that Emby is somehow able to use the embedded MKV chapter structure to create or detect the intro skip markers. What I cannot get working is the end credits button.

I tried renaming the final chapters in the MKV in several ways:

Credits Start
CreditsStart
Credits End
End

But Emby still keeps them as normal Chapter entries and does not create a CreditsStart / StartCredit marker. The end credits / next episode button does not appear at 00:22:14, which is where the credits actually start.

In Chapter API, I can see that CreditsStart is a valid type in the dropdown.

image.png.3578607a2446d31e99e32e516fb400a0.png

My question is:

Is there a specific MKV chapter name, format, marker type, or metadata structure that Emby recognizes to automatically create a real CreditsStart / StartCredit marker from embedded MKV chapters?

What I want is this:

Embedded MKV chapter:
Credits Start  00:22:14

to be recognized automatically by Emby as:

CreditsStart / StartCredit marker at 00:22:14

without manually editing every episode one by one in Chapter API.

I know Chapter API can add CreditsStart manually, but I have many episodes and I don’t want to manually edit each episode. I’m looking for a way to make Emby recognize the credits start from the MKV chapters during metadata refresh or chapter scan.

Is this currently possible?

If not, is there any server setting, naming convention, scheduled task, plugin, or supported workflow that can automatically convert embedded MKV chapters like Credits Start into real Emby CreditsStart markers?

Thanks.

yocker
Posted

I'm working on a feature to have EmbyCredit read the embedded timestamps and import them to Emby so they will work.
That should do pretty much what you are asking for, if i understand your question correctly.

I can't promise when it will be done as i'm taking a vacation from most computer stuff here in the summer but, the code is nearly there.

  • Like 1
crusher11
Posted
5 hours ago, AngelSing said:

This confirms that Emby is somehow able to use the embedded MKV chapter structure to create or detect the intro skip markers.

No, it doesn't. That's not how intro detection works.

It scans through the audio of each episode, and looks for a short section that is identical on every episode. This gets marked as the intro. MKV chapter markers are irrelevant to the process; it will work regardless of what the chapter is named or even if there is no chapter marker at all.

This plugin claims to do the same with end credits, though I've never used it:

 

  • Like 1
yocker
Posted (edited)
5 hours ago, crusher11 said:

No, it doesn't. That's not how intro detection works.

It scans through the audio of each episode, and looks for a short section that is identical on every episode. This gets marked as the intro. MKV chapter markers are irrelevant to the process; it will work regardless of what the chapter is named or even if there is no chapter marker at all.

This plugin claims to do the same with end credits, though I've never used it:

 

It does, just not reading mkv data.. yet.

Edit: should clarify I'm talking about EmbyCredit.

Edited by yocker
  • Agree 1
AngelSing
Posted
3 hours ago, yocker said:

It does, just not reading mkv data.. yet.

Edit: should clarify I'm talking about EmbyCredit.

Greetings,

So, according to what you mentioned, the chapters included in the MKV file were not responsible for generating the markers to skip the intro. Instead, Emby analyzes the audio to determine the exact moment to insert those markers.Do you know why it is not able to apply the same procedure to create buttons at the end of the episode?

AngelSing
Posted
Seven hours ago, Yocker said:

I'm working on a feature that will allow EmbyCredit to read the embedded timestamps and import them to Emby, so they will work. That should do pretty much what you are asking for, if I understand your question correctly. I can't promise when it will be done, as I'm taking a break from most computer-related activities over the summer, but the code is almost ready.

Thank you so much for your dedication. It would be great if I could use that feature soon. The truth is, I have a lot of series with many episodes, and setting the bookmarks one by one is a never-ending task. But the MKV files already have the episodes embedded in the right places, so I thought, “Why not take advantage of that to generate the bookmarks?” The thing is, I didn’t know that wasn’t possible in Emby yet.

yocker
Posted
3 hours ago, AngelSing said:

Greetings,

So, according to what you mentioned, the chapters included in the MKV file were not responsible for generating the markers to skip the intro. Instead, Emby analyzes the audio to determine the exact moment to insert those markers.Do you know why it is not able to apply the same procedure to create buttons at the end of the episode?

I remember seeing a post from the developers stating that it was too unprecise for them to use as end credit.
I agree with them that chroma print can be rather hit and miss for end credits at times, EmbyCredits uses a couple more methods together with Chroma print to try and be more precise though OCR detection is king.
 

3 hours ago, AngelSing said:

Thank you so much for your dedication. It would be great if I could use that feature soon. The truth is, I have a lot of series with many episodes, and setting the bookmarks one by one is a never-ending task. But the MKV files already have the episodes embedded in the right places, so I thought, “Why not take advantage of that to generate the bookmarks?” The thing is, I didn’t know that wasn’t possible in Emby yet.

Glad to do it if it helps people.
I can't promise when it's done but it's almost finished so won't take long as soon as i get back to it.
Until then, if you don't want to run your own detections there is another great plugin you can use that uses a library of time stamps and imports those instead:
 

TheIntroDB/emby-plugin: An Emby plugin to skip intros, recaps, and credits with TheIntroDB

 

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...