Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

Micael456
23 minutes ago, rbjtech said:

Let me test this, but for me this did not cause any issues and it was instant - but I think this largely depends on the size of the dB - for my testing, they are tiny at the moment.

Unless you are watching the log, then the UI is the only feedback you will see - so I don't think you can disable it during the task (that may take days..) ?

 

@rbjtech, possibly a combination factor of resources + database size. Mine isn't particularly large at the moment compared to some of your earlier file sizes.

1342621376_2021-09-07(4).png.11c47b6e0bf656862afc463632b82d8a.png

 

Here's a quick video showing the speeds I get when accessing. Top doesn't seem to show the CPU being too stressed once the task is "stopping", but it definitely doesn't respond quickly until it has finished stopping.

EDIT: This speed is at 2 concurrent btw, not sure if any faster than 4.

Edited by Micael456
Link to comment
Share on other sites

5 minutes ago, rbjtech said:

Emby is just doing a SQL query - if it doesn't have the capacity to do this, how is emby going to do it's own core playback queries ?  

If your cpu/disk is that busy, then you need to reduce the workload a little !

We are opening transactions to the data table to write, and while it is open we set a write.lock on the table. 

Does that affect querying? 

I wish I knew this stuff already,  I'm learning fast though 😆

Link to comment
Share on other sites

Micael456
9 minutes ago, rbjtech said:

Emby is just doing a SQL query - if it doesn't have the capacity to do this, how is emby going to do it's own core playback queries ?  

If your cpu/disk is that busy, then you need to reduce the workload a little !

Frankly I don't know, but it doesn't seem to affect it...

Link to comment
Share on other sites

4 minutes ago, Micael456 said:

@rbjtech, possibly a combination factor of resources + database size. Mine isn't particularly large at the moment compared to some of your earlier file sizes.

1342621376_2021-09-07(4).png.11c47b6e0bf656862afc463632b82d8a.png

 

Here's a quick video showing the speeds I get when accessing. Top doesn't seem to show the CPU being too stressed once the task is "stopping", but it definitely doesn't respond quickly until it has finished stopping.

Dear gawd! It has to be waiting for the write to finish. Are you are accessing over LAN?

  • Haha 1
Link to comment
Share on other sites

rbjtech
5 minutes ago, chef said:

Here is how we can manage chapters... so far.

 

  1. If the Intro starts at the beginning of the first chapter 
  • move to chapter 2 and  change StartpositionTicks to TitleSequenceEnd.
  • push all subsequent Chapters 'StartPositionTicks' ahead the duration of the intro  (or else we run the risk of screwing up the timestamps, or oddly short chapters)
  • make sure not to mark the subsequent chapters start positions longer then the runtime of the item. //<--that would be bad.

 

         2. The intro doesn't start at the beginning of the first chapter (There is a recap)

  • move to chapter 2 - change StartPositionTicks to the TitleSequenceStart timestamp
  • move to chapter 3 - change StartPositionTicks to the TitleSequenceEnd timestamp
  • push all subsequent Chapters 'StartPositionTicks' ahead the duration of the intro  
  • make sure not to mark the subsequent chapters start positions longer then the runtime of the item.

There is probably more to it then that. But that is where I am. Do you think they'll take issue with us changing chapter data... if it done correctly, and doesn't cause issues?

 

wow ok

My thoughts are to not change the existing chapter points at all - don't we need to just 'insert' the IntroStart and IntroEnd and then re-order ?

