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

This commit is contained in:
irsl 2023-03-09 18:08:01 +01:00 committed by GitHub
parent c51a686208
commit 4e579702ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 17 deletions

View File

@ -104,6 +104,7 @@ In the next months, the repository name and the docker image name will be change
* [Browser support](#browser-support) * [Browser support](#browser-support)
* [Embedding](#embedding) * [Embedding](#embedding)
* [Low-Latency variant](#low-latency-variant) * [Low-Latency variant](#low-latency-variant)
* [Low-Latency variant on Apple devices](#low-latency-variant-on-apple-devices)
* [Decrease latency](#decrease-latency-1) * [Decrease latency](#decrease-latency-1)
* [WebRTC protocol](#webrtc-protocol) * [WebRTC protocol](#webrtc-protocol)
* [General usage](#general-usage-3) * [General usage](#general-usage-3)
@ -1013,7 +1014,27 @@ 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. 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: LL-HLS is disabled by default. To enable it, set the `hlsVariant` parameter in the configuration file:
```yml
hlsVariant: lowLatency
```
Every stream published to the server can be read with LL-HLS by visiting:
```
https://localhost:8888/mystream
```
If the stream is not shown correctly, try tuning the `hlsPartDuration` parameter, for instance:
```yml
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 genrsa -out server.key 2048
@ -1029,18 +1050,6 @@ hlsServerKey: server.key
hlsServerCert: server.crt hlsServerCert: server.crt
``` ```
Every stream published to the server can be read with LL-HLS by visiting:
```
https://localhost:8888/mystream
```
If the stream is not shown correctly, try tuning the `hlsPartDuration` parameter, for instance:
```yml
hlsPartDuration: 500ms
```
### Decrease latency ### 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. 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.

View File

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