########################################################################################## HLS-29: Return relevant exit statuses ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Open Resolution: Unresolved Project: HLS Stream Creator (HLS) Reported By: btasker Assigned To: btasker Targeted for fix in version: - VNEXT Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== From Github #17 -- BEGIN QUOTE -- I was trying to use this as part of a general video pipeline, but the script doesn't exit with error codes if there are any problems (other than the one check to verify that ffmpeg exists). This makes it hard to know if it succeeded or not. -- END QUOTE -- With the forked processes for multiple bitrates this may be a little tricky to implement. But it might also be that we can switch away from forking the processes (if I can find my notes from previous tinkering to see why I chose not to use it). In any case, we should at least attempt to return an appropriate exit status on failure. ----------------------------------------------------------------------------------------- Issue Relations ================ - Github #17 (https://github.com/bentasker/HLS-Stream-Creator/issues/17) ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2019-07-28 12:05:02 btasker ----------------------------------------------------------------------------------------- MISC-34 has just provided a good example of why this is needed. Due to an NFS fault, mux jobs were running for a while and then FFMPEG segfaulted, leaving an incomplete encode, with no way for the wrapper script to identify it. ----------------------------------------------------------------------------------------- 2019-07-28 12:12:42 btasker ----------------------------------------------------------------------------------------- I have a PoC of a way to catch unnatural exits from ffmpeg running through some test encodes at the moment. Because of the difficulty of getting data from a forked process, in the event of a non-zero exit, createStream will write ffmpeg's status code out to an agreed flag file in $TMPDIR. I don't really like using files for this, it's messy, but is probably the simplest way to implement for now - at least without a substantial refactor. The main question mark over the PoC really, is whether or not I'm checking for the correct codes, it seems - https://lists.ffmpeg.org/pipermail/ffmpeg-user/2013-July/016245.html - ffmpeg isn't necessarily straight forward in that respect. From my reading, 123 could still represent a valid encode. For now, though, the PoC just checks for a non-zero code. ----------------------------------------------------------------------------------------- 2019-07-28 12:15:52 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: HLS-Stream-Creator Commit: d33618c89cd4c1080198796d714b4609d997738f Author: B Tasker