Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

rbjtech

When I tested this performance really was not an issue because it only scans the first X minutes anyway.

The central db is a reasonable idea but I think privacy would be a concern here. 

Link to comment
Share on other sites

GiGo
10 minutes ago, rbjtech said:

When I tested this performance really was not an issue because it only scans the first X minutes anyway.

The central db is a reasonable idea but I think privacy would be a concern here. 

  When I tested on my 850 boxset TV archive it brought my 1815+ NAS grinding to a halt with 99% CPU usage, hence my reason for asking, of course all mine are personal rips from DVD's and Blu Rays :) 

13 minutes ago, Micael456 said:

I think this is the key line here. It makes it easier to pirate, and (imo) crosses the line to actively supporting piracy.

 

If, like myself, you use Emby with personal rips and toss the DVDs in the attic (which is what officially speaking you're meant to do), chances are that our md5 hashes will not match. Now, sure, in theory if we both ripped Stargate Atlantis S01e01&2 with the identical settings in MakeMKV and Handbrake, then they might match. But realistically speaking there'd be hundreds (thousands) of potential md5 hashes as everyone has their own setting combos/ app versions/ etc when they rip). Some people would statistically have the same file, most wouldn't. So there'd have to be a huge hashtable somewhere centralised, which wouldn't necessarily be quicker to search, or easy to transfer, and would force you to be connected to the 'net.  Processing files locally may take a little longer, but it's a reliable local solution.

 

The only place it would be guaranteed to be quicker is on episodes that were, *ahem*, acquired off the internet. And if you're creating a feature that just improves the life for pirates (vs. just scanning), then that's saying Emby is a place for pirates. I quite like emby, I'd rather they didn't get hit by lawyers.

 

 

tldr; supports piracy, doesn't offer legit advantages, imo.

Yes I agree to that statement, emby doesn't support piracy nor should it encourage it. I hadn't really considered the MD5 database being very large in size, and TBH of course it would be! It would be mega, then of course who would host it, which in turn could cause legal issues for such a host.

Thought I would ask the question as it could be quicker so some, like I mentioned above it causes my NAS to grind to halt!

Edited by GiGo
Link to comment
Share on other sites

neik

Before they start with something complex like a central db for this, I would already be happy if this would be implemented at all.

Assuming that many of the servers are running 24/7 does it really matter if it would a day or two or even a week? We've been waiting for this now for at least a year, so I don't think it really would.

Maybe this is the "big thing" for 4.7 like tone mapping was for 4.6...

  • Agree 1
Link to comment
Share on other sites

GiGo
4 minutes ago, neik said:

Before they start with something complex like a central db for this, I would already be happy if this would be implemented at all.

Assuming that many of the servers are running 24/7 does it really matter if it would a day or two or even a week? We've been waiting for this now for at least a year, so I don't think it really would.

Maybe this is the "big thing" for 4.7 like tone mapping was for 4.6...

Doesn't matter the length of time it takes, but might be good to have an option to set out the 'priority' of system resources it uses while processing, but realise it could be very difficult to implement giving the many different systems emby runs on.

Link to comment
Share on other sites

rbjtech
24 minutes ago, neik said:

Before they start with something complex like a central db for this, I would already be happy if this would be implemented at all

Agreed - I actually just want the chapter points to start with - bells and whistles can be added later .. :) 

  • Like 2
Link to comment
Share on other sites

Micael456

 

31 minutes ago, GiGo said:

Doesn't matter the length of time it takes, but might be good to have an option to set out the 'priority' of system resources it uses while processing, but realise it could be very difficult to implement giving the many different systems emby runs on.

 

8 minutes ago, rbjtech said:

Agreed - I actually just want the chapter points to start with - bells and whistles can be added later .. :) 

Agreed on both points. A nice native skip option that works across multiple systems is what I'd like to see first, and it's great to hear Luke's on it.

Later on the emby team can add additional features, or expose API calls so that others can create additional plugins if they want (e.g. css formatting, third party DBs, whatever).

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
sydlexius
On 6/11/2021 at 4:53 AM, Micael456 said:

 

 

Agreed on both points. A nice native skip option that works across multiple systems is what I'd like to see first, and it's great to hear Luke's on it.

Later on the emby team can add additional features, or expose API calls so that others can create additional plugins if they want (e.g. css formatting, third party DBs, whatever).

Unless Emby can rely on external chapter files, I don't want it modifying my media files.

Link to comment
Share on other sites

Matrix913

