Jump to content

ComSkipper ... A Emby Plugin that skips commercials


BillOatman

Recommended Posts

BillOatman
5 hours ago, crusher11 said:

I've managed to set up comskip on my Synology, and run it on a recording, but it's only produced a TXT file, not an EDL file. It's also deleting the logo file, so it doesn't seem to be using the ini that's present in its folder.

Not sure what's going on here?

Be specific and specify the ini file to use in the command line option

--ini=comskip.ini

Link to comment
Share on other sites

BillOatman
3 hours ago, Spaceboy said:

post your comskip.ini. otherwise we're just guessing.

there was a pdf around somewhere which gave some tips but i don't see it anymore

The PDF is in the release zip file.  Here it is.  

Commercial Skipper Plugin.pdf

Link to comment
Share on other sites

crusher11
3 minutes ago, BillOatman said:

Be specific and specify the ini file to use in the command line option

--ini=comskip.ini

I'm running on a Synology NAS, not windows. I've just set it to run comskip in the post-processing section.

I can't modify, delete or replace the ini file because WinSCP keeps throwing permission errors. I vaguely remember there being a trick to logging in as root but I've long ago forgotten it. @FrostByte?

Link to comment
Share on other sites

FrostByte

Yes, if admin doesn't do the trick then you can configure WinSCP to use superuser 

 

  • Like 1
Link to comment
Share on other sites

crusher11

Yep, that did it. I'll set another recording and see how it goes, although I've still not done anything to specify the INI file because I don't know how to do that.

Link to comment
Share on other sites

crusher11

Okay, so I've figured out a thing in PuTTY that will run it correctly, and I get an EDL file. I'm just not sure how to have that run automatically, through the equivalent of a batch file, or include the path as a variable. @FrostByte?

Link to comment
Share on other sites

crusher11

I created a .sh file and put that in my comskip directory, and set the post-processing step to use that instead of comskip itself. It didn't do anything though.

 

#!/bin/sh
comskip --ini=../var/comskip.ini "${path}"

 

Link to comment
Share on other sites

Q-Droid
Posted (edited)
6 hours ago, crusher11 said:

I created a .sh file and put that in my comskip directory, and set the post-processing step to use that instead of comskip itself. It didn't do anything though.

 

#!/bin/sh
comskip --ini=../var/comskip.ini "${path}"

 

Change your .sh file to:

#!/bin/sh
comskip --ini=../var/comskip.ini "${1}"

Your original script is assuming that the file comskip.ini can be found by using a location relative to where the script is running from. You might also have to adjust the --ini entry to use a full path to the comskip.ini file.

 

Edited by Q-Droid
Link to comment
Share on other sites

crusher11

I have comskip/var/comskip.ini, comskip/bin/comskip, and comskip/bin/comskip.sh, so a relative path should be fine right?

Link to comment
Share on other sites

crusher11
Posted (edited)
2 hours ago, Q-Droid said:

Change your .sh file to:

#!/bin/sh
comskip --ini=../var/comskip.ini "${1}"

Your original script is assuming that the file comskip.ini can be found by using a location relative to where the script is running from. You might also have to adjust the --ini entry to use a full path to the comskip.ini file.

 

 

 

2022-05-18 23:09:43.867 Info LiveTV: Running recording post processor /volume1/@appstore/comskip/bin/comskip.sh /volume1/Emby Libraries/Recordings/Midsomer Murders (1997)/Season 5/Midsomer Murders S05E04 Murder On St Malley's Day.ts
2022-05-18 23:09:43.872 Error LiveTV: Error running recording post processor
	*** Error Report ***
	Version: 4.7.0.35
	Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /volume1/Emby -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 /volume1/Emby/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology_{version}_x86_64.spk
	Operating system: Linux version 4.4.59+ (root@build2) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP PREEMPT Sat Aug 28 02:16:43 CST 2021
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /volume1/Emby
	Application path: /volume1/@appstore/EmbyServer/system
	System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/volume1/@appstore/comskip/bin/comskip.sh' with working directory '/'. Permission denied
	   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
	   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
	   at Emby.Server.Implementations.Diagnostics.CommonProcess.Start()
	   at Emby.LiveTV.EmbyTV.PostProcessRecording(ActiveRecordingInfo recordingInfo)
	Source: System.Diagnostics.Process
	TargetSite: Boolean ForkAndExecProcess(System.Diagnostics.ProcessStartInfo, System.String, System.String[], System.String[], System.String, Boolean, UInt32, UInt32, UInt32[], Int32 ByRef, Int32 ByRef, Int32 ByRef, Boolean, Boolean)
Edited by crusher11
Link to comment
Share on other sites

Q-Droid
48 minutes ago, crusher11 said:

I have comskip/var/comskip.ini, comskip/bin/comskip, and comskip/bin/comskip.sh, so a relative path should be fine right?

I would say no. I'm making the assumption that you're running this script from Emby -> Live TV/DVR -> Advanced -> Recording post processing. The script will run under the context of the Emby server and current working directory is not going to be the comskip location. So it will not be able to derive the ini file location using a relative path.

5 minutes ago, crusher11 said:
	System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/volume1/@appstore/comskip/bin/comskip.sh' with working directory '/'. Permission denied

