Jump to content

Recording post-processing


crusher11
Go to solution Solved by Q-Droid,

Recommended Posts

crusher11
Just now, cayars said:

Calling and running Comskip is about 5% to 10% of the overall process if you want to cut commercials from the recordings.

I'm using the Comskipper plugin, so it's actually 100% of the process. All I need is the EDL file in with the recording, and I'm good to go.

The sh file works just fine, if called manually in the terminal. So it's purely an Emby problem.

Link to comment
Share on other sites

Q-Droid
17 minutes ago, crusher11 said:

There was, but removing it made no difference. Wouldn't really expect it to given we already know the .sh works. It's just Emby not running it properly.

I suspect that for some reason it's not picking up the interpreter when called from emby. As a quick and possibly last test (because I can't test myself and got nothing left) try setting the Post-Processing application call in Emby settings to this:

/bin/sh /volume1/@appstore/comskip/bin/comskip.sh

Link to comment
Share on other sites

crusher11
10 minutes ago, Q-Droid said:

I suspect that for some reason it's not picking up the interpreter when called from emby. As a quick and possibly last test (because I can't test myself and got nothing left) try setting the Post-Processing application call in Emby settings to this:

/bin/sh /volume1/@appstore/comskip/bin/comskip.sh

Same error.

Link to comment
Share on other sites

Q-Droid

I'm tapped out. I don't have a Syno to test with nor am I running the CS plug-in or the latest server release. 

Hopefully someone else with Emby on synology can try it. 

Link to comment
Share on other sites

crusher11

The plugin isn't relevant, all it does is read the EDL file. Which I can't create, because comskip won't run.

Link to comment
Share on other sites

crusher11

Everything I can find for "exec format error" indicates that it's due to the lack of shebang, but the .sh file has a shebang and runs just fine if I SSH in.

So is Emby cocking this up? Has anyone had a successful Synology post-process?

Link to comment
Share on other sites

samuelqwe
6 hours ago, crusher11 said:

Everything I can find for "exec format error" indicates that it's due to the lack of shebang, but the .sh file has a shebang and runs just fine if I SSH in.

If the sh file works when you SSH, it might simply be a permissions issue. The permissions group that Emby runs from may not have execute permissions on the file.

Link to comment
Share on other sites

crusher11
3 minutes ago, samuelqwe said:

If the sh file works when you SSH, it might simply be a permissions issue. The permissions group that Emby runs from may not have execute permissions on the file.

So how do I go about fixing that? 

Link to comment
Share on other sites

samuelqwe
11 minutes ago, crusher11 said:

So how do I go about fixing that? 

There are probably better ways to do this, but running

sudo chmod +x comskip.sh

through your SSH session should add the execute permissions.

Link to comment
Share on other sites

crusher11
7 minutes ago, samuelqwe said:

There are probably better ways to do this, but running

sudo chmod +x comskip.sh

through your SSH session should add the execute permissions.

 

 

2022-05-19 23:08:02.280 Info LiveTV: Running recording post processor /bin/sh /volume1/@appstore/comskip/bin/comskip.sh /volume1/Emby Libraries/Recordings/The Equalizer/Season 2/The Equalizer S02E03 Leverage.ts
2022-05-19 23:08:02.287 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 (2): An error occurred trying to start process '/bin/sh /volume1/@appstore/comskip/bin/comskip.sh' with working directory '/'. No such file or directory
	   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)

Now there's "no such file or directory". Which is at least different.

Link to comment
Share on other sites

samuelqwe

Had you changed back the post processor settings in Emby to point to just the script file?

If so, what does the script look like now?

Link to comment
Share on other sites

crusher11
Just now, samuelqwe said:

Had you changed back the post processor settings in Emby to point to just the script file?

What do you mean by that?

Just now, samuelqwe said:

what does the script look like now?

Same as before:

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

 

Link to comment
Share on other sites

CBers
10 minutes ago, crusher11 said:

Same as before:

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

 

Try putting a new line in between 1st and 2nd lines with:

cd "${1}" 

Or whatever the path is to the folder holding the recording.

Also, give the script 777 permissions for the time being and see what happens.

 

Edited by CBers
Link to comment
Share on other sites

samuelqwe
7 minutes ago, crusher11 said:

What do you mean by that?

