python-ffmpeg didn't play well with rq's timeout exceptions, causing deadlocks.
This PR replaces python-ffmpeg with a much simpler function that doesn't cause deadlocks on interruption, at a cost of having to think more about ffmpeg's input arguments.
It raises FFmpegError if ffmpeg exits with a non-zero exit code.
It also passes on the TimeoutExpired error that it may get from subprocess if ffmpeg times out. This causes rq's logging to throw a weird error if uncaught, but doesn't cause the worker to die or become unusable.
I've tested this PR by running about 200 videos through it - I encountered no deadlocks or dead workers.
python-ffmpeg didn't play well with rq's timeout exceptions, causing deadlocks.
This PR replaces python-ffmpeg with a much simpler function that doesn't cause deadlocks on interruption, at a cost of having to think more about ffmpeg's input arguments. It raises
FFmpegError
if ffmpeg exits with a non-zero exit code. It also passes on theTimeoutExpired
error that it may get fromsubprocess
if ffmpeg times out. This causes rq's logging to throw a weird error if uncaught, but doesn't cause the worker to die or become unusable.I've tested this PR by running about 200 videos through it - I encountered no deadlocks or dead workers.