Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

Sammy
15 minutes ago, rbjtech said:

Hi @chef

Had a quick play - on a local SAS disk it's taking about 30 seconds per episode to do the fingerprinting - CPU appears to be idle but the disk is getting hammered - so if there is anything we can do to keep that in memory than that sounds like a great potential performance increase.

From an accuracy perspective - it's looking pretty good.  I've tested on the series below as the Intros appear anywhere in the first 10 or so minutes and from checking the results, the IntroEnd is very accurate.  IntroStart is sometimes maybe 2 seconds off - but that's fine with me.

skipintro.thumb.PNG.6b37a4fbeb7b05ab8aa9986ec84acf76.PNG

As a mock up - I then added the results from the JSON file into a MKV Chapter file (attached) and hey presto, I now have a jump point.    tbh, unless we can Automate the Intro Skip, there is probably little point adding (or showing) the IntroStart - we just want the IntroEnd.   A 'Skip Intro' (to IntroEnd) button would be useful on the OSD as well.

For those that don't want to modify the MKV, then I guess you could also write these chapter points in the Emby chapter table in the main database - not sure how the item is currently linked in this Alpha (it may be stand alone at this point?)

Exciting stuff.  Well done to all the contributors to this !

skip2.thumb.PNG.534dbfc04612630873d18177cc12c098.PNG

Das Boot (2018) - s01e01 - New Paths.xml 3.42 kB · 1 download

 

Say WHAT? This is moving into something usable in the playback???

  • Haha 1
Link to comment
Share on other sites

chef
9 minutes ago, GiGo said:

This is starting to look AMAZING! Great work everyone!

I will test this assuming you can pause the process and not have to stop it? My TV collection is circa 1000 boxsets so I'm guessing it will take a LONG time to do every show. So please tell me if it can be paused? The last time I tested the plugin it bought my NAS to a granding halt, ie I couldn't transcode or play any file as the CPU usage was at somthing like 99%! Just want to check if it's been limited or at least pausable so I can run it over night?

TIA

Currently, stopping the task would be fine. The task checks for fingerprints before creating new ones. I wrote cancellation tokens, so (I'm pretty sure) the task will stop gracefully... ... Gracefully enough... 😉

 

@rbjtech where are the chapters stored? In both the file and also sometimes externally?

Edited by chef
Link to comment
Share on other sites

rbjtech
37 minutes ago, chef said:

 

@rbjtech where are the chapters stored? In both the file and also sometimes externally?

My mock-up was just using a MKV external chapter XML file imported back into the MKV using MKVtools.  Timings are from the output from the JSON file (manually).

Emby doesn't currently read external chapter files, BUT chapters are imported into the main DB and read from the original Media.  So an updated MKV and an item Refresh is all it took to add the Intro Chapter points properly into emby.

That's the long way of doing it, but I believe you should be able to write them directly into the DB as new chapters, but of course in order to do that, you need to identify the media item in the DB - and I'm not sure this Alpha does that yet ?

edit - Doh! - Just realised the Emby Media Id is 'InternalID' in the JSON file - so technically this can be used to update the Chapters table directly .. Way to go @chef

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

rbjtech
18 minutes ago, GiGo said:

This is starting to look AMAZING! Great work everyone!

I will test this assuming you can pause the process and not have to stop it? My TV collection is circa 1000 boxsets so I'm guessing it will take a LONG time to do every show. So please tell me if it can be paused? The last time I tested the plugin it bought my NAS to a granding halt, ie I couldn't transcode or play any file as the CPU usage was at somthing like 99%! Just want to check if it's been limited or at least pausable so I can run it over night?

TIA

This is an Alpha / proof of Concept - so it is not recommended to run on your production system .. as it will take forever and the results are not 'usable' at the moment anyway.

My advice is test on a new Beta instance with 1 or 2 shows only.  It hammered my local disk, so not sure what it would do to a NAS at this point ... ;)

Maybe reduce the concurrency to 1 series at a time to start off slow and ramp up .. 

  • Like 1
Link to comment
Share on other sites

rbjtech

 

20 minutes ago, Sammy said:

Say WHAT? This is moving into something usable in the playback???

Currently I'm just using the output to add chapter points, there is no automation or automatic 'Skip Intro' options at this time but they don't seem that hard to integrate .. 

I think the key focus needs to be on performance, or management of resources - which I'm going to look into over the weekend if I get time.

 

  • Thanks 1
Link to comment
Share on other sites

chef

@rbjtech when you mentioned the file system getting hammered. 😬 How many series are set to process at once on your system? Maybe a default of five us not a good idea.

I'd better work in the database with the new ffmpeg command. That will save the file system. 👍

Link to comment
Share on other sites

rbjtech

I only had 2 series available on my test Beta - disk I/O was at 100%, MB/sec was relatively low (10-20) but I/O's were high - which is not good.  It's maybe doing 1000's of small reads as opposed to one contiguous read ?

That's what I was going to look at over the weekend to really see what was going on  ..

  • Agree 1
Link to comment
Share on other sites

1 hour ago, rbjtech said:

IntroStart is sometimes maybe 2 seconds off

Which direction?  Early or late?

Link to comment
Share on other sites

rbjtech
26 minutes ago, ebr said:

Which direction?  Early or late?

So I went through it again and realised that I was watching for the Intro from a Video perspective, but of course this uses Audio for the fingerprint.  On the items where I thought the timestamp was 'early' - it actually isn't as the Intro music starts before the Intro Video and is thus faded into the normal AV.  On some episodes it's short, on others it much longer - and it is this which it is being timestamped on.  It's actually very accurate but you will of course get a few seconds of the 'non Intro' Video, but the Intro music has started - If that makes sense haha. 

I've probably used a very hard show to test this on - but I'm very impressed. 

