Reduce HLS latency from +30 seconds

后端 未结 2 1157
忘掉有多难
忘掉有多难 2021-02-01 10:40

Ubuntu 12.04

nginx 1.2.4

avconv -version

avconv version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on         


        
相关标签:
2条回答
  • 2021-02-01 11:12

    I once had the same problem. I added two parameters in nginx.conf then the latency was cut to 10s even less. Here is my conf:

        application hls {
            hls_playlist_length 4s; 
            hls_fragment 1s
        }
    

    However, I have to say 10s seems to be our limitation. Any better solutions?

    0 讨论(0)
  • 2021-02-01 11:12

    The answer detailing reducing the hls_playlist to 4s and the hls_fragment to 1s is good. However, it is important to note that if the source video has a key frame interval greater than the hls_fragment length then nginx will usually have to create longer fragments and the latency will increase.

    The lowest latency we have achived was with the hls_fragment at 1s and the source video key frame interval also at 1s. With these settings we achieved latency of less than 7 seconds.

    0 讨论(0)
提交回复
热议问题