You can track the quality of a call from the following aspects:
- The network quality before the call starts.
- The audio, video and network quality during the call.
Before a call
Test the network quality
Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Once this method is enabled, the SDK returns the following callbacks:
- onLastmileQuality: the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions with a score and is more closely linked to the user experience.
- onLastmileProbeResult: the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective.
Test the audio device
This method launches an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
To conduct the test, the user speaks, and the recording is played back within the set interval. If the user can hear the recording within the interval, the audio devices and network connection are working properly.
During a call
During a call, the SDK triggers the following callbacks every two seconds. For callbacks that reflect the network quality of the remote user, if there are multiple users or broadcasters, the SDK returns the callbacks as many times.
This callback reflects the uplink and downlink quality with scores. The uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) and jitter of the uplink network, while Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network.
This callback reports the statistics of the local video streams, including the sent bitrate, sent frame rate, target bitrate, target frame rate, and quality adaption.
This callback reports the statistics of the video stream from each remote user or broadcaster, including the width and height of the video stream, the received bitrate, the decoder output frame rate, and the stream type.
This callback reports the statistics of the audio stream from each remote user or broadcaster, including the quality score, network transport delay, jitter buffer delay and audio loss rate.
This calback reports the statistics of the RtcEngine, including the total duration, received and sent bytes, received and sent bitrate, number of users, last-mile delay, CPU total usage and CPU app usage.
This callback reports the transport-layer statistics, such as the packet loss rate and time delay the local user receives an audio packet from a remote user.
This callback reports the transport-layer statistics, such as the packet loss rate and time delay after the local user receives the video packet from a remote user.
Monitor the video state
This callback returns the current video state and possible reasons for a video failure. When exceptions occur, you can use this callback for trouble shooting.
This callback reports whether the current remote video is running or frozen.
Monitor the state of the RTMP streaming
This callback reports the state of the RTMP streaming and possible reasons when an error occurs.