We can't change the file chapter points - so you'd end up with two sets of chapters .. :(

The only caveat to this is if there is an existing chapter point called *Intro* - then probably maybe don't add or have the choice to overwrite maybe ?

 

Link to comment
Share on other sites

Micael456
2 minutes ago, chef said:

Dear gawd! It has to be waiting for the write to finish. Are you are accessing over LAN?

No, but that might be quicker if it's write-constrained! It's an A2 SD card- would expect that to be average on a typical small system (that said my Pi does boot off of SSD, but SD cards are the norm).

 

4 minutes ago, rbjtech said:

The only caveat to this is if there is an existing chapter point called *Intro* - then probably maybe don't add or have the choice to overwrite maybe ?

Do we need to call the new one "Intro" exactly? Can't it be "EmbyIntroStart" and "EmbyIntroEnd"? Would still be usable outside of Emby (i.e. manually), but if anyone's already called it that on purpose they deserve trouble :D.

Link to comment
Share on other sites

rbjtech
2 minutes ago, Micael456 said:

Do we need to call the new one "Intro" exactly? Can't it be "EmbyIntroStart" and "EmbyIntroEnd"? Would still be usable outside of Emby (i.e. manually), but if anyone's already called it that on purpose they deserve trouble :D.

So this is where we need the conversation with Luke/ebr - as emby ultimately needs to recognise this to do the 'Skip' part or 'AutoSkip'.  Remember that this is in the Emby chapter dB (only?) so there is no need to call it 'EmbyX'.  If there is an option to write to the file (down the road) then yes, maybe tag it as an Emby inserted chapter.

We potentially do not need an IntroStart if the Intro starts at 0:00 - as long as there is an IntroEnd - then we know what to skip to ?  (ie if no IntroStart but there is an IntroEnd, then assume IntroStart=0:00)

?

Link to comment
Share on other sites

rbjtech

On the TODO list - can you also log that the FP and Detect tasks are complete in the log as well pretty please, you log that they have started ... 👍

alv.PNG.8862dbe72c5acf6809ab72098339b763.PNG

Link to comment
Share on other sites

rbjtech
36 minutes ago, chef said:

Do you think they'll take issue with us changing chapter data... if it done correctly, and doesn't cause issues?

Anyone can do it today via the API - so I would hope not 🤪

  • Like 1
Link to comment
Share on other sites

rbjtech

I'm trying to get my head around why you would want to move existing chapter points ?

tbh it's pretty rare to even have 'proper' chapter points in TV series - they are usually set by Emby to every 5 mins.

But if you did have a 'real' Chapter - with a Name and a time - that is there for a reason and needs to be at that time - you cannot move it. 😬

It is highly unlikely that there will be a 'real' chapter inbetween the Intro Start and  Intro End - but there may be an Emby auto chapter if the Intro is midway though the episode - is that what this condition is trying to capture and thus remove it and renumber the chapters ?

Thanks !

  • Agree 1
Link to comment
Share on other sites

20 minutes ago, rbjtech said:

I'm trying to get my head around why you would want to move existing chapter points ?

tbh it's pretty rare to even have 'proper' chapter points in TV series - they are usually set by Emby to every 5 mins.

But if you did have a 'real' Chapter - with a Name and a time - that is there for a reason and needs to be at that time - you cannot move it. 😬

It is highly unlikely that there will be a 'real' chapter inbetween the Intro Start and  Intro End - but there may be an Emby auto chapter if the Intro is midway though the episode - is that what this condition is trying to capture and thus remove it and renumber the chapters ?

Thanks !

Yes you are right, we do t have to.

Just change at most the first three chapters.

 

 

 

 

  • Thanks 1
Link to comment
Share on other sites

crusher11
1 hour ago, rbjtech said:

I'm trying to get my head around why you would want to move existing chapter points ?

tbh it's pretty rare to even have 'proper' chapter points in TV series - they are usually set by Emby to every 5 mins.

The vast majority of my TV shows, perhaps even all of them, have chapter points in the files.

There may already be chapter points at the exact place you're trying to insert them with the plugin, which is another concern.

Edited by crusher11
Link to comment
Share on other sites

rbjtech
Just now, crusher11 said:

The vast majority of my TV shows, perhaps even all of them, have chapter points in the files.

What 'real' chapter points with names and times - not just the every 5 minute interval generated automatically by emby ?

Link to comment
Share on other sites

rbjtech

This is what I mean by 'real' chapter point - they have names and an exact time - based on an event.  This example is actually from a film as I have no examples of this being used for TV series..

chapter1.thumb.PNG.171110e2bf356b349391b0690d7191db.PNG

 

This is a bit more frequent, where times are used - but no names.

chapter2.thumb.PNG.f451f86c91a2a3a979464b7a552444b0.PNG

 

This is common / default - emby generated chapters every 5 mins.

charter3.thumb.PNG.be592dc8e0025312b1948b0cf3a07611.PNG

 

So the point of the conversation is you are 'likely' to get a TV Intro in the first 3 emby chapters - 10 mins (yes there are exceptions) - so adding  an 'Intro Start' plus and 'Intro End' inbetween the Chapter X points needs to be calculated and then the chapter points renumbered accordingly, as they are 'fake' anyway.  I see what @chef is now doing here to 'space out' the chapter points - 5 mins 'before' Intro Start (if relevant/needed) and 5 minutes 'after' IntroEnd.

But what you can't do is apply this logic to the chapters with times (?) and definitely not those with names & times - but I *think* these are rare - so it's probably not a big deal.

 

Edited by rbjtech
Link to comment
Share on other sites

Did I get right that, you are thinking about writing the calculated intro point as a chapter into the media files?

IIRC if a chapter is available then Emby won't generate the 5min chapters anymore, so every file that only has the intro chapters will end up without the 5min chapters Emby usually creates.

  • Thanks 2
Link to comment
Share on other sites

rbjtech
1 minute ago, neik said:

Did I get right that, you are thinking about writing the calculated intro point as a chapter into the media files?

IIRC if a chapter is available then Emby won't generate the 5min chapters anymore, so every file that only has the intro chapters will end up without the 5min chapters Emby usually creates.

Not the media files no, the emby chapter database.  But the Intro chapters will be added - leaving the 5 min chapter points.

This is an example of inserting using real chapter timings - but round the non Intro chapters to the nearest 5 mins and you get the idea .. 👍

 

charter4.thumb.PNG.42a92ab774126933015422b4a1a7fbc5.PNG

  • Thanks 1
Link to comment
Share on other sites

rbjtech
6 minutes ago, neik said:

Did I get right that, you are thinking about writing the calculated intro point as a chapter into the media files?

IIRC if a chapter is available then Emby won't generate the 5min chapters anymore, so every file that only has the intro chapters will end up without the 5min chapters Emby usually creates.

..but it's actually a very good catch.  @chef If there are existing ''Intro' 'Main' Credits' in there - do we want the option to remove, regenerate the 5 mins chapters and replace with our own ? 

Link to comment
Share on other sites

@rbjtech, thanks for the explanation.

This information should also be stored in a file (nfo/xml) so that a rebuild wouldn't cause to rerun the complete fingerprinting etc.
But I think you guys alraedy have it on the radar.

  • Agree 1
Link to comment
Share on other sites

rbjtech
6 minutes ago, neik said:

@rbjtech, thanks for the explanation.

This information should also be stored in a file (nfo/xml) so that a rebuild wouldn't cause to rerun the complete fingerprinting etc.
But I think you guys alraedy have it on the radar.

Indeed !  Plus it should contain the 5 min chapter points as well - so when imported by 3rd party tools into the media itself (my pref), emby doesn't ignore as you have quite rightly mentioned !  👍 Emby doesn't currently support an external chapter file - so we need to get that added somehow as people will not want their source files modified I would imagine.

Edited by rbjtech
Link to comment
Share on other sites

Micael456
47 minutes ago, crusher11 said:

There may already be chapter points at the exact place you're trying to insert them with the plugin, which is another concern.

That's a very good point. Some media formats would support multiple chapter lists, others won't. Also not sure how Emby would handle two chapters at the same timestamp.

I guess a chapter scan can be added - if it happens to sit on the same timestamp point, just offset the intro chapter by a second (or millisecond if chapter resolution is that precise). The "correct" IntroStart/End times can remain the same, but the algorithm knows to offset 1 unit later/earlier respectively for IntroStart / IntroEnd. Since the skip function will hopefully be tied into our specifically named chapters, it wouldn't even matter that two were practically ontop of eachother.

Link to comment
Share on other sites

crusher11
19 minutes ago, rbjtech said:

@crusher11 - can you give examples of where you have named TV chapter points ?

Named? No. Unnamed but at specific points? The Alfred Hitchcock Hour, Alfred Hitchcock Presents, Band of Brothers, Big Bang Theory, Blackadder, Breaking Bad, Chuck, Dekalog, Dexter, Fawlty Towers, House, Kyle XY, The Last Dance, Life on Mars, NCIS, The Newsroom, Oz, The Pacific, Police Squad, Prison Break, The Prisoner, Psych, Rush, The Sopranos, Twin Peaks, The Walking Dead, The West Wing, White Collar, The Wire, Yes Minister.

QI is the only show I have that only has the autogenerated chapters.

 

Quite a few of those shows already have a chapter point at the end of the intro, I'd wager.

  • Thanks 1
Link to comment
Share on other sites

rbjtech

So I guess this needs a little more debate on the best way to do this optional step, but ultimately for the 'Skip Intro' to work, we need a defined marker that shows where the Intro Starts and where it Ends.   If non auto generated chapter markings already exist, then I think we need the option to not interfere with them, but of course, this means no 'Skip Intro' for those shows - you can't have it both ways..  

 

Link to comment
Share on other sites

Micael456
2 minutes ago, rbjtech said:

So I guess this needs a little more debate on the best way to do this optional step, but ultimately for the 'Skip Intro' to work, we need a defined marker that shows where the Intro Starts and where it Ends.   If non auto generated chapter markings already exist, then I think we need the option to not interfere with them, but of course, this means no 'Skip Intro' for those shows - you can't have it both ways..  

 

Not necessarily true. We can read in existing chapters, and re-write it out including the originals plus the skip ones (offsetting skip start and end if required). That way the user can have their chapters, as well as the IntroSkip ones.

ffmpeg should be able to map metadata and chapters for common formats if we wanted to actually touch the file, or we just save it internally in the Emby DB instead.

Link to comment
Share on other sites

crusher11

I don't see why you couldn't simply add the required chapters to what's already there. If there's a chapter within, say, two seconds of the detected intro end time, use that chapter point instead of adding one.

But I'm not sure why you're surprised that shows have chapters. As you can see from my sample the vast majority do.

Alternatively, if this actually gets put into the UI the way Netflix and Amazon Prime do it - which one has to assume is the end goal here - do chapter markers need to be added at all? Surely that UI piece could simply read directly from the database of intro points?

Link to comment
Share on other sites

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