HLS-11: Document Environment Variables



Issue Information

Issue Type: Task
 
Priority: Major
Status: Open

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: HLS Stream Creator (HLS)
Resolution: Unresolved
Target version: VNEXT,

Created: 2015-06-15 12:54:59
Time Spent Working


Description
There are now quite a few variables used within the script, many of which can be set prior to running it in order to avoid needing to pass command line options (allowing use of wrapper scripts).

It's probably worth creating a Markdown file containing a list of these and what they do/default to for easy reference (it'll also ensure that there aren't any which can only be set using an option).


Toggle State Changes

Activity


The current set of variables that are honoured is
# Basic config
OUTPUT_DIRECTORY=${OUTPUT_DIRECTORY:-'./output'}

# Change this if you want to specify a path to use a specific version of FFMPeg
FFMPEG=${FFMPEG:-'ffmpeg'}

# Number of threads which will be used for transcoding. With newer FFMPEGs and x264
# encoders "0" means "optimal". This is normally the number of CPU cores.
NUMTHREADS=${NUMTHREADS:-"0"}

# Video codec for the output video. Will be used as an value for the -vcodec argument
VIDEO_CODEC=${VIDEO_CODEC:-"libx264"}

# Audio codec for the output video. Will be used as an value for the -acodec argument
AUDIO_CODEC=${AUDIO_CODEC:-"aac"}

# Additional flags for ffmpeg
FFMPEG_FLAGS=${FFMPEG_FLAGS:-""}

# If the input is a live stream (i.e. linear video) this should be 1
LIVE_STREAM=${LIVE_STREAM:-0}

# Video bitrates to use in output (comma seperated list if you want to create an adaptive stream.)
# leave null to use the input bitrate
OP_BITRATES=${OP_BITRATES:-''}

# Determines whether the processing for adaptive streams should run sequentially or not
NO_FORK=${NO_FORK:-0}

# ... snip

TMPDIR=${TMPDIR:-"/tmp"}



Some of which have corresponding flags
Usage: HLS-Stream-Creator.sh -[lf] [-c segmentcount] -i [inputfile] -s [segmentlength(seconds)] -o [outputdir] -b [bitrates]  [-p filename]

	-i	Input file
	-s	Segment length (seconds)
	-o	Output directory (default: ./output)
	-l	Input is a live stream
	-c	Number of segments to include in playlist (live streams only) - 0 is no limit
	-b	Output video Bitrates (comma seperated list for adaptive streams)
	-f	Foreground encoding only (don't fork the encoding processes into the background - adaptive non-live streams only)
	-p	Playlist filename
	-t	Segment filename prefix
	-S	Segment directory name (default none)
	-e	Encrypt the HLS segments (default none)
	-2	2-pass encoding
	-q	Quality (changes to CRF)
	-C	Constant Bit Rate (CBR as opposed to AVB)


The FFMPEG specific ones are already well documented in the README, so will just need to add some info for each of the others
btasker added 'VNEXT' to Fix Version
btasker removed '1.0' from Fix Version