Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

yes, thank you.

I'm watching this schedule task run, and maybe because my development machine is not as fast as the server, but the server is rippin' through episodes finding intro data much faster then I thought it would. LOL!

 

Edit: darn failed... back to the drawing board, find out what happened.

It got this far:

<Intros>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32973</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M1S</IntroStart>
      <IntroEnd>PT2M31S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32974</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M</IntroStart>
      <IntroEnd>PT2M30S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32975</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M32S</IntroStart>
      <IntroEnd>PT3M2S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32976</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT1M56S</IntroStart>
      <IntroEnd>PT2M26S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32977</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT1M50S</IntroStart>
      <IntroEnd>PT2M20S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32978</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M29S</IntroStart>
      <IntroEnd>PT2M58S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32979</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M2S</IntroStart>
      <IntroEnd>PT2M32S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32980</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M12S</IntroStart>
      <IntroEnd>PT2M42S</IntroEnd>
    </EpisodeIntroDto>
    <EpisodeIntroDto>
      <SeriesInternalId>32963</SeriesInternalId>
      <InternalId>32981</InternalId>
      <HasIntro>true</HasIntro>
      <IntroStart>PT2M17S</IntroStart>
      <IntroEnd>PT2M48S</IntroEnd>
    </EpisodeIntroDto>
  </Intros>

Not bad for a first try actually LOL

 

Edit again: Ops! Count -1, try again!

Edited by chef
Link to comment
Share on other sites

Is there a good way to use just the extracted finger print of the theme once it has been extracted?

When ever I try to match just the theme finger print to an episode it doesn't quite work out well.

Is there a specific variable I should be watching for when hamming offsets?

Link to comment
Share on other sites

samuelqwe
25 minutes ago, chef said:

Is there a good way to use just the extracted finger print of the theme once it has been extracted?

When ever I try to match just the theme finger print to an episode it doesn't quite work out well.

Is there a specific variable I should be watching for when hamming offsets?

How are you currently extracting the fingerprint for the theme song? You have to make sure you take a slice of one of the aligned fingerprints according to the found offset and contiguous region. That’s most likely the easiest way.

You won’t be able to do that before you’ve calculated the offset or while you’re doing it.

EDIT: Didn’t think about this, but if you’re still having issues using the theme song fingerprint, it could be that the "getBestOffset" function doesn’t like the fact that you have two fingerprints of different lengths.

Edited by samuelqwe
Link to comment
Share on other sites

50 minutes ago, samuelqwe said:

How are you currently extracting the fingerprint for the theme song? You have to make sure you take a slice of one of the aligned fingerprints according to the found offset and contiguous region. That’s most likely the easiest way.

You won’t be able to do that before you’ve calculated the offset or while you’re doing it.

EDIT: Didn’t think about this, but if you’re still having issues using the theme song fingerprint, it could be that the "getBestOffset" function doesn’t like the fact that you have two fingerprints of different lengths.

Yes, the getBestOffset will sometimes throw an index out if bounds error, however I have compensated for it.

I can get the theme song out of the episode okay, by getting the TimeSpan and encoding another wav file, getting just the finger print of the theme song. 

However when I attempt to match the theme song over the next episode, it gives different results.

So far I just encode the wav of the new episode and use the finger print from the last good result (which has more data then just the theme song). It works, but I was think about making the task quicker.

 

Edited by chef
Link to comment
Share on other sites

samuelqwe
1 hour ago, chef said:

Yes, the getBestOffset will sometimes throw an index out if bounds error, however I have compensated for it.

I can get the theme song out of the episode okay, by getting the TimeSpan and encoding another wav file, getting just the finger print of the theme song. 

However when I attempt to match the theme song over the next episode, it gives different results.

So far I just encode the wav of the new episode and use the finger print from the last good result (which has more data then just the theme song). It works, but I was think about making the task quicker.

 

I have no idea why taking part of the fingerprint doesn’t work, but I can’t imagine encoding ~1 minute of audio taking too much longer. So, I think it’ll be fine for now, but I can do some tests to see what I can find.

