########################################################################################## HLS-13: Adaptive Bitrates from Named Pipe ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Open Resolution: Unresolved Project: HLS Stream Creator (HLS) Reported By: btasker Assigned To: btasker Components: - Transcoding - Adaptive Streams Targeted for fix in version: - VNEXT Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Where the input is a FIFO it's obviously only possible for one process to retrieve data. As the ABR functionality fires multiple _ffmpeg_ processes, it obviously won't work with a FIFO. Will need to implement a wrapper to read from the FIFO and make it available to the processes. At a very, very basic level, simply _cat_ting to a temp file may be sufficient (if a bit hacky). ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2015-06-16 03:40:23 btasker ----------------------------------------------------------------------------------------- It still feels a bit hacky (though better than using a temp file - especially for a linear stream) but if the input is a fifo, could look at creating additional fifo's and using _tee_ to push to them - each _ffmpeg_ process would then read from it's own _fifo_ Something along the lines of -- BEGIN SNIPPET -- for i in bitrates do mknod $TMPDIR/pip.encode.$i p # fire the ffmpeg process done # Start reading from the original fifo into the new pipes cat $fifo | tee (for i in bitrates; do echo $TMPDIR/pip.encode.$i; done) -- END SNIPPET -- I don't like it as a long-term solution, but it should work (once the crappy pseudo-code has been fixed). ----------------------------------------------------------------------------------------- 2015-06-16 16:50:59 btasker ----------------------------------------------------------------------------------------- Commit _a077490_ implements a fairly rough work-around to this issue - if the input file is a FIFO then a named pipe is created for each bitrate, and the original named pipe is read into all the bitrate specific pipes. It has the positive benefit of ensuring that all bitrates read from the source at the same speed, so the bitrate specific manifests stay more or less in sync. This does also mean that the encode is capped to the speed of the slowest encode. Video performance seems OK based on a few quick tests, but it needs more testing to be sure ----------------------------------------------------------------------------------------- 2015-06-16 16:51:16 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: HLS-Stream-Creator Commit: a077490bebcd5a3e57214548806c07d39a8a6778 Author: Ben Tasker