Jump to content

ComSkipper ... A Emby Plugin that skips commercials


BillOatman

Recommended Posts

jasonmcroy

I just wanted to pop in and give a big Thank You for this plug-in! So, Thank You! I haven't been using Emby for TV viewing because Channels DVR does all this for me. This may bring me back to Emby altogether, even for Live TV recording.

I have one question - is there any way to make the message pop-up box smaller and in a different area on the screen (maybe more to the right and a little lower)?

Link to comment
Share on other sites

BillOatman
42 minutes ago, jasonmcroy said:

I just wanted to pop in and give a big Thank You for this plug-in! So, Thank You! I haven't been using Emby for TV viewing because Channels DVR does all this for me. This may bring me back to Emby altogether, even for Live TV recording.

I have one question - is there any way to make the message pop-up box smaller and in a different area on the screen (maybe more to the right and a little lower)?

Unfortunately no, that is controlled by core Emby.  It seems to vary device by device.  AndroidTV is what I use primarily and the notification window is HUGE.  Apparently some client devices aren't bad.  I know the guys working on the IntroSkip plugin ( @chef)  have noticed that as well and I believe have asked for it to be changed.  But until it is, all you can do is turn off the notification in the configuration.

It's probably too early to get it into the plugin catalog (right @ebr?)  Once it is it will be easier for people to use.

And last but not least, you are very welcome :)

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

jasonmcroy
2 hours ago, BillOatman said:

Unfortunately no, that is controlled by core Emby.  It seems to vary device by device.  AndroidTV is what I use primarily and the notification window is HUGE.  Apparently some client devices aren't bad.  I know the guys working on the IntroSkip plugin ( @chef)  have noticed that as well and I believe have asked for it to be changed.  But until it is, all you can do is turn off the notification in the configuration.

It's probably too early to get it into the plugin catalog (right @ebr?)  Once it is it will be easier for people to use.

And last but not least, you are very welcome :)

Ah, that makes sense. Yes, I was using it on my Shield TV in the Living Room which is a 65" TV and it is very large there. Not a big deal I guess because I would rather see it than turn it off completely. 

Either way, this plugin makes my TV watching experience much more pleasurably in Emby now, which I prefer to watch all my content through.

  • Like 1
Link to comment
Share on other sites

mike3821

I love this plugin. 

For me, the only thing missing from Emby at this point is discovering new upcoming shows.

  • Like 1
Link to comment
Share on other sites

ttgapers

FYI this works for me on the latest and previous betas. Will do some more testing but get the pop ups and edls etc. Thanks a lot @BillOatman

No real need for MCEbuddy to process this library now :) Watch and delete!

 

  • Thanks 1
Link to comment
Share on other sites

reneboulard

I found a little problem with the plugin.

My os locale is fr_CA

comskip write the edl file with number formatted in en_US (a . is use in fraction ie 9999.99)

So when the plugin try to parse the edl file it fail.

I change the edl with fr_CA formated number and it worked. (in fr_CA a , is use in fraction ie 9999,99)

I change the OS locale to en_CA with the original edl with en_US formated number and it worked.

There are 3 possibles solutions.

1) I change all my edl with a , and keep my OS in fr_CA.

2) I set my OS to en_CA

3) Set the locale to en_US when parsing the edl in the plugin

Hope this help.

 

Link to comment
Share on other sites

fedward

Thanks for this plugin!

My server is a Mac and my usual playback device is an LG TV running the WebOS client. With the plugin enabled and debug logging on, I see that the server correctly parses the EDL file for a recording when playback starts, and it logs "Skipping commercial" at the right point in playback, but it doesn't actually skip. The UI alert never displays either. I tested playback in the browser on the same computer that runs the server, and the behavior is the same: the debug message is logged, but the UI doesn't display the alert and playback doesn't skip to the end of the break. Here's the line from the debug log on the last attempt.

2022-01-15 13:43:45.119 Debug Com Skipper: Skipping commercial. Session: 5384062b33acd5e2ea927310434e7287 Start = 8860200000  End = 9241900000

