Jump to content

Did something change on how post processing scripts are called?


rpoitras

Recommended Posts

rpoitras

After upgrading to 4.1.0.26 my post-process script keeps failing on ffmpeg (default Ubuntu version) with an error code 139, which appears to be some segmentation fault due to file I/O. If I run the same script manually (as root) it runs successfully. Checking the log from my script ffmpeg fails immediately so not sure what's going on.

 

I want to change my script to use Emby's ffmpeg and got the method to do so from a user here on these forums but just haven't had time yet to do so.

 

So, did something change on how post processes are called?

Link to comment
Share on other sites

rpoitras

Strange. I just downgraded back to 4.0.2.0 and post processing is working fine again. There was nothing out of the ordinary in the logs on the latest version as it really doesn't show much except that it calls the script. I'm staying on 4.0.2.0 for now until I have time to dig into this further. I even tried running the script as the emby user and can't duplicate the issue. It's only when it runs on it's own after a recording has finished where the issue occurs.

Link to comment
Share on other sites

  • 1 month later...
rpoitras

So, I tried upgrading to the latest server (4.1.1.0) on Ubuntu and I'm still getting this error. It seems ffmpeg is getting a segmentation fault or something related to file I/O (ffmpeg returns error code 139), but it only happens when Emby is calling my script. If I run my post processing script as root or the emby user manually from the command line it works fine. The error happens ONLY when called by Emby as a post processing action. This does not happen at all with Emby version 4.0.2.0 (what I'm running now, as I have to) or previous versions.

 

Just searching for "emby ffmpeg return code 139" I can see a few posts where users seem to be having the same or similar issues. For example:

https://emby.media/community/index.php?/topic/70871-all-devices-reporting-playback-error-on-most-content/

https://emby.media/community/index.php?/topic/73995-playback-issues-v4110-stuttering-and-looping/

 

Note that I'm using ffmpeg that is installed with Ubuntu repositories. Is it possible that the post processing script is called before the recording file is closed or flushed or something like that? I never had this problem before so I believe something has to have changed since 4.0.2.0 regarding this, and searching for that error code with ffmpeg brings up potential file I/O issues. Also, since it runs fine if I do so afterwards from the console it seems it may be related. Any help?

Link to comment
Share on other sites

rpoitras

Yes, see my first post. The only relevant information i can gather is that it is a generic file I/O error from unix and it is being thrown when ffmpeg runs. I narrowed down my script to simply run ffmpeg on the input .TS file and transcode to an output MKV file and ffmpeg still segment faults and I don't know why. The only thing on my system that is changed in between tests is Emby. I tried an 'lsof' on the .TS file before processing with ffmpeg and it states the file is not in use so it's not Emby holding the file open or anything like that. I'm just looking for ideas since Emby seems to be triggering the issue.

Link to comment
Share on other sites

Q-Droid

Yes, see my first post. The only relevant information i can gather is that it is a generic file I/O error from unix and it is being thrown when ffmpeg runs. I narrowed down my script to simply run ffmpeg on the input .TS file and transcode to an output MKV file and ffmpeg still segment faults and I don't know why. The only thing on my system that is changed in between tests is Emby. I tried an 'lsof' on the .TS file before processing with ffmpeg and it states the file is not in use so it's not Emby holding the file open or anything like that. I'm just looking for ideas since Emby seems to be triggering the issue.

 

The post-processing script runs in a session with environment variables that might be causing a problem for you. For example LD_LIBRARY_PATH and LIBVA_DRIVERS_PATH are set to reference the emby installation which includes libs used by the built in ffmpeg. Is it possible the libs under emby might be causing a problem for the system ffmpeg?

 

You could run the emby ffmpeg in post-processing since the env is already setup to do so.

  • Like 1
Link to comment
Share on other sites

rpoitras

The post-processing script runs in a session with environment variables that might be causing a problem for you. For example LD_LIBRARY_PATH and LIBVA_DRIVERS_PATH are set to reference the emby installation which includes libs used by the built in ffmpeg. Is it possible the libs under emby might be causing a problem for the system ffmpeg?

 

You could run the emby ffmpeg in post-processing since the env is already setup to do so.

 

Well there you go! Thanks, Q-Droid!!

 

I had no idea about the session and just recently asked about how to use Emby's ffmpeg since it has options not in the regular ffmpeg. I just quickly tried using Emby's ffmpeg in my script and called from Emby and like you said, it works perfectly!

 

Thanks again for your help!!

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