As part of my OnionStream experiment, I implemented a wrapper script for HLS Stream creator ( in OS-11 ).
Most of what the wrapper does is inapplicable to the HLS Stream Creator codebase - it's primarily concerned with fetching jobs from a queue, triggering HLS Stream Creator and then marking the job complete (and tidying the originals away).
However, to aid automation, there is one aspect I implemented that I'd like to move into this codebase.
The wrapper uses ffprobe on the source file to get the original bitrate, and then calculates the bitrates to specify in order to create an adaptive stream. At the moment it generates the following bitrates:
- Source bitrate
- Source * 0.75
- Source * 0.5
- Source * 0.4
- if (source * 0.4 > 250kbps) - 200kbps
This seems to work quite well, so it'd be good to implement the ability to do similar within the HLS Stream Creator codebase.
It shouldn't be the default behaviour, and should be enabled via a new CLI argument, at least to begin with.
Within the wrapper, the calculations are done using python (in order to parse ffprobe's JSON output). So will either need to translate that to BASH or build a short python statement within the script.