So, the plugin initializes on playback, it correctly detects a break indicated in the EDL file, it logs correctly, but playback doesn't skip. Any thoughts on how to chase this down? My usual approach would be to start adding more debug messages within the function calls, but since I'm on a Mac I don't have a running instance of Visual Studio. Can it be built in VS Code?

Link to comment
Share on other sites

Deihmos

On Debian based distros you can simply input apt install comskip.  

Link to comment
Share on other sites

BillOatman
31 minutes ago, Deihmos said:

Is there no way to skip back or forward? 

Not sure what you mean.  You can ff or rewind as always.  But plugins can't add UI buttons.,  The skipping is automatic only.

Link to comment
Share on other sites

BillOatman
5 hours ago, fedward said:

Thanks for this plugin!

My server is a Mac and my usual playback device is an LG TV running the WebOS client. With the plugin enabled and debug logging on, I see that the server correctly parses the EDL file for a recording when playback starts, and it logs "Skipping commercial" at the right point in playback, but it doesn't actually skip. The UI alert never displays either. I tested playback in the browser on the same computer that runs the server, and the behavior is the same: the debug message is logged, but the UI doesn't display the alert and playback doesn't skip to the end of the break. Here's the line from the debug log on the last attempt.

2022-01-15 13:43:45.119 Debug Com Skipper: Skipping commercial. Session: 5384062b33acd5e2ea927310434e7287 Start = 8860200000  End = 9241900000

So, the plugin initializes on playback, it correctly detects a break indicated in the EDL file, it logs correctly, but playback doesn't skip. Any thoughts on how to chase this down? My usual approach would be to start adding more debug messages within the function calls, but since I'm on a Mac I don't have a running instance of Visual Studio. Can it be built in VS Code?

It should be able to be built in VS Code I believe.  

It grabs the ID of the first admin it finds to use for the playstate command.  Do you have no users defined as administrator on your server?

Link to comment
Share on other sites

fedward
13 minutes ago, BillOatman said:

It should be able to be built in VS Code I believe.  

It grabs the ID of the first admin it finds to use for the playstate command.  Do you have no users defined as administrator on your server?

The only defined account is an admin, so that’s not it.

Link to comment
Share on other sites

BillOatman
1 hour ago, fedward said:

The only defined account is an admin, so that’s not it.

I have no idea man :)  What happens when you watch something and send a message from the admin dashboard, does it show up on the screen?  It feels like a Emby issue, maybe with the Mac server since it is with more than one client.  I have no idea how to tell though.

Edited by BillOatman
Link to comment
Share on other sites

fedward

@BillOatmanRelease 4.6.7.0. If I'm in the UI on the TV but not playing content there's just one session, and any messages I send from the console appear on the TV. When playing content, however, a second session appears for the stream. That session says "direct playing" (If that makes a difference) and messages sent to that session aren't displayed. Messages sent to the first session still are, though.

Link to comment
Share on other sites

BillOatman
23 minutes ago, fedward said:

@BillOatmanRelease 4.6.7.0. If I'm in the UI on the TV but not playing content there's just one session, and any messages I send from the console appear on the TV. When playing content, however, a second session appears for the stream. That session says "direct playing" (If that makes a difference) and messages sent to that session aren't displayed. Messages sent to the first session still are, though.

@Luke and/or @ebr  This is using the release Mac server.  The plugin is getting notified of playback and progress on one of the sessions he describes, but the client does not display the message and the video does not respond to the PlayState command.  It would seem the plugin is given the wrong session with those events? Standard Emby messaging seems to have the same problem.

Edited by BillOatman
Link to comment
Share on other sites

BillOatman
12 hours ago, Luke said:

What app on the TV?

 LG TV running the WebOS client is what I see in earlier posts.  @fedward can you give any more specifics?

Link to comment
Share on other sites

fedward

@Luke The main client is Emby for LG 1.0.31 on an LG OLEDB6 running 5.60.25 (the latest version available for the TV). Server is a Mac running MacOS Catalina (10.15.7) and Emby 4.6.7.0.

