All Products
Document Center

Video Live has a phenomenon of lag

Last Updated: Sep 27, 2020

Problem description

When watching the live video, the picture is stuck.


There are many reasons for this problem. Please refer to the following links for the possibility of the problem and handle it according to the actual situation on site:

  • Stream ingest client
    • Due to insufficient uplink bandwidth or network jitter, the data transmission rate decreases, resulting in a failure of the frame rate required for smooth playback.
      We recommend that you use the network speed testing tool Speedtest test the uplink bandwidth of your current network.
    • The bitrate, frame rate, or encoding gear setting is too high, but the hardware conditions are limited. As a result, the encoding speed becomes slow, and the required frame rate cannot be achieved during smooth playback.
      Reduce the bitrate, frame rate, or coding gear, and check if the video lag is improving. If the performance improvement occurs, you can consider upgrading the hardware configuration of the stream ingest client.
    • The parameter settings of video recording are too low.

      A minimum of 15 frames per second (FPS) must be guaranteed to play a video smoothly for the audience. If the FPS drops below 10, video lag occurs. If there are no special circumstances, set the video frame rate to above 15 frames per second. The higher the FPS is, the more smoothly the video is played. However, any rate above 30 FPS makes no appreciable difference to the audience. A high FPS increases the bandwidth costs of data transmission. We recommend that you set an appropriate FPS.

  • Provider
    To ensure that a video is played at one second or reduce its lag time, the server caches data of about 4 seconds by default. The data size may change depending on the GOP size. You can set the cache time to reduce the lag time. The setup steps are as follows:
    1. Login apsaravideo live console.
    2. In the left-side navigation pane, choose domain name management. In the left-side navigation pane, choose domain configuration.
    3. On the domain names page, click live streaming delay configuration, and then click modify a configuration.
    4. Try to set the Protocol delay to high, and then click confirm save.
      • The actual latency is determined by the latency and the keyframe interval (GOP) of stream ingest. For example, if the rtmp latency is set to the mid-range and the keyframe interval (GOP) is set to 2s, the latency is set to 2s to 6s.
      • If you enable high latency, the live streaming may not be synchronized with the playback end. We recommend that you set the latency level based on your business requirements.
    5. Check whether the latency of live streaming has been improved.
  • Playback client
    Most players decode and display objects only after they are ingested into a buffer. The size of the ingest buffer also affects the fluency of playback. You can reduce the impact of frame freezing by adjusting the size of the receiving cache.

Related topic

Application scope

  • Live video streaming