From bf2f592534204e6611bf96b4238fe406fa90f3de Mon Sep 17 00:00:00 2001 From: iolesyk Date: Wed, 28 Feb 2024 19:01:02 -0500 Subject: [PATCH] HLS configuration, output_format and dvr_playlist --- main.tf | 6 ++++ .../r5p_config_node_apps_plugins.sh | 12 +++++++- variables.tf | 30 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 29aeb86..8843677 100644 --- a/main.tf +++ b/main.tf @@ -687,6 +687,8 @@ resource "aws_instance" "red5pro_node_origin" { "export NODE_SOCIALPUSHER_ENABLE='${var.origin_image_red5pro_socialpusher_enable}'", "export NODE_SUPPRESSOR_ENABLE='${var.origin_image_red5pro_suppressor_enable}'", "export NODE_HLS_ENABLE='${var.origin_image_red5pro_hls_enable}'", + "export NODE_HLS_OUTPUT_FORMAT='${var.origin_image_red5pro_hls_output_format}'", + "export NODE_HLS_DVR_PLAYLIST='${var.origin_image_red5pro_hls_dvr_playlist}'", "export NODE_WEBHOOKS_ENABLE='${var.origin_image_red5pro_webhooks_enable}'", "export NODE_WEBHOOKS_ENDPOINT='${var.origin_image_red5pro_webhooks_endpoint}'", "export NODE_ROUND_TRIP_AUTH_ENABLE='${var.origin_image_red5pro_round_trip_auth_enable}'", @@ -850,6 +852,8 @@ resource "aws_instance" "red5pro_node_transcoder" { "export NODE_SOCIALPUSHER_ENABLE='${var.transcoder_image_red5pro_socialpusher_enable}'", "export NODE_SUPPRESSOR_ENABLE='${var.transcoder_image_red5pro_suppressor_enable}'", "export NODE_HLS_ENABLE='${var.transcoder_image_red5pro_hls_enable}'", + "export NODE_HLS_OUTPUT_FORMAT='${var.transcoder_image_red5pro_hls_output_format}'", + "export NODE_HLS_DVR_PLAYLIST='${var.transcoder_image_red5pro_hls_dvr_playlist}'", "export NODE_WEBHOOKS_ENABLE='${var.transcoder_image_red5pro_webhooks_enable}'", "export NODE_WEBHOOKS_ENDPOINT='${var.transcoder_image_red5pro_webhooks_endpoint}'", "export NODE_ROUND_TRIP_AUTH_ENABLE='${var.transcoder_image_red5pro_round_trip_auth_enable}'", @@ -1014,6 +1018,8 @@ resource "aws_instance" "red5pro_single" { "export NODE_SOCIALPUSHER_ENABLE='${var.red5pro_socialpusher_enable}'", "export NODE_SUPPRESSOR_ENABLE='${var.red5pro_suppressor_enable}'", "export NODE_HLS_ENABLE='${var.red5pro_hls_enable}'", + "export NODE_HLS_OUTPUT_FORMAT='${var.red5pro_hls_output_format}'", + "export NODE_HLS_DVR_PLAYLIST='${var.red5pro_hls_dvr_playlist}'", "export NODE_WEBHOOKS_ENABLE='${var.red5pro_webhooks_enable}'", "export NODE_WEBHOOKS_ENDPOINT='${var.red5pro_webhooks_endpoint}'", "export NODE_ROUND_TRIP_AUTH_ENABLE='${var.red5pro_round_trip_auth_enable}'", diff --git a/red5pro-installer/r5p_config_node_apps_plugins.sh b/red5pro-installer/r5p_config_node_apps_plugins.sh index 6a20d60..3e9f4e5 100755 --- a/red5pro-installer/r5p_config_node_apps_plugins.sh +++ b/red5pro-installer/r5p_config_node_apps_plugins.sh @@ -10,6 +10,8 @@ # NODE_SOCIALPUSHER_ENABLE=true # NODE_SUPPRESSOR_ENABLE=true # NODE_HLS_ENABLE=true +# NODE_HLS_OUTPUT_FORMAT=TS #(TS,FMP4,SMP4) +# NODE_HLS_DVR_PLAYLIST=true # NODE_CLOUDSTORAGE_ENABLE=true # NODE_CLOUDSTORAGE_AWS_ACCESS_KEY # NODE_CLOUDSTORAGE_AWS_SECRET_KEY @@ -98,9 +100,17 @@ config_node_apps_plugins(){ rm $RED5_HOME/plugins/inspector.jar fi fi + ### Red5Pro HLS if [[ "$NODE_HLS_ENABLE" == "true" ]]; then - log_i "Red5Pro HLS - enable" + log_i "Red5Pro HLS - enable. Output format: $NODE_HLS_OUTPUT_FORMAT, DVR playlist: $NODE_HLS_DVR_PLAYLIST" + + hls_output_format='' + hls_output_format_new='' + + hls_dvr_playlist='' + hls_dvr_playlist_new='' + sed -i -e "s|$hls_output_format|$hls_output_format_new|" -e "s|$hls_dvr_playlist|$hls_dvr_playlist_new|" "$RED5_HOME/conf/hlsconfig.xml" else log_d "Red5Pro HLS - disable" if ls $RED5_HOME/plugins/red5pro-mpegts-plugin* >/dev/null 2>&1; then diff --git a/variables.tf b/variables.tf index c6e96ba..ec1e94c 100644 --- a/variables.tf +++ b/variables.tf @@ -142,6 +142,16 @@ variable "red5pro_hls_enable" { type = bool default = false } +variable "red5pro_hls_output_format" { + description = "Red5 Pro Single server - HLS output format. Options: TS, FMP4, SMP4" + type = string + default = "TS" +} +variable "red5pro_hls_dvr_playlist" { + description = "Red5 Pro Single server - HLS DVR playlist" + type = string + default = "false" +} variable "red5pro_webhooks_enable" { description = "Red5 Pro Single server Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)" type = bool @@ -409,6 +419,16 @@ variable "origin_image_red5pro_webhooks_enable" { type = bool default = false } +variable "origin_image_red5pro_hls_output_format" { + description = "Origin node image - HLS output format. Options: TS, FMP4, SMP4" + type = string + default = "TS" +} +variable "origin_image_red5pro_hls_dvr_playlist" { + description = "Origin node image - HLS DVR playlist" + type = string + default = "false" +} variable "origin_image_red5pro_webhooks_endpoint" { description = "Origin node image - Webhooks endpoint" type = string @@ -618,6 +638,16 @@ variable "transcoder_image_red5pro_hls_enable" { type = bool default = false } +variable "transcoder_image_red5pro_hls_output_format" { + description = "Transcoder node image - HLS output format. Options: TS, FMP4, SMP4" + type = string + default = "TS" +} +variable "transcoder_image_red5pro_hls_dvr_playlist" { + description = "Transcoder node image - HLS DVR playlist" + type = string + default = "false" +} variable "transcoder_image_red5pro_webhooks_enable" { description = "Transcoder node image - Webhooks enable/disable (https://www.red5.net/docs/special/webhooks/overview/)" type = bool