Skip to main content
Version: 3.x.x

Understanding Call Quality - Android

When developing a video call app, customer satisfaction heavily depends on your app's video and audio quality and its fluctuation.

Call Quality​

If we look at the video quality from the user's perspective, a good video quality can be defined as smooth and clear video, along with clear audio. If the same is viewed from the developer's perspective, a good video quality can be determined as a high resolution, high frame rate video with minimal latency along with a high bitrate audio with minimal audio loss.

Factors affecting Quality​

When it comes to measuring the video and audio quality of a call, there are multiple variables to consider, and the most common factors which affect the video and audio quality are:

1. Network Bandwidth​

  • Network bandwidth measures how much data a user's network can receive and send.
  • If the bandwidth is low on a participant's side, they are likely to get pixelated or frozen video along with robotic or breaking audio.
  • Frequent change in the network providers can also result in high fluctuation of the internet bandwidth, which can also result in poor quality video.

2. Latency​

  • Latency basically means the time it takes for data to transfer from one machine to another.
  • If the room is hosted in the Ohio region and users join from the Singapore region, data takes longer to travel between them, so pick a server close to your user base.
  • In VideoSDK you can set the server during creation of the room.

3. CPU Usage​

  • CPU usage is also a major factor: every outgoing and incoming audio and video stream has to be encoded or decoded, which takes significant computation.
  • The higher the resolution and frame rate of the videos, the more computation is required, which can stop the device from delivering good quality video.
  • If the CPU is being consumed heavily, it can also result in a choppy or robotic audio.

4. Camera and Mic Quality​

  • The camera and microphone should capture good quality streams, so that remote users don't get a low quality stream even when they have good network bandwidth.

Identifying the Quality Issues​

VideoSDK collects audio and video metrics that help you pinpoint quality issues. Here is what each one tells you.

1. Resolutions and Framerates​

  • Resolution and frame rate are key metrics for video quality in a video call app. Resolution refers to the number of pixels in a video image, while frame rate refers to the number of frames displayed per second.

  • Higher resolutions and frame rates can provide better video quality, but they also require more bandwidth and processing power. It's important to optimize these metrics for the devices and network conditions of your users.

  • For example, if most of your users are on mobile devices, a lower resolution and frame rate may be more appropriate to ensure smooth playback and minimize bandwidth usage.

  • If most of your users are on mobile and desktop devices, having higher resolution for desktop and mid-resolutions for mobile devices can help in improving the performance and quality as we will be saving the bandwidth on the mobile end.

2. Bitrate​

  • Bitrate is the number of bits per second sent or received during the transmission of audio or video streams. Bitrate can be a key parameter to determine the quality of the audio or video streams, as it should be fine-tuned for each resolution to achieve the best match of performance and bandwidth utilization.

  • If the users are having excellent network conditions, higher bitrate can result in much better video quality but on the other hand, having very high bitrates on the mobile devices can result in heating issues due to high computation required to encode and decode the videos.

Example​

We joined using the same phone (iPhone 14), but the resolution and bitrate were different, first participant having resolution 1280x720 with bitrate 1442 kbps and second participant having resolution 960x540 with bitrate 642 kbps, so as we can see both participants' video appeared to be of equal quality even though resolution and bitrate are different.

resolution-and-bitrate

3. Packet Loss​

  • Packet loss is a metric that indicates how many data packets are lost during transmission from the sender to the receiver. Packet loss can occur due to network congestion, hardware or software issues, or network latency. Higher packet loss can result in poor video and audio quality, as the missing packets can cause gaps or distortions in the media stream.

4. Jitter​

  • Audio and video packets are sent between the server and the client at regular intervals. Jitter is the variation in when these packets arrive, caused by an unstable network connection.

  • When data packets are delayed on the way to the participant, usually because the network is busy, they arrive at irregular intervals. This shows as pixelated video on a video call, or choppy, distorted or robotic sound on a voice call.

5. Round Trip Time (Latency)​

  • Round trip time is the time a data packet takes to reach the server and come back. If the servers are located very far from the user's location, they can observe a high latency (delay).

  • With VideoSDK, this factor is taken care of as we automatically choose the nearest available server for participants. But if you are geofencing to a certain region, you should make sure that you choose the server which will be nearest to your users.

resolution-and-bitrate

Checking Realtime Statistics​

VideoSDK provides methods to check the realtime statistics of the audio and video of all the participants.

getVideoStats()​

  • The getVideoStats() method of a Participant returns a JSONArray containing the different quality parameters for video stream. It has one entry for a remote participant's video, and one entry for each simulcast layer of your own video.

  • Each entry will have values for the specific participant's video stream resolution, frame rate, bitrate, jitter, round trip time, and packet loss.

getAudioStats()​

  • The getAudioStats() method of a Participant returns a JSONObject containing the different quality parameters for audio stream.

  • This object will have values for the specific participant's audio stream bitrate, jitter, round trip time and packet loss.

getShareStats()​

  • The getShareStats() method of a Participant returns a JSONObject containing the different quality parameters for screen share stream.

  • This object will have values for the specific participant's screen share stream resolution, frame rate, bitrate, jitter, round trip time, and packet loss.

getShareAudioStats()​

  • The getShareAudioStats() method of a Participant returns a JSONArray containing the different quality parameters for the audio shared with the screen.

  • Each entry will have values for the specific participant's screen share audio bitrate, jitter, round trip time and packet loss.

Each of these methods returns null when the participant has no such stream, or when the stats can't be read.

getTransportStats()​

  • The getTransportStats() method of a Participant returns a JSONObject with the upload and download bitrate of the participant's network connection. Use it to tell a network problem from a problem with a single stream.

  • It returns null outside a room, before the connection is set up, or when the stats can't be read.

note

To show a participant's realtime stats in your app, read them about once a second: the values refresh at most every 400 ms. The methods block briefly, so call them off the main thread. Read each value with an opt method, such as optDouble("rtt"), because a value the SDK can't measure is left out.

lifecycleScope.launch {
while (isActive) {
val videoStats: JSONArray? = withContext(Dispatchers.IO) { participant.getVideoStats() }
val videoStat: JSONObject? = videoStats?.optJSONObject(0)
if (videoStat != null) {
Log.d(
"VideoSDK",
"bitrate: ${videoStat.optDouble("bitrate")} kbps, rtt: ${videoStat.optDouble("rtt")} ms, packetsLost: ${videoStat.optInt("packetsLost")}"
)
}
delay(1000)
}
}

Quality analysis Graphs​

For every session, the VideoSDK Dashboard shows quality analysis graphs. Use them to see spikes in these parameters during the call and find the cause of a quality issue.

quality analysis

API Reference​

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord