Report In-call Statistics
Introduction
After joining the channel, the SDK triggers the following callbacks related to the call quality once every two seconds. You can see the last mile network quality, local statistics, audio quality, and video quality of the current call.
Network quality report
The OnNetworkQualityHandler
callback reports the uplink and downlink last mile network quality of each user/host in the current call, see Quality Rating for details. Last mile refers to the network from your device to Agora’s edge server. The uplink last mile quality rating is based on the actual transmission bitrate, the uplink network packet loss rate, the average round-trip delay, and the uplink network jitter; while the downlink last mile quality rating is based on the downlink network packet loss rate, the average round-trip delay, and the downlink network jitter.
COMMUNICATION
profile, you receive network quality reports of all the users (including yours) in the channel once every two seconds.LIVE_BROADCASTING
profile, if you are the host, you receive network quality reports of all hosts (including yours) in the channel once every two seconds; if you are the audience, you receive the report of all hosts and yourself once every two seconds.Statistics report
The OnRtcStatsHandler
callback reports call statistics. You can see the duration, the number of users in the channel, the system CPU usage, the application CPU usage, and the following parameters of the current call.
Parameter | Description | Comment |
---|---|---|
txBytes /rxBytes | The total number of bytes sent/received. | The number of bytes accumulated since joining the channel. |
txAudioBytes /rxAudioByte | The total number of audio bytes sent/received. | The number of bytes accumulated since joining the channel. |
txVideoBytes /rxVideoBytes | The total number of video bytes sent/received. | The number of bytes accumulated since joining the channel. |
txKBitRate /rxKBitRate | The bitrate sent/received. | The actual bitrate sent/received in the reported interval. |
txAudioKBitRate /rxAudioKBitRate | The bitrate sent/received of the audio packet. | The actual bitrate sent/received in the reported interval. |
txVideoKBitRate /rxVideoKBitRate | The bitrate sent/received of the video packet. | The actual bitrate sent/received in the reported interval. |
lastmileDelay | The network delay from the local client to Agora’s edge server. | |
txPacketLossRate | The packet loss rate from the local client to Agora’s edge server. | |
rxPacketLossRate | The packet loss rate from Agora’s edge server to the local client. |
Audio quality report
Statistics of local audio streams
The OnLocalAudioStatsHandler
callback reports the statistics of the audio streams sent. You can see the number of channels (mono or dual), the sample rate, and the average sending bitrate in the reported interval.
State changes of local audio streams
When the state of the local audio stream changes (including the state of the audio recording and encoding), the SDK triggers the OnLocalAudioStateChangedHandler
callback to report the current state. You can troubleshoot with the error code when exceptions occur.
Statistics of remote audio streams
The OnRemoteAudioStatsHandler
callback reports the audio statistics of each remote user/host in the current call. You can see the quality of the audio stream sent by each remote user/host (see Quality Rating, the number of channels (mono or dual), and the following parameters.
Parameter | Description | Comment |
---|---|---|
networkTransportDelay | The network delay from the sender to the receiver. | Stages 2 + 3 + 4 in the figure above |
jitterBufferDelay | The network delay from the receiver to the network jitter buffer. | Stage 5 in the figure above |
audioLossRate | The frame loss rate of the received remote audio streams in the reported interval. | |
receivedSampleRate | The sample rate of the received remote audio streams in the reported interval. | |
receivedBitrate | The average bitrate of the received remote audio streams in the reported interval. | |
totalFrozenTime | The total freeze time (ms) of the remote audio streams after the remote user joins the channel. | |
frozenRate | The total audio freeze time is a percentage of the total time when the audio is available. | When the remote user/host neither stops sending the audio stream nordisables the audio module after joining the channel, the audio is available. |
The OnRemoteAudioStatsHandler
callback reports statistics more closely linked to the real-user experience of the audio transmission quality. Even if network packet loss occurs, users may find the overall audio quality acceptable because the audio frame loss rate of the received audio streams may not be high due to the anti-packet-loss and congestion control methods, such as forward error correction (FEC), retransmissions and bandwidth estimation.
COMMUNICATION
profile, you receive the audio stream statistics of all the remote users (excluding yours) in the channel once every two seconds.LIVE_BROADCASTING
profile, if you are the host, you receive the audio stream statistics of all remote hosts (excluding yours) in the channel once every two seconds; if you are the audience, you receive the statistics of all hosts in the channel once every two seconds.State changes of remote audio streams
When the state of remote audio stream changes, the SDK triggers the OnRemoteAudioStateChangedHandler
callback to report the current state and the reason for the state change.
COMMUNICATION
profile, this callback reports to you the audio stream state information of all the remote users (excluding yours) in the channel once every two seconds.LIVE_BROADCASTING
profile, if you are the host, this callback reports to you the audio stream state information of all the remote hosts(excluding yours) in the channel once every two seconds; if you are the audience, this callback reports to you the audio stream state information of all the remote hosts in the channel once every two seconds.Video quality report
Statistics of local video streams
The OnLocalVideoStatsHandler
callback reports the statistics of the video streams sent. You can see the dimensions of the encoding frame and the following parameters.
Parameter | Description | Comment |
---|---|---|
rendererOutputFrameRate | The output frame rate of the local video renderer. | |
encoderOutputFrameRate | The output frame rate of the local video encoder. | |
targetBitrate | The target bitrate of the current encoder. | This value is estimated by the SDK based on current network conditions. |
targetFrameRate | The target frame rate of the current encoder. | |
encodedBitrate | The bitrate of the encoding video. | Does not include the bitrate of the retransmission videos. |
sentBitrate | The bitrate of the video sent in the reported interval. | Does not include the bitrate of the retransmission videos. |
sentFrameRate | The frame rate of the video sent in the reported interval. | Does not include the frame rate of the retransmission videos. |
encodedFrameCount | The total frames of the video sent. | The number of frames accumulated since joining the channel. |
codecType | The codec type of the local video. | |
qualityAdaptIndication | The local video quality change in terms of targetBitrate and targetFrameRate in thisreported interval. | Compared to the video quality in the last statistics (two seconds ago), the video quality change in this reported interval: |
State changes of local video streams
When the state of the local video changes, the SDK triggers the OnLocalVideoStateChangedHandler
callback to report the current state. You can troubleshoot with the error code when exceptions occur.
Statistics of remote video streams
The OnRemoteVideoStatsHandler
callback reports the video statistics of each remote user/host in the current call. You can see their video dimensions and the following parameters.
Parameter | Description | Comment |
---|---|---|
rxStreamType | The type of video streams. | High-video streams or low-video streams. |
receivedBitrate | The bitrate of the video received in the reported interval. | |
packetLossRate | The packet loss rate of the video received in the reported interval. | |
decoderOutputFrameRate | The output frame rate of the remote video decoder. | |
rendererOutputFrameRate | The output frame rate of the remote video renderer. | |
totalFrozenTime | The total freeze time (ms) of the remote video stream after the remote user joins the channel. | In a video call or interactive live video streaming session where the frame rate is set to no less than 5 fps, video freeze occurs when the time interval between two adjacent renderable video frames is more than 500 ms. |
frozenRate | The total video freeze time is a percentage of the total time when the video is available. | When the remote user/host neither stops sending the video stream nor disables the video module after joining the channel, the video is available. |
COMMUNICATION
profile, you receive video stream statistics of all the remote users (excluding yours) in the channel once every two seconds.LIVE_BROADCASTING
profile, if you are the host, you receive video stream statistics of all the remote hosts (excluding yours) in the channel once every two seconds; if you are the audience, you receive the statistics for all the hosts in the channel once every two seconds.State changes of remote video streams
When the state of remote video streams changes, the SDK triggers the OnRemoteVideoStateChangedHandler
callback to report the current state and the reason for the state change.
COMMUNICATION
profile, this callback reports to you the video stream state information of all the remote users (excluding yours) in the channel once every two seconds.LIVE_BROADCASTING
profile, if you are the host, this callback reports to you the video stream state information of all the remote hosts (excluding yours) in the channel once every two seconds; if you are the audience, this callback reports to you the video stream state information of all the remote hosts in the channel once every two seconds.API reference
OnNetworkQualityHandler
OnRtcStatsHandler
OnLocalAudioStatsHandler
OnLocalAudioStateChangedHandler
OnRemoteAudioStatsHandler
OnRemoteAudioStateChangedHandler
OnLocalVideoStatsHandler
OnLocalVideoStateChangedHandler
OnRemoteVideoStatsHandler
OnRemoteVideoStateChangedHandler
Considerations
The SDK does not trigger the OnLocalAudioStateChangedHandler
, OnRemoteAudioStateChangedHandler
, OnLocalVideoStateChangedHandler
, and OnRemoteVideoStateChangedHandler
callbacks once every two seconds. See their respective trigger conditions on this page.