EDIT: After testing, grabbing just the theme song fingerprint works just fine if both fingerprints compared are the same length (I just appended a few 0s to the end of the theme song fingerprint to make both match). If they don’t match, the "getBestOffset" function that I have won’t slide the episode fingerprint all the way so you won’t be able to get the right offset.

Edited by samuelqwe
  • Like 1
Link to comment
Share on other sites

40 minutes ago, samuelqwe said:

I have no idea why taking part of the fingerprint doesn’t work, but I can’t imagine encoding ~1 minute of audio taking too much longer. So, I think it’ll be fine for now, but I can do some tests to see what I can find.

EDIT: After testing, grabbing just the theme song fingerprint works just fine if both fingerprints compared are the same length (I just appended a few 0s to the end of the theme song fingerprint to make both match). If they don’t match, the "getBestOffset" function that I have won’t slide the episode fingerprint all the way so you won’t be able to get the right offset.

Thank you. 

Link to comment
Share on other sites

I found the best  iteration trick and it finds the intro for every single episode intro in a series. (I know, it's quite the statement to make)

it might sound confusing... 

If you iterate through a season of episodes, in one direction, and comparisons aren't found (using a comparing episode),

you can keep increment the comparing episode (stopping the main flow of iteration on  episode to compare) until you find a match.

Once that match is found, you can iterate back through the season using the episode which found the matching intro data, and that episode will almost certainly find the intro for most of  the rest of the season.

If it matches a good portion of the season, but not all of it,  then increment the comparing episode again, and try the leftover un-matched episodes.

This way every single episode gets an intros match if it has one.

If there is absolutely no matching found, then we can say with a really high certainty that the episode has no intro.

It takes a bit of time sure, each scan could take a couple seconds (if only clipping an episode to compare), and will take a couple more seconds if clipping a new comparing episode.

 

However, If there was an episode fingerprinted for the season which didn't compare last time, but it's ID comes up again, no need for encoding to be done.

Once the episode has been finger printed, you don't have to do it again. makes it fast.

 

I've scanned my entire TV library 1.5 times today for testing (it's taken quite a while initially).

over 3000 dvr'd episodes has taken hours...  but it's a one time scan.

 

Lastly, I think the plugin does need a configuration interface. There needs to be  a sorted list of intros and a delete button beside each entry.

If  the intro is removed, it would be scanned again later.

 

Edited by chef
  • Like 4
Link to comment
Share on other sites

PenkethBoy

@chef- do you have an example output yet for the "results" so i can test using it to remux in the intro points to some files please?

Link to comment
Share on other sites

Just wanted to chime in and say I've been following along this thread and am quite impressed at the collaboration on this effort! Wish I knew more but it is what it is.. Thank you all for working this through. It sounds like things are getting close.

  • Like 3
Link to comment
Share on other sites

14 hours ago, mpearon said:

@chef - How do we go about testing what you have completed?  Exciting times!

I think it is close. I tested a new scan last night. Just have to see how far it got. 

Link to comment
Share on other sites

bakes82
On 12/8/2020 at 8:15 AM, chef said:

I think it is close. I tested a new scan last night. Just have to see how far it got. 

You going to make a a thread for the plugin so I can ask questions or you want me to make them on the gihub page?
Is it possible to have the "meta" stored in central location so more than 1 emby box could read the meta?  If you have a central storage and multi emby boxes would be nice to just have 1 do all this processing.
Do you have some time estimate?  IE: 1hr per 1000 episodes.  I know its going to be system specific but some idea would be wonderful ;)
How is the UI interpreting this to show the skip feature?  Havent installed plugin yet.

Edited by bakes82
Link to comment
Share on other sites

bakes82
On 11/29/2020 at 11:38 AM, chef said:

LOL, 

Keep an episode intro json file in the season folder for all the episodes for each series?

Can this not be written to the storage, I dont give my clients "plex/jelly/emby" write access to these, only read only.

Couldnt it be written to the Emby db?  Is there not away to allow for custom meta to be added via the API?  This why it could also be possibly shown in the admin ui/client?

Edited by bakes82
Link to comment
Share on other sites

13 minutes ago, bakes82 said:

Can this not be written to the storage, I dont give my clients "plex/jelly/emby" write access to these, only read only.

Couldnt it be written to the Emby db?  Is there not away to allow for custom meta to be added via the API?  This why it could also be possibly shown in the admin ui/client?

At the moment, it will create json files and store them in one location.

 

I'll update the GitHub, and invite you to the testing. There has been a slight bump, and us in need of some more people involved with testing.

Link to comment
Share on other sites

I would like to test it if possible i could give you an update about plugin work !  I have a good quantity of series an anime to test it. -. 

 

But i dont know how to install externall plugins on emby !? 

Link to comment
Share on other sites

bakes82
7 minutes ago, chef said:

At the moment, it will create json files and store them in one location.

 

I'll update the GitHub, and invite you to the testing. There has been a slight bump, and us in need of some more people involved with testing.

Invite lol?  Testing?  Am I missing a special forum someplace :P  I can build the dll from the source haha.

Link to comment
Share on other sites

44 minutes ago, bakes82 said:

Invite lol?  Testing?  Am I missing a special forum someplace :P  I can build the dll from the source haha.

Yes, the git is not updated. If you want to build from source, that is cool too.

Link to comment
Share on other sites

bakes82
7 minutes ago, chef said:

Yes, the git is not updated. If you want to build from source, that is cool too.

You should automate the DLL builds with a free Azure DevOps, what I did for mine ;)

Link to comment
Share on other sites

samuelqwe
4 minutes ago, bakes82 said:

You should automate the DLL builds with a free Azure DevOps, what I did for mine ;)

It’s just that it’s not quite ready yet and the GitHub repo does not represent all the fixes. Once it’s good to go @chefwas gonna post it here I think.

Link to comment
Share on other sites

  • 2 weeks later...

Alright all. New here, been having a read through this thread and good to see you're getting somewhere with this. I've just started trying to get into this for the Kodi addon TVSkipIntro - which for anyone unaware is a very simplistic version, entirely manual data, which just lets you set on a per-show basis a value for when to prompt for skipping and a value for how many seconds to skip.

It surprises me that there doesn't seem to be any community-fed database/json file for this, hence me ending up here. If a timings file could be shared from the work you are doing with this then I'd be very much interested in giving that a try, if you wouldn't mind.

Either way, good luck in getting this to work for yourselves, really like the idea you came up with for it!

Link to comment
Share on other sites

14 hours ago, MrTIBS said:

Alright all. New here, been having a read through this thread and good to see you're getting somewhere with this. I've just started trying to get into this for the Kodi addon TVSkipIntro - which for anyone unaware is a very simplistic version, entirely manual data, which just lets you set on a per-show basis a value for when to prompt for skipping and a value for how many seconds to skip.

It surprises me that there doesn't seem to be any community-fed database/json file for this, hence me ending up here. If a timings file could be shared from the work you are doing with this then I'd be very much interested in giving that a try, if you wouldn't mind.

Either way, good luck in getting this to work for yourselves, really like the idea you came up with for it!

The good news is that after a lot of research into chroma-printing audio, and some magical comparison algorithms, we may be seeing this feature in emby sooner then you'd think.

Very cool stuff! 

 

  • Like 5
  • Thanks 3
Link to comment
Share on other sites

tchirou

Great news

i have a lifetime emby premiere and a lifetime plex pass. I used emby all the time but i started a few weeks ago using plex for my tv shows because of the skip intro feature which works for me 100% of the time. I look forward to using emby full time again.

Link to comment
Share on other sites

jptestung

Hi, I tried to read a couple of posts from this topic but it's huge, and I can't find what I'm looking for. What I understand is that the dev team is working on this feature, a scheduled task will browse the media files and determine intro/end timestamps. But what I don't understand is how it will decide intro/end. Is it based on the music? Credits detection ? Is it based on an open source library or custom video/audio analysis code ?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...