Jump to content

ComSkipper ... A Emby Plugin that skips commercials


BillOatman

Recommended Posts

abescalamis
9 hours ago, crusher11 said:

I'm not using an .sh file at all anymore, I'm just pointing the post processing at comskip directly. 

Can you please share how did you compile or get comskipper for the synology nas?

Link to comment
Share on other sites

abescalamis
6 minutes ago, crusher11 said:

Comskipper, or comskip? 

Comskip!, did you do it on ubuntu and then moved it to the NAS?

 

Link to comment
Share on other sites

abescalamis

I'm scratching my head on this one, I get no error and still doesn't work

 

2022-06-01 22:00:00.152 Info LiveTV: Running recording post processor /volume1/@appstore/comskip/bin/comskip --ini=/volume1/@appstore/comskip/var/comskip.ini "/volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts"
2022-06-01 22:00:00.155 Info LiveTV: Triggering refresh on /volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts
2022-06-01 22:00:00.163 Info LiveTV: Refreshing recording parent /volume1/Data/Media/DVR/The Office (2005)/Season 5
2022-06-01 22:00:00.225 Debug App: Refreshing /volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts due to date modified change 1654144434 - 1654145999.
2022-06-01 22:00:00.225 Debug App: FFProbeProvider reports change to 1861909 - /volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts
2022-06-01 22:00:00.227 Debug App: Running FFProbeProvider for /volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts
2022-06-01 22:00:00.236 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /var/packages/EmbyServer/target/bin/ffprobe -i file:"/volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2022-06-01 22:00:00.293 Debug MediaProbeManager: ProcessRun 'ffprobe' Started.
2022-06-01 22:00:00.939 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2022-06-01 22:00:01.127 Debug App: Running EpisodeNfoProvider for /volume1/Data/Media/DVR/The Office (2005)/Season 5/The Office S05E03 Business Ethics.ts
2022-06-01 22:00:01.808 Info LiveTV: Recording post-processing script completed with exit code 1
2022-06-01 22:00:02.428 Debug SqliteItemRepository: GetInternalItemIdsList query time (slow): 1213ms. Query: select A.Id from MediaItems A where type=23 AND ((ProviderIds || '|') like @AnyProviderIdEquals0 OR (ProviderIds || '|') like @AnyProviderIdEquals1) LIMIT 1
2022-06-01 22:00:03.380 Debug App: GenreImageProvider reports change to 2034 - 
2022-06-01 22:00:03.380 Debug App: Running GenreImageProvider for Sitcom
2022-06-01 22:02:54.218 Debug PortMapper: Creating port map on local port 8096 to public port 8096 with device 192.168.1.33
2022-06-01 22:02:54.219 Debug HttpClient: POST http://192.168.1.1:46421/ctl/IPConn
2022-06-01 22:02:54.225 Error HttpClient: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>718</errorCode><errorDescription>ConflictInMappingEntry</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2022-06-01 22:02:54.226 Debug HttpClient: POST http://192.168.1.1:46421/ctl/IPConn
2022-06-01 22:02:54.233 Error HttpClient: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>714</errorCode><errorDescription>NoSuchEntryInArray</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2022-06-01 22:02:54.235 Error PortMapper: Error in GetSpecificMappingAsync
	*** Error Report ***
	Version: 4.7.1.0
	Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
	Operating system: Linux version 3.10.108 (root@build17) (gcc version 8.5.0 (GCC) ) #42661 SMP Fri Apr 1 15:30:04 CST 2022
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/packages/EmbyServer/var
	Application path: /volume1/@appstore/EmbyServer/system
	MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>714</errorCode><errorDescription>NoSuchEntryInArray</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
	   at Mono.Nat.Upnp.UpnpNatDevice.GetSpecificMappingAsync(Protocol protocol, Int32 publicPort, CancellationToken cancellationToken)
	   at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping, CancellationToken cancellationToken)
	Source: Emby.Server.Implementations
	TargetSite: Void MoveNext()
	
2022-06-01 22:02:54.236 Debug PortMapper: Existing port mapping found. Will need to delete it first.
2022-06-01 22:02:54.236 Debug HttpClient: POST http://192.168.1.1:46421/ctl/IPConn
2022-06-01 22:02:54.249 Debug HttpClient: POST http://192.168.1.1:46421/ctl/IPConn
2022-06-01 22:02:54.254 Error HttpClient: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>718</errorCode><errorDescription>ConflictInMappingEntry</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2022-06-01 22:02:54.260 Error PortMapper: Error creating port map
	*** Error Report ***
	Version: 4.7.1.0
	Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
	Operating system: Linux version 3.10.108 (root@build17) (gcc version 8.5.0 (GCC) ) #42661 SMP Fri Apr 1 15:30:04 CST 2022
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/packages/EmbyServer/var
	Application path: /volume1/@appstore/EmbyServer/system
	MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>718</errorCode><errorDescription>ConflictInMappingEntry</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
	   at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMapInternal(Mapping mapping, CancellationToken cancellationToken)
	   at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping, CancellationToken cancellationToken)
	   at Emby.PortMapper.ExternalPortForwarding.CreateRules(INatDevice device, CancellationToken cancellationToken)
	Source: Emby.Server.Implementations
	TargetSite: Void MoveNext()

 

