Skip to main content

FAQ

About Q&A, please follow rules

FAQ

Note: This is FAQ about SRS, please see SRS Cloud FAQ for SRS Cloud.

Edge HLS/DVR/RTC

  • Edge HLS/DVR/RTC: About Edge support for HLS/DVR/RTC, etc.
    1. Edge is a live streaming cluster that only supports live streaming protocols such as RTMP and FLV. Only the origin server can support HLS/DVR/RTC. Refer to #1066
    2. Currently, there is no restriction on using HLS/DVR/RTC capabilities in Edge, but they will be disabled in the future. So please do not use them this way, and they won't work.
    3. For the HLS cluster, please refer to the documentation HLS Edge Cluster
    4. The development of WebRTC and SRT clustering capabilities is in progress. Refer to #3138

HLS Fragments

  • HLS Fragment Duration: About HLS segment duration
    1. HLS segment duration is determined by three factors: GOP length, whether to wait for a keyframe (hls_wait_keyframe), and segment duration (hls_fragment).
    2. For example, if the GOP is set to 2s, the segment length is hls_fragment:5, and hls_wait_keyframe:on, then the actual duration of each TS segment may be around 5~6 seconds, as it needs to wait for a complete GOP before closing the segment.
    3. For example, if the GOP is set to 10s, the segment length is hls_fragment:5, and hls_wait_keyframe:on, then the actual duration of each TS segment is also over 10 seconds.
    4. For example, if the GOP is set to 10s, the segment length is hls_fragment:5, and hls_wait_keyframe:off, then the actual duration of each TS segment is around 5 seconds. The segment does not start with a keyframe, so some players may experience screen artifacts or slower video playback.
    5. For example, if the GOP is set to 2s, the segment length is hls_fragment:2, and hls_wait_keyframe:on, then the actual duration of each TS segment may be around 2 seconds. This way, the HLS delay is relatively low, and there will be no screen artifacts or decoding issues, but the encoding quality may be slightly compromised due to the smaller GOP.
    6. Although the segment size can be set to less than 1 second, such as hls_fragment:0.5, the #EXT-X-TARGETDURATION is still 1 second because it is an integer. Moreover, having too small segments can lead to an excessive number of segments, which is not conducive to CDN caching or player caching, so it is not recommended to set too small segments.
    7. If you want to reduce latency, do not set the segment duration to less than 1 second; setting it to 1 or 2 seconds is more appropriate. Because even if it is set to 1 second, due to the player's segment fetching strategy and caching policy, the latency will not be the same as RTMP or HTTP-FLV streams. The minimum latency for HLS is generally over 5 seconds.
    8. GOP refers to the number of frames between two keyframes, which needs to be set in the encoder. For example, the FFmpeg parameter -r 25 -g 50 sets the frame rate to 25fps and the GOP to 50 frames, which is equivalent to 2 seconds.
    9. In OBS, there is a Keyframe Interval(0=auto) setting. Its minimum value is 1s. If set to 0, it actually means automatic, not the lowest latency setting. For low latency, it is recommended to set it to 1s or 2s.

HTTPS & HTTP2/3

  • HTTPS: About HTTPS services, API, Callback, Streaming, WebRTC, etc.
    1. HTTPS API provides a transport layer secure API. WebRTC push streaming requires an HTTPS page, so it can only access the HTTPS API.
    2. HTTPS Callback calls back to an HTTPS service. If your server uses the HTTPS protocol, it is generally used for security purposes in business systems.
    3. HTTPS Live Streaming provides a transport layer secure stream. Mainly, HTTPS pages can only access HTTPS resources.
    4. Single domain names automatically apply for SSL certificates from letsencrypt, which is convenient for small and medium-sized enterprises to deploy SRS and avoids the high overhead of HTTPS proxy for streaming media services. See #2864
    5. Use Nginx or Caddy for reverse proxy, HTTP/HTTPS Proxy, to provide a unified HTTP/HTTPS service. See#2881
  • HTTP2: About HTTP2-FLV or HTTP2 HLS, etc.
    1. SRS will not implement HTTP2 or HTTP3, but instead recommends using a reverse proxy to convert protocols, such as Nginx or Go.
    2. Since HTTP is a very mature protocol, existing tools and reverse proxy capabilities are well developed, and there is no need for SRS to implement a complete protocol.
    3. SRS has implemented a simple HTTP 1.0 protocol, mainly providing API and Callback capabilities.

Deleting

For discussion or idea, please ask in [discord](https://discord.gg/yZ4BnPmHAd).

This issue will be eliminated, see #2716
Please ask this question on Stack Overflow using the [#simple-realtime-server tag](https://stackoverflow.com/questions/tagged/simple-realtime-server).

If want some discussion, here's the [discord](https://discord.gg/yZ4BnPmHAd).

This issue will be eliminated, see #2716