From what I remember, I thought you tried adding /bin/sh to the front of your script’s path on Emby’s post processing settings page. Just wanted to be sure that if you did, you changed it back to pointing to just the file without anything extra.

Link to comment
Share on other sites

crusher11
13 minutes ago, CBers said:

Also, give the script 777 permissions for the time being and see what happens.

I gave the entire comskip folder 777 permissions days ago, it was one of the first things I tried.

 

11 minutes ago, samuelqwe said:

From what I remember, I thought you tried adding /bin/sh to the front of your script’s path on Emby’s post processing settings page. Just wanted to be sure that if you did, you changed it back to pointing to just the file without anything extra.

Made no difference.

 

15 minutes ago, CBers said:

Try putting a new line in between 1st and 2nd lines with:

 

No dice there either.

Link to comment
Share on other sites

CBers
4 minutes ago, crusher11 said:

I gave the entire comskip folder 777 permissions days ago, it was one of the first things I tried.

 

Made no difference.

 

No dice there either.

So what error do you get now? 

What's in the PP field within Emby? 

Does the Emby user have full access to the shell that you're running the script in? 

 

Link to comment
Share on other sites

crusher11
Just now, CBers said:

So what error do you get now? 

What's in the PP field within Emby? 

Does the Emby user have full access to the shell that you're running the script in? 

 

Same error.

/volume1/@appstore/comskip/bin/comskip.sh

I don't know what the Emby user access is or what shell anything's running in (or what that even means TBH). I don't know what needs permissions for what.

Link to comment
Share on other sites

samuelqwe
8 minutes ago, CBers said:

Does the Emby user have full access to the shell that you're running the script in? 

Good point, Emby might not even have access to sh. It might have access to bash though, so you could try changing the first line of the script to:
 

#! /bin/bash

 

Link to comment
Share on other sites

crusher11
1 minute ago, samuelqwe said:

Good point, Emby might not even have access to sh. It might have access to bash though, so you could try changing the first line of the script to:
 

#! /bin/bash

 

Still saying the '/' directory doesn't exist:

2022-05-20 00:26:36.728 Info LiveTV: Running recording post processor /volume1/@appstore/comskip/bin/comskip.sh /volume1/Emby Libraries/Recordings/URBEX Enter At Your Own Risk/URBEX Enter At Your Own Risk 2022_05_19_23_50_00 - Unseen.ts
2022-05-20 00:26:36.729 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 (2): An error occurred trying to start process '/volume1/@appstore/comskip/bin/comskip.sh' with working directory '/'. No such file or directory
	   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)

 

Link to comment
Share on other sites

samuelqwe
2 minutes ago, crusher11 said:

Still saying the '/' directory doesn't exist

The error in the log might be an indication that the paths within the script are actually set up wrong then.

That’s the only other thing I can think to check, but I can’t tell you what to change it to since I don’t know how everything is set up on your system.

Link to comment
Share on other sites

CBers

I think @cayars has knowledge of the device in question, so perhaps he can do a remote session with you.

 

  • Like 1
  • Agree 1
Link to comment
Share on other sites

crusher11
6 minutes ago, samuelqwe said:

The error in the log might be an indication that the paths within the script are actually set up wrong then.

That’s the only other thing I can think to check, but I can’t tell you what to change it to since I don’t know how everything is set up on your system.

Well I tried plugging in an exact path to a file instead of a variable, and then running it in PuTTY, and I get "-sh: /volume1/@appstore/comskip/bin/comskip.sh: bin/bash^M: bad interpreter: No such file or directory"

If I switch back to bin/sh in the sh file, the error makes the same switch but otherwise remains.

I ran the sh file in PuTTY just fine yesterday...

Link to comment
Share on other sites

@crusher11 If you want to PM me over what you have so far I could give it a try on my Synology.
That would probably be the easiest way as I'm familiar with the permissions set on my box.
 

Link to comment
Share on other sites

1 hour ago, samuelqwe said:

The error in the log might be an indication that the paths within the script are actually set up wrong then.

I only took a quick look at an error posted earlier and Emby was giving an error for the working directory being set to "/".
It's either a bad message (doubtful) or missing parameter or setup needed in the script.  Hard to say without trying it myself.

Link to comment
Share on other sites

  • Solution
Q-Droid

@crusher11 there's an example for Linux in the ComSkipper thread that doesn't use a shell script. Have you tried configuring yours similarly, using different paths of course.

 

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