Jump to content

ComSkipper ... A Emby Plugin that skips commercials


BillOatman

Recommended Posts

BillOatman

ComSkipper ... A Emby Plugin that skips commercials in recordings using output from comskip.

This plugin will work with EDL files generated by Comskip, ShowAnalyzer or any other application capable 
of generating them to automagically skip past commercials when playing back recordings in Emby.  
A visual localized notification will be presented on the screen when this happens. 

UNC network mappings are fine - as long as the .EDL file is in the same filename as the media file.

A PDF is included in the download that explains all of the details.  But one thing should be made clear up front.
And that is this plugin does NOT contain comskip, show analyzer, or any other program that detects the commercials
and creates the EDL files with the skipping information.  Also, the donator version of comskip is required because
Emby stores its recordings in .TS format.
  I'm told the donator version is no longer required.

User @vdrovergraciously created a PDF file on how to get this working on Ubuntu. It can be found in the Github repository in the doc folder and will be included in future releases.

The PDF file also shows an easy way to configure Emby to automatically run comskip after each recording on a Windows server.
Linux server users will need to figure out the best way to do this for their flavor of Linux.  I am not a Linux advocate
or user, however I did find this information in the NextPVR forum that is encouraging, and I encourage Linux 
users to help each other out with this as I will be of little to no help in this regard.

https://forums.nextpvr.com/showthread.php?tid=60803

Building Comskip is really quick and easy on Ubuntu, so probably the same for any Debian based distro:
$ sudo apt-get update
$ sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev autoconf automake git libargtable2-dev libtool
$ git clone git://github.com/erikkaashoek/Comskip
$ cd Comskip
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Once this is out long enough where I am pretty sure it is stable, I'll make its GIT repository public.
Git Repo


Getting it into the plugin catalog could follow after that, assuming the Emby team approves.

I rarely record, my main use case is NFL football games.  I record our local teams game, which when complete
runs comskip on the recording which takes about 40 minutes.  We then watch the game while eating dinner
that evening.  Skipping halftime (manually) it brings the time from 3-4 hours to 2 to 2.5 hours.  
Comskip does a very good, remarkable really, job on all of my recordings including the games to date. 

I have attached the comskip.ini that I use.  It works well for me in the US.
If you add this to your ini (make sure your system has the processing power to handle it), it will greatly reduce he time comskip takes to process your file (requires donator version).
thread_count=2

Have fun and enjoy commercial free recordings :)

Current Release

Version 2.1.0.0 - A change in Emby 4.8 caused a code update to be required in how DL files are read.  If the plugin stops working in server 4.8, update to the latest plugin.

Version 2.0.0.0 - Allows for chapters to identify commercial points if they exist.  PlayOn and perhaps others identify commercials that way.

Version 1.6.0.0 - Allows configuration of time message is displayed on the screen.
                              Allows configuration of message displayed on the screen.
                              Optionally displays the skipped time in minutes:seconds.

Version 1.5.0.0 - Added optional commercial duration skipped to the on screen message by request.

Version 1.4.0.0 - Made a couple log messages info from debug by request.

Version 1.2.3.0 - Upgraded to Emby server 4.7.

Version 1.2.2.1 - Added German (de) translation.

Version 1.2.2.0 - Culture set so EDL file can be parsed everywhere.

Version 1.2.1.0 - Real time no longer experimental.
                               Session ID fix for LG (and maybe other) clients.

Version 1.2.0.0 - Experimental feature to allow commercial skipping when watching during recording
                               Initial open source release.

Version 1.0.0.2 - Initial release.

Version 1.0.1.0 - Addition of configuration switch to disable on-screen notifications.  **Note** You will need to clear your browser cache due to the config UI change.

 

comskipper.ini

Edited by BillOatman
  • Like 10
  • Thanks 4
Link to comment
Share on other sites

BillOatman
1 minute ago, Sammy said:

D'fuq?

Wow! Might give this a whirl but am pretty happy with MCEBuddy at this point.

The difference I think is this is non destructive.  The recording is not modified so if comskip makes a mistake, you can rewind and not miss any of the show (and change the EDL file manually to adjust if you like).

  • Like 1
Link to comment
Share on other sites

Installed the plugin on my Windows server (production) and a Linux test box.  Only tested from Windows server so far.  It is great to have the automatic skip function in Emby!  

Thanks for making this available.   

  • Thanks 1
Link to comment
Share on other sites

Spaceboy

nice, well done. would be good if people could share their successful comskip.ini. when we tried this a few years ago we found that ad detection was not that reliable, particularly using the method that analyses the files as they are being recorded

Link to comment
Share on other sites

BillOatman
6 hours ago, Spaceboy said:

nice, well done. would be good if people could share their successful comskip.ini. when we tried this a few years ago we found that ad detection was not that reliable, particularly using the method that analyses the files as they are being recorded

I just use the out of the box comskip.ini from the donators area. But they have a lot there I see for various countries.

Edited by BillOatman
Link to comment
Share on other sites

BillOatman
6 hours ago, Spaceboy said:

nice, well done. would be good if people could share their successful comskip.ini. when we tried this a few years ago we found that ad detection was not that reliable, particularly using the method that analyses the files as they are being recorded

If the goal for this is skipping commercials while watching things being recorded that won't work.  The EDL file is read on the playbackstart event so they wont be updated on the fly.  In my case it takes 40 minutes to comskip a 185 minute recording.  But if the goal is just to eliminate most of that extra time and have the recording processed more or less immediately after recording completes, party on :)

Link to comment
Share on other sites

Spaceboy
1 hour ago, BillOatman said:

If the goal for this is skipping commercials while watching things being recorded that won't work.  The EDL file is read on the playbackstart event so they wont be updated on the fly.  In my case it takes 40 minutes to comskip a 185 minute recording.  But if the goal is just to eliminate most of that extra time and have the recording processed more or less immediately after recording completes, party on :)