Link to comment
Share on other sites

abescalamis
Posted (edited)

I did it right at the beginning, I found my issue and it was having a NFS path for the DVR folder, I removed the nfs path and it everything worked, I will do an easy guide for synology nas.

Having an NFS path makes emby not detect the .edl and it doesn't save the EDL even if it everything is fine, the plugin will need to be updated to work with nfs paths.

Edited by abescalamis
Link to comment
Share on other sites

  • 3 weeks later...
muzicman0

I am using Caddy v2 as a reverse proxy a Cloudflare tunnel to access my server remotely, and it doesn't work unless I use the local IP address in a browser.  I assume remote connections from streaming devices would be the same, but no way to test.  Any way to make this work?  What can I provide to help?

So, if I enter http://10.x.x.121:8096 it works fine (obviously if I am on the local LAN), but if I use https://xxxxx.xxxxx.com it does not work.  

EDIT: Doh!  I am no longer using Caddy since I am behind CGNAT.  I am using an ARGO tunnel from Cloudflare which works great, except with this plugin.

Edited by muzicman0
Link to comment
Share on other sites

BillOatman
1 hour ago, muzicman0 said:

I am using Caddy v2 as a reverse proxy a Cloudflare tunnel to access my server remotely, and it doesn't work unless I use the local IP address in a browser.  I assume remote connections from streaming devices would be the same, but no way to test.  Any way to make this work?  What can I provide to help?

So, if I enter http://10.x.x.121:8096 it works fine (obviously if I am on the local LAN), but if I use https://xxxxx.xxxxx.com it does not work.  

EDIT: Doh!  I am no longer using Caddy since I am behind CGNAT.  I am using an ARGO tunnel from Cloudflare which works great, except with this plugin.

I'm not 100% what you are asking.  Did you try the plugin and it did not work?  If so can you turn on debug logging, play the recording to get well into a commercial, then send me the log, and the EDL file for the show and I will have a look.  Nothing networking related should be a problem as this plugin uses the standard Emby command SessionManager.SendPlaystateCommand with the Seek command to tell the client to skip the commercial.

Link to comment
Share on other sites

muzicman0

It only works if I use the IP address to access the server, not if I use my URL.  It may have nothing to do with the Cloudflare tunnel.  I will get some logs and post them.

Link to comment
Share on other sites

BillOatman
Posted (edited)
1 minute ago, muzicman0 said:

It only works if I use the IP address to access the server, not if I use my URL.  It may have nothing to do with the Cloudflare tunnel.  I will get some logs and post them.

Thanks, one server log (debug) and the EDL file should be enough.

Edited by BillOatman
Link to comment
Share on other sites

muzicman0

Meant to say this earlier.  

What happens is it shows that a commercial was skipped, but it doesn't actually skip the commercial.  Then playback starts again from the beginning (or possibly from where the commercial was marked).

 

Link to comment
Share on other sites

BillOatman
5 minutes ago, muzicman0 said:

Log at 9:35 says everything is fine:

Quote

Skipping commercial. Session: 9239a9a28d9cd471e80133bfc93a0ed9 Start = 19900000  End = 890400000

Are you watching via a web client? Do you have any other non browser clients to try?

@ebr This plugin is sending the seek command to the client like this.

        private void SkipCommercial(string sessionID, long seek)
        {
            PlaystateRequest playstateRequest = new PlaystateRequest();
            playstateRequest.Command = PlaystateCommand.Seek;

            UserQuery userListQuery = new UserQuery();
            userListQuery.IsAdministrator = true;
            playstateRequest.ControllingUserId =  this.UserManager.GetUserList(userListQuery).FirstOrDefault().Id.ToString();
            playstateRequest.SeekPositionTicks = new long?(seek);
            SessionManager.SendPlaystateCommand((string)null, sessionID, playstateRequest, CancellationToken.None);
        }

From an earlier post ...

Quote

http://10.x.x.121:8096 it works fine (obviously if I am on the local LAN), but if I use https://xxxxx.xxxxx.com it does not work. 

Not sure if there is a issue because of him using a domain name instead of an IP address maybe? But he is using a Cloudflare tunnel as well.

Link to comment
Share on other sites

muzicman0

It works fine on my Shield, but I am using the local IP address there, not the URL.

As I mentioned, it appears to work fine (says it skips the commercial), but it doesn't actually skip it.  But only if I am using the URL.  

