mirror of
https://github.com/BluemediaGER/nginx-live.git
synced 2024-11-22 17:55:29 +01:00
Make HLS playlist and fragment lengh changeable
This commit is contained in:
parent
fbca991b8c
commit
75321cb769
|
@ -7,6 +7,8 @@ LABEL maintainer="oliver@traber-info.de"
|
|||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV RTMP_PORT 1935
|
||||
ENV HTTP_PORT 8080
|
||||
ENV HLS_FRAGMENT_LENGTH 3
|
||||
ENV HLS_PLAYLIST_LENGTH 20
|
||||
|
||||
# Update and install packages
|
||||
RUN apt update -y && \
|
||||
|
|
|
@ -38,6 +38,8 @@ If you want to make the web player and the HLS files available via HTTPS, you ca
|
|||
- `TLS_CERT` - File name of the TLS certificate file in the /cert directory inside the container. If set, encrypted ingest will be enabled on the RTMP port.
|
||||
- `TLS_KEY` - File name of the private key that belongs to the TLS certificate.
|
||||
- `STREAM_KEY` - Stream key, which is needed to ingest stream data. If the variable is not set, the key is randomly generated at container startup.
|
||||
- `HLS_FRAGMENT_LENGTH` - Length of one HLS fragment in seconds. Defaults to `3`.
|
||||
- `HLS_PLAYLIST_LENGTH` - Length of the HLS playlist in seconds. Defaults to `20`.
|
||||
|
||||
## Built with
|
||||
- [NGINX](https://www.nginx.com/) High Performance Load Balancer, Web Server, & Reverse Proxy
|
||||
|
|
|
@ -73,8 +73,8 @@ rtmp {
|
|||
# Turn on HLS
|
||||
hls on;
|
||||
hls_path /var/www/html/hls/;
|
||||
hls_fragment 3;
|
||||
hls_playlist_length 20;
|
||||
hls_fragment {HLS_FRAGMENT_LENGTH};
|
||||
hls_playlist_length {HLS_PLAYLIST_LENGTH};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ rtmp {
|
|||
# Turn on HLS
|
||||
hls on;
|
||||
hls_path /var/www/html/hls/;
|
||||
hls_fragment 3;
|
||||
hls_playlist_length 20;
|
||||
hls_fragment {HLS_FRAGMENT_LENGTH};
|
||||
hls_playlist_length {HLS_PLAYLIST_LENGTH};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ if [ ! -f /setup.lock ]; then
|
|||
sed -i "s/{RTMP_PORT}/$RTMP_PORT/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/{STREAM_KEY}/$VALID_STREAM_KEY/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/{HTTP_PORT}/$HTTP_PORT/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/{HLS_FRAGMENT_LENGTH}/$HLS_FRAGMENT_LENGTH/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/{HLS_PLAYLIST_LENGTH}/$HLS_PLAYLIST_LENGTH/g" /etc/nginx/nginx.conf
|
||||
|
||||
# Touch setup lock
|
||||
touch /setup.lock
|
||||
|
|
Loading…
Reference in a new issue