It looks like the emby server process does not have permissions to access and execute the script. Once you get that resolved then the path to comskip.sh above should be included in the script for both the comskip command and the path to the ini file.

You could do this in the script:

#!/bin/sh
CSDIR=$(dirname $0)

${CSDIR}/comskip --ini=${CSDIR}/../var/comskip.ini "${1}"

 

Link to comment
Share on other sites

crusher11
Just now, Q-Droid said:

I would say no. I'm making the assumption that you're running this script from Emby -> Live TV/DVR -> Advanced -> Recording post processing. The script will run under the context of the Emby server and current working directory is not going to be the comskip location. So it will not be able to derive the ini file location using a relative path.

It looks like the emby server process does not have permissions to access and execute the script. Once you get that resolved then the path to comskip.sh above should be included in the script for both the comskip command and the path to the ini file.

You could do this in the script:

#!/bin/sh
CSDIR=$(dirname $0)

${CSDIR}/comskip --ini=${CSDIR}/../var/comskip.ini "${1}"

 

Ah. I figured the script would run from where the script was saved.

Am I supposed to replace "dirname" with a path of some sort there? Or just copy and paste that as-is?

I have no idea how to resolve the permission issue.

Link to comment
Share on other sites

Q-Droid

"dirname" is an actual command, copy/paste as is.

You'll have to work through the Syno console to give the emby server process owner what it needs to access that location and execute that script. I can't give you details as I don't use Synology.

 

Link to comment
Share on other sites

crusher11
1 minute ago, Q-Droid said:

"dirname" is an actual command, copy/paste as is.

You'll have to work through the Syno console to give the emby server process owner what it needs to access that location and execute that script. I can't give you details as I don't use Synology.

 

But what owns the process and what location does it need access to? I'm not even sure what I'm looking for here.

Link to comment
Share on other sites

BillOatman
Posted (edited)

New release in first post. 

Upgrade to MediaBrowser.Server.Core to 4.7.0.30

Required a small code change for compatibility with the latest server.

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

Spaceboy
4 hours ago, BillOatman said:

New release in first post. 

Upgrade to MediaBrowser.Server.Core to 4.7.0.30

Required a small code change for compatibility with the latest server.

i only see comskip.ini in the first post?

Link to comment
Share on other sites

samuelqwe
4 minutes ago, Spaceboy said:

i only see comskip.ini in the first post?

You have to click the Current Release link right above the release notes.

  • Like 1
Link to comment
Share on other sites

Spaceboy
2 minutes ago, samuelqwe said:

You have to click the Current Release link right above the release notes.

i knew i must be doing something dense :D

Link to comment
Share on other sites

  • 2 weeks later...
abescalamis
On 5/18/2022 at 8:47 AM, crusher11 said:

But what owns the process and what location does it need access to? I'm not even sure what I'm looking for here.

If you manage to run it on synology NAS and get it working, please share how you did it, I was looking into using comskipper on docker, when I came across this topic and saw that you manage to install it on a NAS.

Thank you

 

Link to comment
Share on other sites

abescalamis
Posted (edited)
On 5/18/2022 at 8:47 AM, crusher11 said:

But what owns the process and what location does it need access to? I'm not even sure what I'm looking for here.

Login using putty and enter the following commands and that should be it, also make go to the shared folder settings and you give permission to emby to access to the directory where the .sh and .ini are saved.

sudo chown -R emby:emby /volume1/@appdata/EmbyServer/plugins/ComSkipper.dll
sudo chmod -R 777 /volume1/@appdata/EmbyServer/plugins/ComSkipper.dll
 

Edited by abescalamis
Link to comment
Share on other sites

abescalamis
Posted (edited)

The only thing I need help with is the path to enter in the .ssh file

tried this: 

#!/bin/sh
CSDIR=$(dirname $0)

${CSDIR}/AMC --ini=${CSDIR}/../Scripts/comskipper.ini "${1}"

 

The .ssh is stored in /volume1/AMC/Scripts/comskipper.sh

The .ini is stored in the same directory /volume1/AMC/Scripts/comskipper.ini

Edited by abescalamis
Link to comment
Share on other sites

crusher11
5 hours ago, abescalamis said:

If you manage to run it on synology NAS and get it working, please share how you did it, I was looking into using comskipper on docker, when I came across this topic and saw that you manage to install it on a NAS.

Thank you

 

Link to comment
Share on other sites

abescalamis
Posted (edited)
1 hour ago, crusher11 said:

 

What I did was to

1) move the plugin ComSkipper.dll to /volume1/@appdata/EmbyServer/plugins/ComSkipper.dll, Changed permissions owner and everything.

2) created a SSH file on /volume1/AMC/Scripts/comskipper.sh  

 #!/bin/sh
/volume1/AMC/Scripts --ini=/volume1/AMC/Scripts/comskipper.ini "${1}"

3) moved the default .ini to same directory as the .ssh file /volume1/AMC/Scripts/

4)changed 

image.png

What would you suggest, I'm just confused at the directories you used for the ini. and .ssh

Edited by abescalamis
Link to comment
Share on other sites

crusher11

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

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