Browse Source

hls: make hlsEncryption optional even with Low-latency variant (#1530)

pull/1547/head
irsl 3 years ago committed by GitHub
parent
commit
4e579702ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      README.md
  2. 4
      internal/conf/conf.go

31
README.md

@ -104,6 +104,7 @@ In the next months, the repository name and the docker image name will be change @@ -104,6 +104,7 @@ In the next months, the repository name and the docker image name will be change
* [Browser support](#browser-support)
* [Embedding](#embedding)
* [Low-Latency variant](#low-latency-variant)
* [Low-Latency variant on Apple devices](#low-latency-variant-on-apple-devices)
* [Decrease latency](#decrease-latency-1)
* [WebRTC protocol](#webrtc-protocol)
* [General usage](#general-usage-3)
@ -1013,20 +1014,10 @@ For more advanced options, you can create and serve a custom web page by startin @@ -1013,20 +1014,10 @@ For more advanced options, you can create and serve a custom web page by startin
Low-Latency HLS is a [recently standardized](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis) variant of the protocol that allows to greatly reduce playback latency. It works by splitting segments into parts, that are served before the segment is complete.
LL-HLS is disabled by default. To enable it, a TLS certificate is needed and can be generated with OpenSSL:
```
openssl genrsa -out server.key 2048
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
```
Set the `hlsVariant`, `hlsEncryption`, `hlsServerKey` and `hlsServerCert` parameters in the configuration file:
LL-HLS is disabled by default. To enable it, set the `hlsVariant` parameter in the configuration file:
```yml
hlsVariant: lowLatency
hlsEncryption: yes
hlsServerKey: server.key
hlsServerCert: server.crt
```
Every stream published to the server can be read with LL-HLS by visiting:
@ -1041,6 +1032,24 @@ If the stream is not shown correctly, try tuning the `hlsPartDuration` parameter @@ -1041,6 +1032,24 @@ If the stream is not shown correctly, try tuning the `hlsPartDuration` parameter
hlsPartDuration: 500ms
```
### Low-Latency variant and Apple devices
In order to correctly display Low-Latency HLS streams in Safari running on Apple devices (iOS or macOS), a TLS certificate is needed and can be generated with OpenSSL:
```
openssl genrsa -out server.key 2048
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
```
Set the `hlsVariant`, `hlsEncryption`, `hlsServerKey` and `hlsServerCert` parameters in the configuration file:
```yml
hlsVariant: lowLatency
hlsEncryption: yes
hlsServerKey: server.key
hlsServerCert: server.crt
```
### Decrease latency
in HLS, latency is introduced since a client must wait for the server to generate segments before downloading them. This latency amounts to 1-15secs depending on the duration of each segment, and to 500ms-3s if the Low-Latency variant is enabled.

4
internal/conf/conf.go

@ -389,10 +389,6 @@ func (conf *Conf) CheckAndFillMissing() error { @@ -389,10 +389,6 @@ func (conf *Conf) CheckAndFillMissing() error {
return fmt.Errorf("Low-Latency HLS requires at least 7 segments")
}
if !conf.HLSEncryption {
return fmt.Errorf("Low-Latency HLS requires encryption")
}
default:
if conf.HLSSegmentCount < 3 {
return fmt.Errorf("The minimum number of HLS segments is 3")

Loading…
Cancel
Save