Jump to content

Show Intro Skip Option


Liquidfire88

Recommended Posts

4 minutes ago, Cheesegeezer said:

 

go back and read thru the thread to get an understanding, you would also have load the beta version so that the chromaprint can be executed....

It's alright, it's been part of the Linux distro for months. He should be good to go, if he is on Synology.

Link to comment
Share on other sites

13 minutes ago, Cheesegeezer said:

It's all in the ItemRepo.  Create a field, Initialise it and then use the GetChapters() to get the list, insert the intro and then SaveChapters() with the new intro added


private ILibraryManager LibraryManager {get; set;}
        private IDtoService DtoService { get; set; }
        public static ChapterManager Instance {get; set; }
        private IItemRepository _ItemRepository;
        private ILogger _logger;

        public ChapterManager(ILibraryManager libraryManager, IDtoService dtoService, ILogger logger, IItemRepository ItemRepo)
        {
            LibraryManager = libraryManager;
            DtoService = dtoService;
            _logger = logger;
            _ItemRepository = ItemRepo;
            Instance = this;
            
        }

		public void EditChapters(long id)
        {
          	var item = LibraryManager.GetItemById(id);
            var itemDto = DtoService.GetBaseItemDto(item, new DtoOptions() { Fields = new ItemFields[] { ItemFields.Chapters } });
            List<ChapterInfo> getChapters = _ItemRepository.GetChapters(item);
            List<ChapterInfo> chapters = new List<ChapterInfo>();
			
          	//Lets get the existing chapters and put them in a new list so we can insert the new Intro Chapter
            foreach(var chap in getChapters)
            {
                chapters.Add(new ChapterInfo
                {

                    Name = chap.Name,
                    StartPositionTicks = chap.StartPositionTicks,
                });
            }

            if (titleSequence.TitleSequenceStart == TimeSpan.FromSeconds(0))
            {
              //do all the required logic to create a new point and insert to index point 1 in the chapters list, then save the new list
              
                _ItemRepository.SaveChapters(id, chapters)
            }
          
          

 

Hey! Nice one! Great work! I'll pull it in now! 

Link to comment
Share on other sites

@crusher11

You good with side loading plugins?

IntroSkip_v2.0.2.8.zip

 

I figure if we're going to get this implemented, then the more community members who have this, have run it, and had some success, the better.

The task is long... very long initially.

  1. Run the Fingerprinting task first. Let it complete before moving on. You can stop it at any time, but we need those chromaprints to detect title sequences.
  2. Then run the Title sequence detection. 

If you think that the tasks are going to overload your machine, open the advanced settings, and set the 'maxdegreeofparalellism' to 2. This will process 2 series at once instead of the default.

Let us know what happens.

Link to comment
Share on other sites

crusher11
33 minutes ago, Cheesegeezer said:

crusher just wait, we are still testing and playing at the minute.   All you would get currently is a list of intro points that can only be viewed in the config page. You can't do anything with them right now.

go back and read thru the thread to get an understanding, you would also have load the beta version so that the chromaprint can be executed....

 

32 minutes ago, chef said:

I'll put up a dll here.. in a moment.

Don't worry about chapters, this has nothing to do with chapters 😃.

 

I know how this works, I've been following this thread since it started (albeit not particularly closely).

But we're talking about inserting chapters into the database to use when skipping the intro, in the absence of a UI "skip intro" option. I'm suggesting a large number of shows, if added from official DVDs and Blu-Rays, would already have such a chapter point included which would render the plugin irrelevant. 

I happen to have a lot of TV shows, all from official DVDs and Blu-Rays, so with a way of flagging which episodes already have such a chapter marker we could begin to see how prevalent such a thing is. 

Link to comment
Share on other sites

crusher11

Can I exclude certain libraries? I have a lot of sporting events listed as TV shows, which are just going to waste a ton of time being scanned.

Link to comment
Share on other sites

52 minutes ago, crusher11 said:

 

I know how this works, I've been following this thread since it started (albeit not particularly closely).

But we're talking about inserting chapters into the database to use when skipping the intro, in the absence of a UI "skip intro" option. I'm suggesting a large number of shows, if added from official DVDs and Blu-Rays, would already have such a chapter point included which would render the plugin irrelevant. 

I happen to have a lot of TV shows, all from official DVDs and Blu-Rays, so with a way of flagging which episodes already have such a chapter marker we could begin to see how prevalent such a thing is. 

right, there has to be a toggle to opt into chapter editing for sure, and hopefully in the end, chapter editing isn't necessary. 

If we are going to continue to look at chapter editing as a viable thing moving forward, there will have to be some kind of check to see if the chapters already have an 'intro' there, and it'll be skipped. 

There is definitely more to  chapter editing then dropping timestamps into the db. 

Generally, when you have DVD/BR rips for shows, what are the 'intro' chapters named? are they named 'intro?

Link to comment
Share on other sites

53 minutes ago, crusher11 said:

Can I exclude certain libraries? I have a lot of sporting events listed as TV shows, which are just going to waste a ton of time being scanned.

No! do a test set! Sorry... that was close....

 

Perhaps shortly we can limit the query to a test set, but that is not coded in there yet.

Edited by chef
Link to comment
Share on other sites

crusher11
3 minutes ago, chef said:

Generally, when you have DVD/BR rips for shows, what are the 'intro' chapters named? are they named 'intro?

Chapter naming isn't a thing on discs AFAIK. They're just chapter 1, chapter 2, etc. Which is why I'm curious to run this with a "chapter point already exists" flag to see how common it is. 

 

2 minutes ago, chef said:

No! do a test set! Sorry... that was close....

Eh? 

Link to comment
Share on other sites

It seems the size issues are resolved so I will get back to helping test the new plugin you added above... I had to step back as my nas was crashing because of the size issues.

Thanks again everyone for the hard work.

  • Thanks 1
Link to comment
Share on other sites

4 minutes ago, crusher11 said:

Chapter naming isn't a thing on discs AFAIK. They're just chapter 1, chapter 2, etc. Which is why I'm curious to run this with a "chapter point already exists" flag to see how common it is. 

 

Eh? 

It'll scan and encode every series you have.

Perhaps wait for one more day, and I'll try to get a limit on the query properly added.

It should have been done before. 

I have a separate instance of emby running with a small set of episodes.

That is not ideal. I'll code a limit for series.

 

Sporting events... What is the metadata like for a sporting event. Does it have a genre we could look at to skip over those items?

Edited by chef
Link to comment
Share on other sites

rbjtech
11 minutes ago, crusher11 said:

... if added from official DVDs and Blu-Rays, would already have such a chapter point included which would render the plugin irrelevant. 

As has been show a few times now - having a chapter point mark the 'end' of the Intro is all well and good - but unless there is also a chapter point marking the 'Start' of the Intro - then how is emby going to know when to show the 'Skip Intro' button ?

On one of your shows with the chapters you describe - can you show the chapters using MediaInfo or something - and then actually watch for when the Intro Starts and ends ?

I would probably bet that the chapter points do not mark the 'Start' of the Intro - but just the end.  If this is the case, we still need the plugin...

Link to comment
Share on other sites

crusher11

They don't have anything. They're basically just home videos but I name them as episodes and put them in a TV library because it seems like the best presentation for them. 

  • Thanks 1
Link to comment
Share on other sites

crusher11
1 minute ago, rbjtech said:

As has been show a few times now - having a chapter point mark the 'end' of the Intro is all well and good - but unless there is also a chapter point marking the 'Start' of the Intro - then how is emby going to know when to show the 'Skip Intro' button ?

On one of your shows with the chapters you describe - can you show the chapters using MediaInfo or something - and then actually watch for when the Intro Starts and ends ?

I would probably bet that the chapter points do not mark the 'Start' of the Intro - but just the end.  If this is the case, we still need the plugin...

Only if we get past "add a chapter point so people can skip manually", which is the current plan, and onto "add a dedicated skip button that appears when appropriate", which is impossible without Emby itself changing to accommodate the code. 

Link to comment
Share on other sites

1 minute ago, rbjtech said:

As has been show a few times now - having a chapter point mark the 'end' of the Intro is all well and good - but unless there is also a chapter point marking the 'Start' of the Intro - then how is emby going to know when to show the 'Skip Intro' button ?

On one of your shows with the chapters you describe - can you show the chapters using MediaInfo or something - and then actually watch for when the Intro Starts and ends ?

I would probably bet that the chapter points do not mark the 'Start' of the Intro - but just the end.  If this is the case, we still need the plugin...

Oh, doh! Emby could use the chapter to show the button, of course.

I thought the client would have subscribed to PlaybackProgressEventArgs and wait for the timestamp.

But if it could use the chapter, then that might be easier... I don't know because I haven't ever coded a client.  At least there could be two options available for the developer to choose from... 

Link to comment
Share on other sites

rbjtech
8 minutes ago, crusher11 said:

Only if we get past "add a chapter point so people can skip manually", which is the current plan, and onto "add a dedicated skip button that appears when appropriate", which is impossible without Emby itself changing to accommodate the code. 

If you don't want to help - that is fine.  We are just trying to get to an intermediate step.

NONE of my shows from retail disks have a chapter start and stop point for the Intro - they just expect you to press 'next chapter' when the Intro starts.  Why would anybody want to skip to when the Intro STARTS ?  But we need that if we want Emby to pop up the button with the 'Skip Intro' - I'm not sure why people don't get that...

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

Micael456
10 minutes ago, chef said:

I don't know because I haven't ever coded a client.  At least there could be two options available for the developer to choose from... 

 

7 minutes ago, rbjtech said:

  But we need that if we want Emby to pop up the button with the 'Skip Intro'

I think this is the key issue here - we don't know and are just making somewhat educated guesses 😕. It might depend on chapter points, it might be able to read events directly. An "end of intro" marker would be enough for manual skipping, but for automatic / button click, I don't think we know without an admin chiming in?

Link to comment
Share on other sites

rbjtech
2 minutes ago, Micael456 said:

 

I think this is the key issue here - we don't know and are just making somewhat educated guesses 😕. It might depend on chapter points, it might be able to read events directly. An "end of intro" marker would be enough for manual skipping, but for automatic / button click, I don't think we know without an admin chiming in?

Wouldn't that be nice ! ;)

With HUGE respect to @chef, I do not think Core functionality is going to rely on a PlugIn Database for the lookup.

There is a Core Chapter table - it contains all the chapter points of every film and every show.  We need to get the IntroStart time from 'somewhere' - it maybe in this table with a special Chapter Name ?  It may be in another table entirely ? 

  • Like 1
Link to comment
Share on other sites

Cheesegeezer

I would like to chime in here, a listening event  is already in the client on run time ticks and chapter markers, i believe.  Or it used to be anyways. I will have to check again,  It wouldn't be too difficult to add this.  Essentially we are creating 2 flags and a listening event...

1. when runtime.ticks = chapter.introstart.ticks  display a onscreen button... 

or when chapter name = "Intro" display onscreen button until Intro chapter ends

2. if the introskip button is pressed.... move to next chapter (already in the code) it's like select chapter button.

Lets get the nuts and bolts of the plugin working first and accurately, we can worry about bells and whistles later.

  • Like 1
Link to comment
Share on other sites

Cheesegeezer
2 hours ago, chef said:

If you think that the tasks are going to overload your machine, open the advanced settings, and set the 'maxdegreeofparalellism' to 2. This will process 2 series at once instead of the default.

Let us know what happens.

This should be the default setting at 2 and let users increase it.

  • Agree 2
Link to comment
Share on other sites

Cheesegeezer

@rbjtech  here's a question.....

now you said that you sometime get a recap then 10 mins of tv show then the intro then the rest.

Can you share your chapter info cards, as i would imagine that the 10mins of show might throw a spanner in the works if Introstart time = 11mins and is chapter 3 or 4.

 

Link to comment
Share on other sites

rbjtech
2 minutes ago, Cheesegeezer said:

@rbjtech  here's a question.....

now you said that you sometime get a recap then 10 mins of tv show then the intro then the rest.

Can you share your chapter info cards, as i would imagine that the 10mins of show might throw a spanner in the works if Introstart time = 11mins and is chapter 3 or 4.

 

Sure - the example that springs to mind is s01e01 of Game of Thrones - that 'Intro' starts @ 7mins 18secs.

00:00:00.000                             : en:00:00:00.000
00:00:08.008                             : en:00:00:08.008
00:07:18.438                             : en:00:07:18.438
00:08:58.538                             : en:00:08:58.538
00:18:16.512                             : en:00:18:16.512
00:28:48.560                             : en:00:28:48.560
00:39:37.584                             : en:00:39:37.584
00:50:02.041                             : en:00:50:02.041
01:00:34.631                             : en:01:00:34.631

Another example is Das Boot s01e02 - Intro starts @ 5 mins 13 seconds

00:00:00.000                             : :00:00:00.000
00:05:13.800                             : :00:05:13.800
00:17:27.880                             : :00:17:27.880
00:25:27.800                             : :00:25:27.800
00:34:35.920                             : :00:34:35.920
00:43:28.240                             : :00:43:28.240
00:57:20.440                             : :00:57:20.440

So I've not seen anything past 10 mins - but I thought we were basing the FP duration on a percentage of the overall show duration ?

ie - for an 60 min show, this is probably not an issue, but for a 30 min show - it may be ?

Link to comment
Share on other sites

2 hours ago, Cheesegeezer said:

@rbjtech  here's a question.....

now you said that you sometime get a recap then 10 mins of tv show then the intro then the rest.

Can you share your chapter info cards, as i would imagine that the 10mins of show might throw a spanner in the works if Introstart time = 11mins and is chapter 3 or 4.

 

That is why I originally thought we had to push chapters ahead by the duration of the title sequence. We might lose a chapter at the end of the stream, but we gained an intro chapter.  I wasn't sure. 

@rbjtech

We will grab a 20 minute encoding of longer shows and 15 minutes of shorter ones.

We have to make sure that all the encodings we compare are of the same exact length.

It was easiest to take 15 or 20. If we took a percentage it might change for episodes in the season that are longer or shorter streams. Runtimes of 43:15 and 42:02 would get different encodings and it wouldn't end up working.

But both of those will resolve to 15 min encoding.

 

 

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

Micael456
10 hours ago, Cheesegeezer said:

This should be the default setting at 2 and let users increase it.

Sorry @chef, @Cheesegeezer... I think we'll need to have the option to go down to a single stream on low-power systems, or a limiter built in somewhere regardless of cores. Mine has keeled over taking out the embyserver again even set at 2.

I honestly don't get how that's possible given the odroid has a quad core- which is why I'm wondering if something else is at play Unfortunately I switched debug logs back off.

Link to comment
Share on other sites

crusher11

The Yes, Minister/Yes, Prime Minister special episode Party Games has exactly the same intro as the main episodes, but it fails to find an intro because it's the only episode in the Specials 'season' so it has nothing to compare to.

  • Like 1
Link to comment
Share on other sites

Micael456
2 hours ago, crusher11 said:

The Yes, Minister/Yes, Prime Minister special episode Party Games has exactly the same intro as the main episodes, but it fails to find an intro because it's the only episode in the Specials 'season' so it has nothing to compare to.

Yeah, we discussed specials a while back. @chef, I thought the plan was to compare specials / one-offs with an existing season until there was a match? Is this still in the pipeline? :)

Link to comment
Share on other sites

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