streaming/backend
Install and configure nginx to act as a streaming backend server.
Tasks
Everything is in the tasks/main.yml
file.
Available variables
Main variables are:
debian_version
: Codename of the version of Debian used.streaming.backend.data_root
: nginx data_root.streaming.adaptive
: configuration of HLS encoding variantsvideo_codec
: HLS video codec. Should probably belibx264
audio_codec
: HLS audio codec. Should probably beaac
variants
: a description of all the variants. Should be an object; each attribute is another object with the below items. The name of the attribute will be used as the name of the stream.hls_bandwidth
: the bandwidth as configured in the HLS manifestvideo_bitrate
: the video bitrate as passed to ffmpegaudio_bitrate
: the audio bitrate as passed to ffmpegextra_settings
: any extra settings to pass to ffmpeg for this video streamwidth
: the width of this stream, used for scaling (height is computed)
streaming.hq_config
: configuration of main HLS variantkeyframe_period
: how much time (in seconds) between key frames for the HLS streamwidth
: width (in pixels) of the source video streamhls_bandwidth
: the bandwidth of the “source” video stream as it will be stored in the HLS manifestvideo_bitrate
: the bitrate for the “source” video stream as passed to ffmpeg for transcodingaudio_bitrate
: the bitrate for the “source” audio stream as passed to ffmpeg for transcoding
streaming.dash
: configuration of DASH encoding variantsvideo_codec
: the video codec for streams in the DASH manifest (e.g.,libsvtav1
for AV1)audio_codec
: the audio codec for streams in the DASH manifest (e.g., ‘libopus’ for Opus)preset
: the parameter used for the-preset
parameter to ffmpeg (e.g.,8
for AV1 without dropping frames on modern hardware)video_variants
: an array of objects. Each object can have the following attributes, all of which are optional (in which case the relevant parameter is not passed to ffmpeg):crf
: the value of the-crf
parameter passed to ffmpeg for that stream (e.g.,23
)scale
: the value of the-s
parameter passed to ffmpeg for that stream (e.g.,640x360
to scale a 720p video to half resolution)bitrate
: the value of the-b
parameter passed to ffmpeg for that streammaxrate
: the value of the-maxrate
parameter passed to ffmpeg for that stream
audio_variants
: and array of objects. Same system as forvideo_variants
, except that only one object parameter is supported:bitrate
, for the audio bit rate for that alternative.
streaming.backend.server_name
: The FQDN of your backend streaming server.streaming.rooms
: List. The name of the different rooms you are recording in. This will end up in the URL of the stream available.streaming.youtube_stream_keys
: Optional, a dictionary of room names to youtube streaming keys. The stream will be mirrored to YouTube.
Other variables used are:
letsencrypt_well_known_dir
: Directory where to store the/.well-known/
data for the Let’s Encrypt challenge.skip_unit_test
: Used internally by the test suite to disable actions that can’t be performed in the gitlab-ci test runner.