I can't wait for the Show skip intro feature to arrive!!! Awesome job Emby Devs keep up the Amazing work!!!!👍👍👍

Link to comment
Share on other sites

Cheesegeezer

I'm fairly sure this could be implemented quite easily and would be happy to do it if i could get access to some core code.

This is how i would see it working.

  1. User input for each Series for intro time - this can be set by user (because there is not database or online API to set this perfectly for each show)
  2. User Option - Enable skip intros for TV Shows (Global setting)  if this is enabled, all Episodes play will automatically skip the number of ticks the user has input in setting one.
  3. A Field would need to be added to the metadata for time to skip in seconds
  4. A Check Box setting would need to be added for tv shows - probably in the Playback options below the "play next episode automatically" 

image.thumb.png.ede288cf2a0b50bf0b486c8ec1c3a0c1.png

Edited by Cheesegeezer
  • Like 3
Link to comment
Share on other sites

  • 5 weeks later...
guardianali

Works amazing in Plex and doesnt slow anything down. Not sure how they implemented it but it shows its possible.

  • Like 1
Link to comment
Share on other sites

14 hours ago, guardianali said:

Works amazing in Plex and doesnt slow anything down. Not sure how they implemented it but it shows its possible.

thats true. on plex it work great i miss this option on emby!

Link to comment
Share on other sites

Lighthammer
On 6/10/2018 at 11:15 AM, Luke said:

It's possible for the future.

Hmm, considering your quick response, you must already have an idea in mind how you think you can implement it.

Mind sharing your thoughts how you expect to? I'm interested, on your plan (when and if, thats not to claim or construe this as "coming soon"). 

I had a kneejerk idea how to do too, but your quick response seems potentially more efficient. Would like to give feedback on it.

Link to comment
Share on other sites

Sammy

Changes to the server cause audio fingerprinting to fail and the necessary changes to the individual apps to incorporate it in playback need to be made.

image.thumb.png.c751ef5efaab32e3ec4c9c5896913aa4.png

Link to comment
Share on other sites

chef

After working with auto organize, I think we can create a db file which holds all the info.

I don't know how to analyze files yet with ffmpegs chromaprint.

But if we could figure that cmd out and create the db file we'd be in business.

Except for some DSNP tv shows which change their intros every episode. 

Link to comment
Share on other sites

Sammy
35 minutes ago, chef said:

After working with auto organize, I think we can create a db file which holds all the info.

I don't know how to analyze files yet with ffmpegs chromaprint.

But if we could figure that cmd out and create the db file we'd be in business.

Except for some DSNP tv shows which change their intros every episode. 

Maybe this is something @softworkzcan assist with??

Link to comment
Share on other sites

rbjtech

Guys - there was always some groundwork needed on the emby server and/or clients before this even could be a possibility.

Even if you did have a precise 'intro jump point' - how would you jump to it if the majority of clients could not even jump to a chapter point ?

The great news, is some significant progress has recently been made in this area - and the new Beta allows chapter points and other 'jump to' points from the OSD for all of the clients (excl LG I believe).

https://emby.media/community/index.php?/topic/100330-osd-updates-are-coming/

I don't know what the plans are, but assuming you had 'Intro Skip' points available (in the dB as maybe special chapter points), then a 'Intro Skip' button on the OSD seems the next logical step to me ...

;)

  • Agree 2
Link to comment
Share on other sites

chef

Hi again!

Below is (from what I can tell) a working proof of concept for the IntroSkip Plugin.

Please keep in mind, the initial scheduled task is HUGE! I mean HUGE. You'll have to run the Audio fingerprint task first. It might take upwards of a day to complete.

 

What does it do?

 It will scan your entire library and take audio snippets of your tv show.

The audio snippets are then compared for similarities using chromaprint technology.

When similarities are found we consider these TV show title sequences.

The Sequences  are then marked and saved.

The plugin will open an endpoint on your server for Emby clients to request title sequence data. 

introskip_v1.thumb.png.c25f791bf30fb9b5e019e13a53f9d4e8.png

 

What this doesn't do...

This plugin does not actually enable "skip Intro" on any of the Emby clients.

 

 

Note: higher powered machines may change the max degree of parallelism in the plugin options. This will run the task on more series at once. Please KEEP SETTINGS SANE! Probably don't do more then 8 at a time for high powered computers. Default is 5.

I knew a user who ran the scan on 25 series at once... He had a really powerful server... probably don't do that, okay.

 

