If you develop video applications with WebRTC, you may encounter issues in WebRTC video play such as freezing/blurring/pixelating which can have different reasons behind. We will talk about the best-known causes and how to solve these issues.
In addition, for the ones who require technical information about WebRTC, you can easily refer to following URLs:
- How to improve WebRTC Bitrate?
- WebRTC Technology Transforms Live Streaming
- WebRTC Basics & WebRTC Components
Now, we can talk about the main reasons that will cause these issues.
1.Client and Server Bandwidth & Upload & Download Network Capacity
You should check three parameters in this title.
WebRTC Video Publisher Upload Speed
As you know, if publisher upload speed is not enough to publish, this may cause some freezing/blurring.
WebRTC Video Player Download Speed
Another reason is download speed. If player download speed is not enough to play, this may also cause some freezing/blurring.
Server Network Capacity (Download / Upload)
This parameter is important for Video Streaming. When you set up a server, you need to pay attention to this parameter.
You can learn server network capacity with easily by checking this link.
It is more stable to broadcast from physically closer servers. If broadcast-quality problems occur, you should pick a server that is close to where you broadcast.
3.Wrong configuration in Ant Media Server
Adaptive Streaming configuration
Adaptive Streaming can consume high resources. Therefore, it is recommended to enable adaptive streams not more than required needs.
Default Adaptive Streaming configurations are listed below:
|Resolution||Video Bitrate (Kbps)||Audio Bitrate (Kbps)|
You could find out which resolution is supported by your publishing device by the following URL:
Frame rate Setting
The default WebRTC Frame Rate value is 20 and if you increase more than pre-configured value, this may consume higher server resources.
Ant Media Server is using
veryfast preset that uses fewer CPU resources(disadvantage is less quality). You can change it and you can get better quality.
You can change the preset value from the config file (
AMS-Folder/Application(LiveApp or etc)/WEB-INF/red5-web.properties ) with the following key.
For ex: You could use
Furthermore, you could see all presets from URL below: https://trac.ffmpeg.org/wiki/Encode/H.264
4.Instance Insufficient Resources
If you don’t have enough CPU/RAM resources, server may not handle the load properly. This will cause freezing/blurring/pixelating issues. You should check your system resource usages when streaming is live to see if it’s the case.
We hope this tutorial is helpful for you 🙂 Please feel free to send an email (email@example.com) or contact us directly at https://antmedia.io in case of any question.