I don't have a way of testing remote with a Streaming device, only from a browser.  It fails on a browser when remote as well.

On a whim, (using the URL in a browser), I used the on screen skip ahead buttons, and they do work fine.

Link to comment
Share on other sites

rbjtech

Hi @BillOatman

I've never really been a big liveTV user but recently started recording a few programmes and thus first time I've had the need to look at this plugin.

Now that the Introskip and EndCredit 'markers' have been included in the 'Core' (Chapters table in the main dB) - do you think there is any merit in getting the Commercials marked in the same way as Introskip ?  ie each commercial gets a  hidden MarkerType = 'ComStart' and 'ComEnd' and the emby client core does the skipping via a manual 'Skip Commercial' button (or Auto), not the plugin via Auto only (the same limitation we originally had with Introskip) ?

Detection would obviously remain with comskip - but another advantage is any code changes around button usage/placement etc/sessions/clients etc are all managed by the core.

Maybe something to think about - as you know, the Introskip team working with Luke & Eric managed to get both Intro and Credits working this way (and all clients now have this 'marker' framework/button in them I believe) - so I think it would be really cool if commercials could be skipped this way as well and your plugin basically becomes an EDL import process.

Alternatively of course, Emby may choose to directly support EDL files (lol) - but not sure if that is on the cards - this would certainly be a welcome stepping stone towards that.

Adding @Cheesegeezer for info but sadly I think @chef is out of the scene at the moment.

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

BillOatman
Posted (edited)
4 hours ago, rbjtech said:

Hi @BillOatman

I've never really been a big liveTV user but recently started recording a few programmes and thus first time I've had the need to look at this plugin.

Now that the Introskip and EndCredit 'markers' have been included in the 'Core' (Chapters table in the main dB) - do you think there is any merit in getting the Commercials marked in the same way as Introskip ?  ie each commercial gets a  hidden MarkerType = 'ComStart' and 'ComEnd' and the emby client core does the skipping via a manual 'Skip Commercial' button (or Auto), not the plugin via Auto only (the same limitation we originally had with Introskip) ?

Detection would obviously remain with comskip - but another advantage is any code changes around button usage/placement etc/sessions/clients etc are all managed by the core.

Maybe something to think about - as you know, the Introskip team working with Luke & Eric managed to get both Intro and Credits working this way (and all clients now have this 'marker' framework/button in them I believe) - so I think it would be really cool if commercials could be skipped this way as well and your plugin basically becomes an EDL import process.

Alternatively of course, Emby may choose to directly support EDL files (lol) - but not sure if that is on the cards - this would certainly be a welcome stepping stone towards that.

Adding @Cheesegeezer for info but sadly I think @chef is out of the scene at the moment.

Yeah I had thought about that, but figured I'd let core Emby handle that if they thought it was of value.  But certainly someone could do it that way :)

Also push a skip button for intros makes sense, it's once.  Needing to keep the remote in your hand to skip every commercial would be annoying and I'm not sure anyone would do it.  I know I would not.

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

rbjtech
1 hour ago, BillOatman said:

Also push a skip button for intros makes sense, it's once.  Needing to keep the remote in your hand to skip every commercial would be annoying and I'm not sure anyone would do it.  I know I would not.

A fair comment.  Been playing with comskip today and I can't get it to be anywhere near accurate enough to be left on Auto .. :(

It appears UK OTA TV is not the easiest to detect..  If I keep struggling, I'll reach out on the comskip forums for detection help.. as currently while the plugin is excellent - it source is very poor (for me).

  • Agree 1
Link to comment
Share on other sites

BillOatman
3 hours ago, rbjtech said:

A fair comment.  Been playing with comskip today and I can't get it to be anywhere near accurate enough to be left on Auto .. :(

It appears UK OTA TV is not the easiest to detect..  If I keep struggling, I'll reach out on the comskip forums for detection help.. as currently while the plugin is excellent - it source is very poor (for me).

I have heard that.  I took a look around for custom ini files for UK OTA but could not find any, sorry.

  • Thanks 1
Link to comment
Share on other sites

rbjtech
44 minutes ago, BillOatman said:

I have heard that.  I took a look around for custom ini files for UK OTA but could not find any, sorry.

Thanks for looking - I found one that somebody had created for UK OTA so just re-running it now - fingers crossed as I want this to work .. 

Link to comment
Share on other sites

If you haven't already found this give it a look, I recieve Canada/USA stations so I can't vouch for this and it is a wee bit dated.
http://www.kaashoek.com/comskip/viewtopic.php?f=2&t=1066

also if you are using Comskip's livetv mode DON'T!(actually it will give the same results in the end but only after it finishes) The end results are far superior if the entire recording is analyzed  (I find live skipping to be more frustrating than useful).
 

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...