Scenario
The video stutters during live streaming.
Troubleshoot
Stuttering can occur at various stages of the streaming process. Review the following potential causes and solutions to fix the issue.
Ingest client
Insufficient upstream bandwidth or network jitter can lower the data transmission rate. This prevents the stream from reaching the frame rate required for smooth playback.
Check your upstream bandwidth using a tool like Speedtest.
If the bitrate, frame rate, or codec profile is too high for your hardware, encoding can slow down, preventing the stream from reaching the required frame rate for smooth playback.
Try lowering the bitrate, frame rate, or codec profile settings. If this improves performance, consider upgrading the hardware of ingest client.
Streaming is a CPU-intensive process. On low-end mobile devices, if CPU usage exceeds 80% during ingestion, video capture can degrade. This causes stuttering and screen tearing for your viewers.
Video capture settings are insufficient.
For the human eye to perceive video as smooth, the frame rate must be at least 15 frames per second (FPS). If the FPS drops below 10, stuttering becomes noticeable. Unless you have specific requirements, set the frame rate to at least 15 FPS.
Although a higher frame rate results in a smoother video, any improvements above 30 FPS are generally imperceptible to the human eye. A higher frame rate increases bandwidth consumption. Configure your video capture settings properly to balance the visual quality and the bandwidth cost.
Server side
To ensure fast video startup and reduce stuttering, the server caches approximately 4 seconds of data by default. This duration can fluctuate depending on the keyframe interval (GOP) size. You can adjust this cache time to minimize stuttering.
You can set the latency configuration to High. For detailed instructions, see Configure the live streaming latency.
The actual latency depends on two factors: the latency configuration and GOP. For example, if the latency configuration for an RTMP stream is set to Medium and the GOP is 2s, the actual latency is between 2s and 6s.
High latency causes the ingest and playback clients to go out of sync. Choose a latency level that suits your business requirements.
Playback client
Most players use a receive buffer. The player decodes and renders video only after this buffer is full. The size of the receive buffer also affects stuttering.
Network
In most cases, stuttering occurs due to network conditions. Common factors include:
Insufficient bandwidth capacity: Ensure your internet service provider's bandwidth is sufficient for live streaming.
Downstream bandwidth consumption: Check for other activities on your network, such as large downloads, that may be consuming available bandwidth.
System resource contention: Check for background applications consuming system resources. Close unnecessary programs to free up resources.