From: Ben Tasker Date: Sun, 14 Jun 2015 13:36:00 +0000 Subject: Removed input file check for HLS-8 X-Git-Tag: v1.0 X-Git-Url: https://publicrepos.bentasker.co.uk/projects/HLS-Stream-Creator.git/commitdiff/b16020d65493c3c486a87ce73ddbdabff2cb8cf1 --- Removed input file check for HLS-8 --- --- a/HLS-Stream-Creator.sh +++ b/HLS-Stream-Creator.sh @@ -230,15 +230,6 @@ exit 1 fi - -# Now we want to make sure out input file actually exists -# This will need tweaking in future if we want to allow a RTMP stream (for example) to be used as input -if ! [ -f "$INPUTFILE" ] -then - echo "Error: You gave me an incorrect filename. Please re-run specifying something that actually exists!" - exit 1 -fi - # Check output directory exists otherwise create it if [ ! -w $OUTPUT_DIRECTORY ] then @@ -291,7 +282,7 @@ echo "Generating HLS segments for bitrate ${br}k - this may take some time" - if [ "$NO_FORK" == "0" ] && [ ! "$LIVE_STREAM" == "1" ] + if [ "$NO_FORK" == "0" ] || [ "$LIVE_STREAM" == "1" ] then # Processing Starts createStream "$PLAYLIST_NAME" "$OUT_NAME" "$BITRATE" & @@ -306,7 +297,7 @@ done - if [ "$NO_FORK" == "0" ] && [ ! "$LIVE_STREAM" == "1" ] + if [ "$NO_FORK" == "0" ] || [ "$LIVE_STREAM" == "1" ] then # Monitor the background tasks for completion echo "All transcoding processes started, awaiting completion" @@ -329,3 +320,4 @@ fi + --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Usage is incredibly simple ``` -./HLS-Stream-Creator.sh -[l] [-c segmentcount] -i [inputfile] -s [segmentlength(seconds)] -o [outputdir] +./HLS-Stream-Creator.sh -[lf] [-c segmentcount] -i [inputfile] -s [segmentlength(seconds)] -o [outputdir] -b [bitrates] Deprecated Legacy usage: @@ -33,14 +33,39 @@ **Arguments** ``` + Mandatory Arguments: + -i [file] Input file -s [s] Segment length (seconds) + + Optional Arguments: + -o [directory] Output directory (default: ./output) -c [count] Number of segments to include in playlist (live streams only) - 0 is no limit - -l Input is a live stream + -b [bitrates] Output video Bitrates in kb/s (comma seperated list for adaptive streams) + -l Input is a live stream + -f Foreground encoding only (adaptive non-live streams only) +``` + + +Adaptive Streams +------------------ + +As of [HLS-6](http://projects.bentasker.co.uk/jira_projects/browse/HLS-6.html) the script can now generate adaptive streams with a top-level variant playlist for both VoD and Linear input streams. + +In order to create seperate bitrate streams, pass a comma seperated list in with the *-b* option ``` +./HLS-Stream-Creator.sh -i example.avi -s 10 -b 28,64,128,256 +``` +By default, transcoding for each bitrate will be forked into the background - if you wish to process the bitrates sequentially, pass the *-f* option + +``` +./HLS-Stream-Creator.sh -i example.avi -s 10 -b 28,64,128,256 -f +``` + +In either case, in accordance with the HLS spec, the audio bitrate will remain unchanged Output