I'll do some more testing on shows that have a very obvious Audio/Video 'Intro' and I expect for those it will be perfect. 

Link to comment
Share on other sites

chef
35 minutes ago, ebr said:

Which direction?  Early or late?

I hope late, because prime and Netflix are usually a second late. Better user experience actually. 

But I get timestamps that are right on the intro to the second. I actually brought up that before, that perhaps we should be late on purpose by a second or two.

  • Agree 1
Link to comment
Share on other sites

1 minute ago, rbjtech said:

So I went through it again and realised that I was watching for the Intro from a Video perspective, but of course this uses Audio for the fingerprint.  On the items where I thought the timestamp was 'early' - it actually isn't as the Intro music starts before the Intro Video and is thus faded into the normal AV.  On some episodes it's short, on others it much longer - and it is this which it is being timestamped on.  It's actually very accurate but you will of course get a few seconds of the 'non Intro' Video, but the Intro music has started - If that makes sense haha. 

Okay, so early is actually better than late.  Because the way this would most likely be implemented is with some sort of small popup on screen that you have to press a button on to execute the actual skip.

  • Like 3
  • Agree 1
Link to comment
Share on other sites

1 minute ago, chef said:

I hope late, because prime and Netflix are usually a second late

I would think people would complain if it is late - thinking it isn't working because they want to skip it as soon as the intro starts.

  • Agree 2
Link to comment
Share on other sites

Sammy

A show such as "Friends" will always have 30 to 60 seconds of show, the intro, and then the show. The intro seems to always run the same amount of time and is just over one 30sec skip forward although I have not timed it. The reason I know this is that my wife and I are watching it again in order from S01E01 to the end right now. Want a couple mkv's to test out?

Link to comment
Share on other sites

rbjtech

As I guess you can modify the actual timestamps calculated - then I would think you want the 'Skip Intro' early by say 2 seconds, that way it gives you time to find the remote.  On the resume, then if in doubt, you want that early as well, leaving maybe 2 seconds or so of the Intro - otherwise you may chop part of an important scene - better to be early than late.

 

 

  • Agree 1
Link to comment
Share on other sites

Sammy

Unfortunately I added "Friends" after the server update broke Episode Audio Fingerprinting so none of these episodes have the Intro location tagged.

Link to comment
Share on other sites

chef

I've almost finished the SQL db file for saving data.

Any idea how to pipe a memory stream from ffmpeg, so we don't have to save a .bin file?

Link to comment
Share on other sites

Micael456
19 minutes ago, chef said:

I've almost finished the SQL db file for saving data.

Any idea how to pipe a memory stream from ffmpeg, so we don't have to save a .bin file?

That sounds amazing :).

 

What command are you using? I'm assuming

Quote

pipe:1

doesn't work? Perhaps the following?

Quote

-fp_format bin |

Usually it's -fmt FORMAT | to pipe to something else but not sure with audio (and am travelling so can't check right now).

https://ffmpeg.org/ffmpeg-formats.html#Options-7


 

  • Thanks 1
Link to comment
Share on other sites

rbjtech

Hmm, strangely GoT appears to be very broken :(  I've run it twice and the same results.  For some reason it thinks the Intro is only 43 seconds but as anybody who has watched this show will tell you, the Intro is a rather long 1 min 50 seconds ..    I'm just going to try Season 2 to see if that is any better..  

Link to comment
Share on other sites

Sammy
3 minutes ago, rbjtech said:

Hmm, strangely GoT appears to be very broken :(  I've run it twice and the same results.  For some reason it thinks the Intro is only 43 seconds but as anybody who has watched this show will tell you, the Intro is a rather long 1 min 50 seconds ..    I'm just going to try Season 2 to see if that is any better..  

How are you getting the fingerprints? Mine is broken since many server releases ago.

Link to comment
Share on other sites

chef
12 minutes ago, rbjtech said:

Hmm, strangely GoT appears to be very broken :(  I've run it twice and the same results.  For some reason it thinks the Intro is only 43 seconds but as anybody who has watched this show will tell you, the Intro is a rather long 1 min 50 seconds ..    I'm just going to try Season 2 to see if that is any better..  

Set the fingerprinting duration to something higher. Like even twenty minutes. What's happening is the intro is not starting until really far into the stream. The duration is not long enough to capture the intro, and the intro clip may be too short.

GOT has really long recaps, and also really long pre intro story lines. 

I had the same issues. 

8 minutes ago, Sammy said:

How are you getting the fingerprints? Mine is broken since many server releases ago.

@Sammy Did you grab the file a couple posts back on the other page? I fixed the initial compile to work. 

Edited by chef
Link to comment
Share on other sites

rbjtech
1 minute ago, chef said:

Set the fingerprinting duration to something higher. Like even twenty minutes. What's happening is the intro in not starting until really far into the stream. The duration is not long enough to capture the intro, and the intro is too short.

GOT has really long recaps, and also really long pre intro story lines. 

I had the same issues. 

Thanks Chef - I set it to 20 mins as I remember you saying this before.  I'm going to check it's saving the settings .. 

 

Link to comment
Share on other sites

chef
1 minute ago, rbjtech said:

Thanks Chef - I set it to 20 mins as I remember you saying this before.  I'm going to check it's saving the settings .. 

 

We should probably take the runtime of the file into consideration. The user can set a duration to scan, but we should look at the whole file and add time to the encoding if the episode is more then an hour. It would be safe to speculate that an episode with a runtime of and hour or longer has its intro farther into the stream.

Link to comment
Share on other sites

chef
1 hour ago, ebr said:

I would think people would complain if it is late - thinking it isn't working because they want to skip it as soon as the intro starts.

Yes. That is right.

Link to comment
Share on other sites

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