Observed behavior: when playing content on the TV that has a corresponding EDL file, the plugin correctly initializes and records a debug message to the log when it reaches a point in playback that should be skipped. Playback does not skip to the end of the cut, however, and the "Commercials skipped" message does not appear in the UI. Further, in troubleshooting this I found that there are two concurrent sessions for the TV in the dashboard. If I send a message to the UI session it will appear on the TV, but if I send a message to the playback session (noted by "direct playing") in the dashboard, the message does not appear.

Expected behavior: playback should seek to the end of the break defined in the EDL. Messages should appear in the UI.

NOTE: While I did initially report problems with the plugin both using the TV app and the browser, it now looks like the problems I had in the web client were maybe caused by the presence of a .ffmeta file created by comskip (my comskip.ini was left over from another platform where having that file made sense). I relocated the .ffmeta file and playback in the browser does skip appropriately, so the problem seems to be restricted to the LG client. If that ffmpeg behavior is also a bug, it's a separate bug and (in my case) an easy fix in comskip.ini.

Link to comment
Share on other sites

I think what happens is LG doesn't allow the web socket connection to stay open very long, and closes it probably to reduce resource consumption.

Once that happens you won't be able to send it remote control commands anymore. We may have to consider just not having it be remote controllable altogether.

Link to comment
Share on other sites

fedward

I don't think it's a timeout, because the test content has an identified break from 0.00 to 66.00 in the recording and it should be skipping immediately. The web client does skip that break but the LG client just plays straight through.

I do think the control socket is getting closed when the TV's screen saver comes on, but that's a different problem. In this case I think the control messages sent to the LG client aren't sent to the right session on the client. If the screen saver never comes on, the control session does seem to stay alive for commands sent from the server.

Link to comment
Share on other sites

BillOatman

@fedward

I'd recommend picking up a streaming box and getting off the TV altogether.  Several decent ones for as low as $30.

  • Agree 1
Link to comment
Share on other sites

fedward

@BillOatman A streaming box is a non-starter between the "Smart TV" that actually covers most of our needs and the computer plugged into it over HDMI that pretty much covers the rest of them. I've mentioned getting a streaming stick or box a few times and my wife is not on board.

Anyway, I poked around the Swagger UI for the API and I learned a few things. When playing content the server shows not one, not two, but FOUR sessions for the TV, and I'm attaching the relevant parts of the response payload here. Two of these sessions (the first and third in the JSON body) have the same device ID and they actually seem to be the relevant sessions for this plugin. The second has its DeviceId value encoded differently, and I'm not bothering to decode it to see if it's just another representation of the same value because it doesn't seem relevant. The fourth session is a DLNA client and not an Emby Theater client, and it's also not relevant.

In the API tool I found that if I sent a seek command to the first session (the direct stream session) nothing happened. If I sent the seek command to the third session (the other session with the same DeviceID value) then playback would in fact seek to the specified value. This seems to validate my theory that the control session is distinct from the playback session.

Backing that theory up even more, in looking further at the JSON payload I see that the content playback session has

"SupportsRemoteControl": false

And the control session has

"SupportsRemoteControl": true

Seems like in this instance the plugin would need to check if the playback session's SupportsRemoteControl value is true, and if it's false then the plugin would need to find the other session with the same DeviceId value and a SupportsRemoteControl value of true.

Also @Luke it doesn't look like the remote control socket on the control session actually closes as you suspected. I've been playing with it and letting the TV's screen saver go on, and the same SessionId has worked for any commands I've sent with no sign of a failed command or timeout.

response_1642443100242.json

Link to comment
Share on other sites

BillOatman

The plugin gets its PlaybackProgress event called 

PlaybackProgress(object sender, PlaybackProgressEventArgs e)

And it uses the session ID from 

e.Session.Id

I also see this being available

e.PlaySessionId

@fedward Can you see if that session ID is the correct one for you?

Interesting and odd
 

Quote

Playback: Session.ID = 40d36db4c9959705944877a5f4faea89  PlaySessionId = 3849aaba698a4dd9b41a19d2198d06ed

The 2 session IDs are different for me.  @Luke what is the difference between session.id and the PlaySessionID ?

Edited by BillOatman
Link to comment
Share on other sites

PlaySessionId is only related to a particular stream. It should have been named StreamSessionId.

  • Thanks 1
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...