Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

chef

Now there is a beautiful sight!

introskipdb4.thumb.png.eb9ce4b9919dad6ac13f6dfa1e02faef.png

 

Only problem is that the duration integer is saving as zero after the the episode title sequence data is found. So I have to figure out why.

But look at all those wonderful title sequence start and end times for tv episodes! 👍

 

@samuelqwe

0_C-cPP9D2MIyeexAT.gif.cbaa88a24efd06d3681db42717f2821e.gif  <-- That's for you man! 

Edited by chef
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

samuelqwe
2 hours ago, chef said:

Only problem is that the duration integer is saving as zero after the the episode title sequence data is found. So I have to figure out why.

@chef

It's hard to say without looking at the code, but I assume this is supposed to be the duration of the fingerprinted audio? If so, wouldn't it be possible to reuse whatever amount of time was used for the "-t" argument of the FFmpeg call? Because I don't think the duration is included in the fingerprint output, so you would already need to know before you even get the fingerprint.

Otherwise, if it's the intro duration, then it should simply be common intro region end minus common intro region start.

This should give you a good starting point, but if you provide me a bit more context of how and where that duration is obtained, then I can provide more specific help.

Edited by samuelqwe
Link to comment
Share on other sites

rbjtech

Hi @chef some great work there - but forgive me in asking this - but why go to the effort in getting all the fingerprints into a database, when all we actually want is the IntroStart and IntroEnd points for each media item. 

Once we have the IntroStart/End - then just write that into the Emby database, wipe any temp data (in memory or temp files if necessary) and move onto the next item.  I'm confused why we need to keep the 'fingerprintID' as this is a one off exercise per item no ?

Thanks !

 

 

Link to comment
Share on other sites

chef
2 hours ago, rbjtech said:

Hi @chef some great work there - but forgive me in asking this - but why go to the effort in getting all the fingerprints into a database, when all we actually want is the IntroStart and IntroEnd points for each media item. 

Once we have the IntroStart/End - then just write that into the Emby database, wipe any temp data (in memory or temp files if necessary) and move onto the next item.  I'm confused why we need to keep the 'fingerprintID' as this is a one off exercise per item no ?

Thanks !

 

 

Because some series are still on going, and when a new episode is released, we have to run it's fingerprint against other episodes from the season. If we didn't save the print, we would have to reprint other episodes in the season until we got a match. This way the prints are readily available to us. 

I suppose if a series has ended, we could remove the print data after we find the time stamps.

Edited by chef
  • Thanks 1
Link to comment
Share on other sites

chef
7 hours ago, samuelqwe said:

@chef

It's hard to say without looking at the code, but I assume this is supposed to be the duration of the fingerprinted audio? If so, wouldn't it be possible to reuse whatever amount of time was used for the "-t" argument of the FFmpeg call? Because I don't think the duration is included in the fingerprint output, so you would already need to know before you even get the fingerprint.

Otherwise, if it's the intro duration, then it should simply be common intro region end minus common intro region start.

This should give you a good starting point, but if you provide me a bit more context of how and where that duration is obtained, then I can provide more specific help.

After looking at the database table again, it looks like the duration has shifted columns after the title sequence detection task.

I can see all the duration integers sitting in the seriesId column. Now I know where to look. 

I think the duration  has to be saved with the data incase the user changes it in the settings. We would want to know what the saved encoding duration was, or else we might be trying to compare two different lengths.

Probably have to have a condition which checks the current duration settings with what is saved.  

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

rbjtech
34 minutes ago, chef said:

Because some series are still on going, and when a new episode is released, we have to run it's fingerprint against other episodes from the season. If we didn't save the print, we would have to reprint other episodes in the season until we got a match. This way the prints are readily available to us. 

I suppose if a series has ended, we could remove the print data after we find the time stamps.

Right - I'm with you for ongoing shows.   Thanks 👍

So maybe at a later date include a 'clean up' function to remove all the data if the series has finished, imo there is little point in keeping that as the Intro points are not going to change.  This makes the assumption that the IntroStart/End data is going to be held in the core emby db/tables ?

Link to comment
Share on other sites

chef

Ah, I found the duration column problem and fixed it.

@rbjtech I'm looking at the API and trying to find the endpoints for chapters. If we can edit chapters like what you did using the API, that would be cool.

  • Like 1
Link to comment
Share on other sites

Micael456
Quote

I suppose if a series has ended, we could remove the print data after we find the time stamps.

@chef

I'd say it's probably worth keeping the data regardless, as these days you never know when a new episode / limited run season etc might pop out. Or the Friends reunion!

 

For a new season do you do a quick match against the previous season's intro to see if they are the same, or do you assume a new season has a new intro?

  • Agree 1
Link to comment
Share on other sites

rbjtech
25 minutes ago, chef said:

Ah, I found the duration column problem and fixed it.

@rbjtech I'm looking at the API and trying to find the endpoints for chapters. If we can edit chapters like what you did using the API, that would be cool.

