Jump to content

DVR Post Processing Script Issue


srolomc

Recommended Posts

Hello,

 

I am having an issue running a post processing processing script after recording something from live tv.  My Emby server is setup to run as a docker container on my server.  When I add the script to the post processing field under the DVR sections, Emby does not complain about not being able to find the script, so that seems ok.  I have a few directories setup in the container that I use for accessing and storing files.

 

The script only takes in a single argument (path to the recorded file).  It runs fine if I run it from the command line.  I have the script setup to log output to a file; when Emby tries to run the script, it just fails, and I do not see a log generated, which makes me think the script is not even getting called.

 

I have attached the log to this post (postProcLog.txt); I am unable to discern any useful information about the script from the log, so I would appreciate it if someone else could take a look and see if there is any useful information in there.  I tried recording an episode of The Brady Bunch; here is the timestamp where the error occurred:

 

2018-12-02 19:00:00.033

 

I also attached the script I am using (postProcScript.txt) for reference.

 

Thanks for the help!

postProcLog.txt

postProcScript.txt

Link to comment
Share on other sites

The error says no such file or directory, so that suggests to me that this path you provided for the script is not valid:

/PostProc/postProc.bash
Link to comment
Share on other sites

It does appear that the script isn't running at all, although in order to put the script into that field in the DVR section, I used Emby's browse feature in the field to locate and select the script, so it definitely is able to see it there.  I wonder if it has something to do with it running in a container?  The permissions on the directory and script are full rwx to all users, so I would not think that it's a permissions issue either...I can play around with it a little more, but I'm not sure why it doesn't see the script when it tries to call it after recording.

Link to comment
Share on other sites

The script isn't running at all because it's never being executed. that means either the path you entered isn't valid, or emby doesn't have permissions on it.

Link to comment
Share on other sites

I agree that does seem to be the problem.  I tried moving the script to a different directory (one that I know Emby has access to since it records videos there) and provided full permissions again.  I am able to find it by browsing through Emby, but the script still does not execute.  I will keep playing around with it. My only thought right now is that something isn't working as I expect since I'm using a Docker container.

Edited by srolomc
Link to comment
Share on other sites

  • 2 months later...
rpoitras

I am having the same issue and also running in Docker.

 

My docker run command is:

docker run -d --volume /var/lib/emby-docker:/config --volume /media:/media --env UID=999 --env GID=998 --env GIDLIST=33 --restart always --network host emby/embyserver:latest

Listing of /var/lib/emby-docker:

drwxr-xr-x 19 emby emby   4096 Jan 30 21:00  cache
drwxr-xr-x  4 emby emby   4096 Nov 18 19:41  config
drwxr-xr-x  6 emby emby   4096 Feb  5 09:45  data
drwxr-xr-x  2 emby emby   4096 Oct 28 11:25  localization
drwxr-xr-x  2 emby emby   4096 Feb  6 13:50  logs
drwxr-xr-x  8 emby emby   4096 Jan  7 11:01  metadata
drwxr-xr-x  3 emby emby   4096 Jan 18 08:52  plugins
drwxr-xr-x  2 emby emby   4096 Feb  5 19:00 'plugins\\Statistics'
drwxr-xr-x  3 emby emby   4096 Oct 28 11:25  root
drwxr-xr-x  2 emby emby   4096 Feb  6 15:18  scripts
drwxr-xr-x  6 emby emby   4096 Nov 22 12:28  sync
drwxr-xr-x  2 emby emby 217088 Feb  6 16:12  transcoding-temp

And the contents of /var/lib/emby-docker/scripts:

-rw-r--r-- 1 emby emby 6597 Feb  6 13:59 comskip.ini
-rwxr-xr-x 1 emby emby 7634 Feb  6 15:15 postproc.sh

When using the search button (magnifying glass) to select the post-processing script, /config shows up with the "scripts" subdirectory as expected. I select and set the script as:

/config/scripts/postproc.sh

I set my arguments as needed but when Emby attempts to run the script I get the following in the log:

2019-02-06 21:12:35.417 Info App: Running recording post processor /config/scripts/postproc.sh --in-file="/media/NAS_RAID/Media/Emby_Series/Forged in Fire (2015)/Season 3/Forged in Fire S03E13 Cavalry Saber.ts" --dest-path="/media/NAS_RAID/Media/Emby_TV_Shows" --dest-path-level=2
2019-02-06 21:12:35.428 Error App: Error running recording post processor
    *** Error Report ***
    Version: 4.0.1.0
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Unix 4.15.0.45
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Processor count: 4
    Program data path: /config
    Application directory: /system
    System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (2): No such file or directory
     at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)

As seen above, emby has access/owns the directories and script files and the script works perfectly fine from the shell. I believe it has something to do with the mappings for the container but I'm not sure. The search button displays the directory structure correctly but I feel that when the script is attempted to be executed the path is wrong or the mapping is not taken into consideration.

Link to comment
Share on other sites

 

 

mapping is not taken into consideration.

 

Emby doesn't have knowledge of these. The docker container handles all of this.

Link to comment
Share on other sites

rpoitras

What does that mean? Certainly Emby is writing to the logs directory shown in my listings above so Emby knows about it for sure. I created the scripts directory there specifically because the parent directory was already mapped in between the container and my server. Again, Emby see's the script directory as well as the script itself when selecting the post-processing script it just seems that when it goes to run it, it can't find it.

Link to comment
Share on other sites

rpoitras

Ok, I figured out the issue. The docker container does not have bash installed and my script was set to use the bash shell. Changed it to use sh and it's working now. I have to tweak it a bit but that's why it wasn't working.

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