Last thing,  make sure the "Duration of fingerprinted audio" is set to 15 minutes. Sometimes a title sequence doesn't happen right away, like if there are recaps.

 

DOWNLOAD: IntroSkip.zip

This proof of concept plugin was created by a lot of really talented community members. So many people put a lot of time into it. A lot of thanks to everyone who had the ideas, and helped build the thing.

 

Have fun if you try it :)

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

samuelqwe
On 12/08/2021 at 12:43, chef said:

I don't know how to analyze files yet with ffmpegs chromaprint.

But if we could figure that cmd out and create the db file we'd be in business. 

I had a bit of time to mess around with this today, but here's what I was able to figure out.

To get the fingerprints I used this command:

ffmpeg ^
-i "C:\Data\media\episode.mkv" ^
-t 300 ^
-ac 1 ^
-acodec pcm_s16le ^
-ar 16000 ^
-c:v nul ^
-f chromaprint ^
-fp_format raw ^
fingerprint.bin

This command fingerprints the first 300 seconds of the file (this can be adjusted to whatever you want) and stores the raw binary fingerprint in the fingerprint.bin file. We could probably figure out a way to directly read the output without saving to a file, but if we save to a file we can reuse the fingerprint later. This file is just a raw binary file that we can read and then convert each 4 bytes (at least, I think it's 4 bytes) into a number/integer. I don't know how exactly this is done in C#, but I'm sure we can figure it out. Once we have converted every byte in that file to a number, we have the full fingerprint which we can store in an array. We repeat this for the second episode.

Then, the process is very similar to the one used currently in the plugin, although the integers are now directly comparable and we don't require the hamming distances anymore which should speed things up a little bit. We can simply find the absolute difference (absolute value of n1 - n2) for each number in both fingerprints arrays. (EDIT 2: Turns out I might wrong about this, after further testing I believe that each integer in the array actually represents 4 bytes. Now the numbers look like the ones we had before, and hamming distance is still required to get the proper results.) As far as I can tell in my limited testing, everything else remains the same.

Hope this information is helpful!

EDIT: I just wanted to clarify that the fingerprints seem to be a fixed length regardless of if we analyze the first minute of an episode or the whole episode, and I have not figured how to change their length as we did previously, but it seems to work regardless as long as we make sure that we are analyzing the same length of audio in both episodes.

Edited by samuelqwe
Clarified some information that may have been wrong
  • Like 2
Link to comment
Share on other sites

chef
9 hours ago, samuelqwe said:

I had a bit of time to mess around with this today, but here's what I was able to figure out.

To get the fingerprints I used this command:



ffmpeg ^
-i "C:\Data\media\episode.mkv" ^
-t 300 ^
-ac 1 ^
-acodec pcm_s16le ^
-ar 16000 ^
-c:v nul ^
-f chromaprint ^
-fp_format raw ^
fingerprint.bin

This command fingerprints the first 300 seconds of the file (this can be adjusted to whatever you want) and stores the raw binary fingerprint in the fingerprint.bin file. We could probably figure out a way to directly read the output without saving to a file, but if we save to a file we can reuse the fingerprint later. This file is just a raw binary file that we can read and then convert each byte into a number/integer. I don't know how exactly this is done in C#, but I'm sure we can figure it out. Once we have converted every byte in that file to a number, we have the full fingerprint which we can store in an array. We repeat this for the second episode.

Then, the process is very similar to the one used currently in the plugin, although the integers are now directly comparable and we don't require the hamming distances anymore which should speed things up a little bit. We can simply find the absolute difference (absolute value of n1 - n2) for each number in both fingerprints arrays. As far as I can tell in my limited testing, everything else remains the same.

Hope this information is helpful!

EDIT: I just wanted to clarify that the fingerprints seem to be a fixed length regardless of if we analyze the first minute of an episode or the whole episode, and I have not figured how to change their length as we did previously, but it seems to work regardless as long as we make sure that we are analyzing the same length of audio in both episodes.

You're awesome Sam 😎!

3 hours ago, rbjtech said:

@chef I'm going to have a play with this today and I'll report back.

 If we can skip the .bin and create the array in memory, we can create a db file to keep the data for each episode. That would streamline everything. A db entry could have an id, fingerprint, start timestamp, end timestamp.

Man, that would be really cool, and fast too!

But, if we have to create a .bin, that is a small price to pay for a little file cleanup after. 

 

Edited by chef
Link to comment
Share on other sites

rbjtech

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

 

Edited by rbjtech
  • Thanks 2
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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