Skip to content

Commit

Permalink
HLS configuration, output_format and dvr_playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
iolesyk committed Feb 29, 2024
1 parent 9ab0349 commit bf2f592
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}'",
Expand Down Expand Up @@ -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}'",
Expand Down Expand Up @@ -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}'",
Expand Down
12 changes: 11 additions & 1 deletion red5pro-installer/r5p_config_node_apps_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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='<property name="outputFormat" value="TS"/>'
hls_output_format_new='<property name="outputFormat" value="'$NODE_HLS_OUTPUT_FORMAT'"/>'

hls_dvr_playlist='<property name="dvrPlaylist" value="false"/>'
hls_dvr_playlist_new='<property name="dvrPlaylist" value="'$NODE_HLS_DVR_PLAYLIST'"/>'
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
Expand Down
30 changes: 30 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf2f592

Please sign in to comment.