You and me both - haha.  I had a good look in the API last week - and could not find the function.  The 'Chapters' table is 100% there is the main database - so they are definitely available.

@Luke / @ebr - Is there an API function for accessing/modifying the chapters - I've looked in the obvious places but can't find anything relating to chapters.

Thanks !

Link to comment
Share on other sites

chef
1 hour ago, rbjtech said:

You and me both - haha.  I had a good look in the API last week - and could not find the function.  The 'Chapters' table is 100% there is the main database - so they are definitely available.

@Luke / @ebr - Is there an API function for accessing/modifying the chapters - I've looked in the obvious places but can't find anything relating to chapters.

Thanks !

Add the Field "Chapters" to the ItemService with an Item.InternalId under "Ids".

This will list all the current chapters in an Item, and their current StartTImeTicks.

http://localhost:8096/emby/Items?Recursive=true&Fields=Chapters&IncludeItemTypes=Episode&Ids={THE_ITEM_ID}&api_key={API_KEY}

 

Edited by chef
  • Thanks 1
Link to comment
Share on other sites

chef
1 hour ago, Micael456 said:

@chef

I'd say it's probably worth keeping the data regardless, as these days you never know when a new episode / limited run season etc might pop out. Or the Friends reunion!

 

For a new season do you do a quick match against the previous season's intro to see if they are the same, or do you assume a new season has a new intro?

Some shows will have different intros per season, also the pilot episode of a series will have nothing to compare.  There are shows like "WandaVision" which change the intro each episode. These are definitely drawbacks.

We should most certainly attempt to scan a new seasons first episode with the prior season if one exists. 

Shows like WandaVision's intro kind of add to the whole experience of the show, so maybe it's not so bad.

I'm not sure if anyone has checked The Madalorian, but that is another show where an "intro" is debatable. What is considered the intro of that show? Is it the Star Wars Disney intro, or is it the "Chapter" screen?? The plugin will say it is the Disney Star Wars intro.

Edited by chef
  • Agree 1
Link to comment
Share on other sites

rbjtech
1 hour ago, chef said:

Add the Field "Chapters" to the ItemService with an Item.InternalId under "Ids".

This will list all the current chapters in an Item, and their current StartTImeTicks.


http://localhost:8096/emby/Items?Recursive=true&Fields=Chapters&IncludeItemTypes=Episode&Ids={THE_ITEM_ID}&api_key={API_KEY}

 

Ah so it's a Field under an Normal Item - Thanks ! - I was searching for a separate API function ...

Link to comment
Share on other sites

chef

And here we are back in the UI reading from the database properly :)

introskipdb5.thumb.png.f8aa5c6e4ccc7f458530c1644852183b.png

just have to wire up some of the removal commands, and we're back where we were before...

only this time we are saving to a database, and we only use FFMPEG.

So it's quite an upgrade actually.

  • Like 3
Link to comment
Share on other sites

rbjtech
13 hours ago, chef said:

And here we are back in the UI reading from the database properly :)

 

just have to wire up some of the removal commands, and we're back where we were before...

only this time we are saving to a database, and we only use FFMPEG.

So it's quite an upgrade actually.

Thanks Chef - to confirm, this is for non-Windows users only right until the Windows Emby FFmpeg has the required functions included ?

Link to comment
Share on other sites

unisoft
On 21/11/2020 at 16:00, ebr said:

Since finding the start of the intro with this method is dicey at best, I would think we'd need to have a way for the user to initiate the skip without needing any sort of special button appearing on the screen.  Because, if they have to sit through potentially 15 seconds of the intro to be able to skip it, that really doesn't do much.  Therefore, if this technique were used, I  would think some sort of use of chapters would be the way to go.

Also, there may not be an intro at all.  You may just be finding the first commercial break.

and a disable option to not "prompt up" any dialogues about Intro Skip (prob in same area as Cinema Intros/Play next episode)

  • Like 2
Link to comment
Share on other sites

chef
1 hour ago, unisoft said:

and a disable option to not "prompt up" any dialogues about Intro Skip (prob in same area as Cinema Intros/Play next episode)

In my opinion, a disable option might have to be in the  client device settings.

If we just host the title sequence data on aserver endpoint, the client can either request it or not.

Might easier?

Edited by chef
Link to comment
Share on other sites

chef
2 hours ago, rbjtech said:

Thanks Chef - to confirm, this is for non-Windows users only right until the Windows Emby FFmpeg has the required functions included ?

Yes, unless you want to swap out ffmpeg. 

I also removed all the image requests for the config UI. It is now just a table, and it makes it load faster.

There are a couple more things I learned from auto organize that I can add to the plugin to make the configuration better.

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

rbjtech
3 minutes ago, Sammy said:

What? No images?

I also removed all the image requests for the config UI...

ui.PNG.8862c0d1bab8892649ccc1a36f4f673b.PNG

Link to comment
Share on other sites

chef
10 minutes ago, Sammy said:

I know what they are but I want them! Maybe make it configurable?

Oh,  yeah, I can put them back. I was just thinking utility over anything. That's cool. I liked them as well.

The one thing that is bonkers in the UI (always drove me nuts) is trying to sort the table data properly because it gets requested in  promised and always arrives to the UI our of order.  

I wonder about using async/await instead of promises. I can try that out.

Link to comment
Share on other sites

rbjtech
10 minutes ago, chef said:

Oh,  yeah, I can put them back. I was just thinking utility over anything. That's cool. I liked them as well.

It's all about WHY we are displaying the poster - if it slows down performance, then my view is remove them as to me personally it add's nothing to the function.  If I see a show called 'GoT' - I don't need a poster of 'GoT' to confirm what I already know.. 

When this runs for 'real' - and you have 100's of shows - a drop down menu of items is not going to be very manageable - so I expect a table would be a much more efficient way to show this and they cannot hope to have posters.

Link to comment
Share on other sites

chef

Fixing the table sorting was actually super easy barely an inconvenience 😅

I just added the episode index number to the table row as a data attribute, then used the old "x > y" sorting algorithm. 😅

  • Like 2
Link to comment
Share on other sites

rbjtech

I'm just trying to figure out what a Tick is in Emby, as there seems to be an extra three 0's of precision vs standard Tick calculations .. 🤪

{"Items":[{"Name":"New Paths","ServerId":"5f9c466f4ecc4319b1d48f55e311d249","Id":"516180","RunTimeTicks":36139410000,"IndexNumber":1,"ParentIndexNumber":1,"IsFolder":false,"Type":"Episode","ParentLogoItemId":"516178","ParentBackdropItemId":"516178","ParentBackdropImageTags":["55e8c6c2a5f3d485ce189b7a11fdd7da"],"SeriesName":"Das Boot","SeriesId":"516178","SeasonId":"516179","SeriesPrimaryImageTag":"2ea106b29e57680ecee956208a2c24dc","SeasonName":"Season 1","ImageTags":{"Primary":"8825954ed2125f33642025e02d7e98c4"},"BackdropImageTags":[],"ParentLogoImageTag":"3703a94e0b858307b89a070fe078a1de","ParentThumbItemId":"516178","ParentThumbImageTag":"bb90cea31b2010d9727cd13e2dac66b7",

"Chapters":[

	{"StartPositionTicks":0,"Name":"Chapter 1","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":5580000000,"Name":"IntroStart","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":6330000000,"Name":"IntroEnd","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":13032800000,"Name":"Chapter 4","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":21806800000,"Name":"Chapter 5","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":27045600000,"Name":"Chapter 6","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":31616000000,"Name":"Chapter 7","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":35820000000,"Name":"Chapter 8","ImageTag":"f7f5635ae097093210d499c70c65c542"}

	]

,"MediaType":"Video"}],"TotalRecordCount":1}

 

Link to comment
Share on other sites

chef
1 hour ago, rbjtech said:

I'm just trying to figure out what a Tick is in Emby, as there seems to be an extra three 0's of precision vs standard Tick calculations .. 🤪




{"Items":[{"Name":"New Paths","ServerId":"5f9c466f4ecc4319b1d48f55e311d249","Id":"516180","RunTimeTicks":36139410000,"IndexNumber":1,"ParentIndexNumber":1,"IsFolder":false,"Type":"Episode","ParentLogoItemId":"516178","ParentBackdropItemId":"516178","ParentBackdropImageTags":["55e8c6c2a5f3d485ce189b7a11fdd7da"],"SeriesName":"Das Boot","SeriesId":"516178","SeasonId":"516179","SeriesPrimaryImageTag":"2ea106b29e57680ecee956208a2c24dc","SeasonName":"Season 1","ImageTags":{"Primary":"8825954ed2125f33642025e02d7e98c4"},"BackdropImageTags":[],"ParentLogoImageTag":"3703a94e0b858307b89a070fe078a1de","ParentThumbItemId":"516178","ParentThumbImageTag":"bb90cea31b2010d9727cd13e2dac66b7",

"Chapters":[

	{"StartPositionTicks":0,"Name":"Chapter 1","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":5580000000,"Name":"IntroStart","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":6330000000,"Name":"IntroEnd","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":13032800000,"Name":"Chapter 4","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":21806800000,"Name":"Chapter 5","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":27045600000,"Name":"Chapter 6","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":31616000000,"Name":"Chapter 7","ImageTag":"f7f5635ae097093210d499c70c65c542"},
	{"StartPositionTicks":35820000000,"Name":"Chapter 8","ImageTag":"f7f5635ae097093210d499c70c65c542"}

	]

,"MediaType":"Video"}],"TotalRecordCount":1}

 

Yeah that is total strange. 

 

Check out this site. It does a conversion which is best:  https://www.venea.net/web/net_ticks_timespan_converter#net_ticks_to_time_span_conversion

 

That site says the intro start (5580000000) is  9 Minutes + 18 Seconds,

Edited by chef
  • Thanks 1
Link to comment
Share on other sites

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