well my ultimate goal would be to replicate what was possible with windows media centre and dvrmstoolbox which did indeed analyse recordings on the fly and i guess re-read the created edl file regularly to allow skipping of commercials in in-progress recordings.

do you see any possibility of working towards that?

Link to comment
Share on other sites

Spaceboy
1 hour ago, BillOatman said:

I just use the out of the box comskip.ini from the donators area. But they have a lot there I see for various countries.

yeah i have donators version of comskip and ini files from many years ago. it was really reliable in the old days but seems to have got worse

Link to comment
Share on other sites

I don't think the default ini file has changed at all, but the broadcasters have made commercial detection more difficult over time.  That said, I've only made one substantive change to the default file and then a few others mostly for housekeeping.

detect_method=107	; this adds silence detection to the default value of 43
verbose=0		; This suppresses much of the debug information produced by comskip.
output_default=0	; This suppresses the production of .txt files.
delete_logo_file=1	; This deletes the .logo file when comskip is completed.
disable_heuristics=4	; Added the missing ";" before the comment.

 

Link to comment
Share on other sites

BillOatman
25 minutes ago, Spaceboy said:

well my ultimate goal would be to replicate what was possible with windows media centre and dvrmstoolbox which did indeed analyse recordings on the fly and i guess re-read the created edl file regularly to allow skipping of commercials in in-progress recordings.

do you see any possibility of working towards that?

Probably not.  In a plugin you get 3 events from Emby, start/progress/stop.  The progress one gets called so often you wouldn't want to read that file every time, and that's where it would need to happen. Oh plus I dont think that EDL file is written until it is done analyzing, right??

Not sure how they do that, if you have a way of finding out I could look at it, but I'm not hopeful.

Edited by BillOatman
Link to comment
Share on other sites

BillOatman
8 minutes ago, richt said:

I don't think the default ini file has changed at all, but the broadcasters have made commercial detection more difficult over time.  That said, I've only made one substantive change to the default file and then a few others mostly for housekeeping.

output_default=0	; This suppresses the production of .txt files.
delete_logo_file=1	; This deletes the .logo file when comskip is completed.

 

Ohhhh I put stuff in my bat file to delete those files.  Your way is much better :)

  • Like 1
Link to comment
Share on other sites

Spaceboy
2 hours ago, BillOatman said:

Probably not.  In a plugin you get 3 events from Emby, start/progress/stop.  The progress one gets called so often you wouldn't want to read that file every time, and that's where it would need to happen. Oh plus I dont think that EDL file is written until it is done analyzing, right??

Not sure how they do that, if you have a way of finding out I could look at it, but I'm not hopeful.

let me come back to you. the edl file gets written/updated on the fly

image.thumb.png.4a428146c01074499f93a9f14d5abfec.png

Edited by Spaceboy
Link to comment
Share on other sites

BillOatman

Maybe read every minute or something as an option.  Possible but not right away.

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

Spaceboy
29 minutes ago, BillOatman said:

Maybe read every minute or something as an option.  Possible but not right away.

that would be ace

Link to comment
Share on other sites

BillOatman
24 minutes ago, Spaceboy said:

that would be ace

I actually made a branch today and coded this up.  Mainly because I didn't want to forget how I was going to do it.  I probably won't do more with it until the main release gets a little more run time.  But after that and  I make sure the change at least loads as it should I'll let you test it out if that's OK.

  • Like 1
Link to comment
Share on other sites

Spaceboy
1 hour ago, BillOatman said:

I actually made a branch today and coded this up.  Mainly because I didn't want to forget how I was going to do it.  I probably won't do more with it until the main release gets a little more run time.  But after that and  I make sure the change at least loads as it should I'll let you test it out if that's OK.

whenever you are ready

Link to comment
Share on other sites

BillOatman
5 hours ago, richt said:

I don't think the default ini file has changed at all, but the broadcasters have made commercial detection more difficult over time.  That said, I've only made one substantive change to the default file and then a few others mostly for housekeeping.

output_default=0	; This suppresses the production of .txt files.

 

I didnt have this in my ini file

  • Like 1
Link to comment
Share on other sites

Hi Great plugin by the way... Just would like to ask 1 question... and that is can you disable the popup message saying ad skipped so it makes it more seamless 

thanks

Link to comment
Share on other sites

BillOatman
3 minutes ago, kalg said:

Hi Great plugin by the way... Just would like to ask 1 question... and that is can you disable the popup message saying ad skipped so it makes it more seamless 

thanks

Yeah  can do that.

  • Thanks 1
Link to comment
Share on other sites

BillOatman

Update to optionally disable the on-screen notifications in the first post.

Edited by BillOatman
Link to comment
Share on other sites

Spaceboy

i have comskip running against the live tv recording using the scripterx plugin :D

all good to go here

just for info - the edl file seems to be within about a minute of the recording live tv point. analysis was finished less than a minute after the recording ended

Edited by Spaceboy
Link to comment
Share on other sites

BillOatman
1 hour ago, Spaceboy said:

i have comskip running against the live tv recording using the scripterx plugin :D

all good to go here

just for info - the edl file seems to be within about a minute of the recording live tv point. analysis was finished less than a minute after the recording ended

Cool I should be able to give you a test dll today or tomorrow to try out

  • Like 1
Link to comment
Share on other sites

Spaceboy
21 hours ago, BillOatman said:

Cool I should be able to give you a test dll today or tomorrow to try out

hi, before you do that, i am having some trouble with emby reading the edl files. edl naming and content below

image.png.138ac0b955d5649f5cb0ea8dc4ebb929.png

image.png.c754a9571987b26b3cd504efacce7224.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...