In-call quality monitoring
Function description
After joining the channel
. the SDK will automatically trigger the following callbacks related to the call quality every 2 seconds
. You can understand the network quality of the current call,Geostatistics, audio quality and video quality.
Uplink and Downlink Network Quality Report
onNetworkQuality
callback reports to you the last mile network quality of each user/host in the current call, see Quality for detailsScore. Among them, last mile refers to the network from your device to the CloudHub edge server. Up last mileThe network quality score is based on the actual transmission code rate, uplink network packet loss rate, average round-trip delay and uplink network jitter calculation; downlink last mileThe network quality score is calculated based on the downstream network packet loss rate, average round-trip delay and downstream network jitter.
- In the communication scenario, you will receive network quality reports from all users (including yourself) in the channel every 2 seconds.
- In a live broadcast scenario, if you are an anchor, you will receive network quality reports from all anchors (including yourself) in the channel every 2 seconds.Report; if you are a viewer, you will receive all the anchors and your own network quality reports every 2 seconds.
- The higher the ratio of the actual transmission code rate to the target transmission code rate, the better the call quality under the network, and the higher the network quality score.
The average round-trip delay
refers to the average value of multiple round-trip delays
Statistics report
The onRtcStats
callback reports local call statistics to you. You can know the duration of the call, the number of people in the current call channel, the currentThe CPU usage of the system, the CPU usage of the current App, and the following important parameters.
parameter | describe | Remark |
---|---|---|
txBytes /rxBytes | Cumulative sending/receivingThe number of bytes. | The number of bytes accumulated since joining the channel. |
txAudioBytes /rxAudioByte | Cumulative sending/receivingThe number of audio bytes. | The number of bytes accumulated since joining the channel. |
txVideoBytes /rxVideoBytes | Cumulative sending/receivingThe number of video bytes. | The number of bytes accumulated since joining the channel. |
txKBitRate /rxKBitRate | Send/receive codeRate. | Codes actually sent/received during the statistical periodRate. |
txAudioKBitRate /rxAudioKBitRate | Audio send/receiveBit rate. | Codes actually sent/received during the statistical periodRate. |
txVideoKBitRate /rxVideoKBitRate | Video send/receiveBit rate. | Codes actually sent/received during the statistical periodRate. |
lastmileDelay | Local client toCloudHub edgeServer network extensionLate. | 1. This refers to the average round-trip delayHalf, not the client to CloudHubOne-way latency of the edge server. 2. The network delay here does not distinguish between audio andVideo is the data obtained by UDP packet. |
txPacketLossRate | Local client toCloudHub edgeServer packet lossRate. | 1. Comparison of audio and video upstream packet loss ratesGreat value. 2. Use anti-packet loss loss before technologyRate. |
rxPacketLossRate | CloudHub edgeServer to local clientThe packet loss rate of the client. | 1. Comparison of audio and video downstream packet loss ratesGreat value. 2. Use anti-packet loss loss before technologyRate. |
Audio quality report
- Local audio stream statistics report
onLocalAudioStats
callback reports to you the statistics of the audio stream sent by the local device. You can know the number of channels in the current call(Mono or dual-channel), the sampling rate of the transmitted audio and the bit rate of the transmitted audio.
The SDK will automatically trigger this callback every 2 seconds. The sample rate of sending audio refers to the actual sample rate of sending audio during the statistical period.Send audio bit rate refers to the rate of statistical period average
value.
- Local audio stream status monitoring
When the status of the local audio changes (including the recording status of the local microphone and the audio encoding status), the SDK will triggerThe onLocalAudioStateChanged
callback reports the current local audio state to you. When the local audio fails, you can passError code troubleshooting
- Remote audio stream statistics report
onRemoteAudioStats
callback reports to you the statistics of each remote user/host audio stream in the current call. You can understandThe quality of the audio stream sent by each remote user/host (see Quality Score for details), the number of channels (mono or dual), and the following important parametersinformation.
parameter | describe | Remark |
---|---|---|
networkTransportDelay | Audio sender to receiverNetwork latency. | Phase 2 + 3 + 4 in the figure |
jitterBufferDelay | Slow jitter from receiving end to networkThe network delay of the punching end. | Stage 5 in the figure |
audioLossRate | During the statistical period, the actualThe received remote audio stream is lostFrame rate. | 1. Stage 2 + 3 + 4 + 5 in the figure 2. In a statistical period, the audio frame loss rate reaches 4%Counts as an audio Caton . |
receivedSampleRate | During the statistical period, receivedSampling of the far-end audio streamRate. | |
receivedBitrate | During the statistical period, receivedThe distal end of the audio streams mean Bit rate. | |
totalFrozenTime | Remote user/host is addingAfter the occurrence of the audio channel cardThe cumulative duration of the pause . | 1. CloudHub defines totalFrozenTime =Audio Caton times × 2 × 1000 (ms). 2. Cumulative duration is Since joining the channel when accumulatedlong. |
frozenRate | Remote user/host audioThe cumulative duration of the freeze is accounted for in the audioPercentage of total effective time Compare. | Audio total valid length refers to the remote user / anchorAfter joining the channel, neither stopped sending audio streams,There is also no disabling of the call duration of the audio module. |
onRemoteAudioStats
focuses on reporting the full-link audio quality of the remote audio stream, which is closer to your subjective feelings. Even if the network is lostPackage, since the FEC (Forward Error Correction), the retransmission bandwidth estimation recovery and other anti-loss and congestion control techniques, finallyThe audio frame loss rate at the receiving end may not be high, so the audio quality you perceive may also be better.
In the communication scenario, you will receive the audio stream statistics of all remote users (not including yourself) in the channel every 2 seconds.
In a live broadcast scenario, if you are an anchor, you will receive audio streams from all remote anchors (not including yourself) in the channel every 2 secondsStatistics; if you are a viewer, you will receive the audio stream statistics of all remote hosts in the channel every 2 seconds.
CloudHub
audio module
refers to the audio processing process, not the actual module in the SDK. When sending an audio stream, the audio module refers toFrequency sampling, pre-processing, encoding and other processing processes; when receiving audio streams, the audio module refers to the processing of audio decoding, post-processing, playback, etc.Procedure.Users can only enable/disable their own audio module
CloudHub default audio within the survey cycle Caton not more than once.
Remote audio stream status monitoring
When the remote user/host audio state changes, the SDK will trigger the onRemoteAudioStateChanged
callback to report the remote audio to youThe current status of the frequency stream and the reason for the status change.
- In the communication scenario, this callback will report to you the audio stream status information of all remote users (not including yourself) in the channel.
- In the live broadcast scenario, if you are an anchor, this callback will report to you the audio streaming status of all remote anchors (not including yourself) in the channelStatus information; if you are a viewer, this callback will report to you the audio stream status information of all remote anchors in the channel.
Video quality report
- Local video stream statistics report
onLocalVideoStats
callback reports to you the statistics of the video stream sent by the local device. You can understand the video encoding width/height andNext important parameter information.
If you previously called the enableDualStreamMode
method to enable dual-stream mode, this callback describes the video stream sent by the local deviceStatistics.
parameter | describe | Remark |
---|---|---|
rendererOutputFrameRate | The output of the local video rendererFrame rate. | |
encoderOutputFrameRate | The output of the local video encoderFrame rate. | |
targetBitrate | The target encoding of the current encoderBit rate. | The code rate is pre-defined by the SDK according to the current network conditions.An estimated value. |
targetFrameRate | The target encoding of the current encoderFrame rate. | |
encodedBitrate | Video encoding rate. | After packet loss does not include retransmission video video codeRate. |
sentBitrate | During the statistical period, actually sentVideo bitrate. | After packet loss does not include retransmission video video codeRate. |
sentFrameRate | During the statistical period, actually sentVideo frame rate. | After packet loss does not include retransmission video video codeRate. |
encodedFrameCount | The cumulative number of frames sent by the video. | The cumulative value since joining the channel. |
codecType | The encoding type of the video. | 1.VIDEO_CODEC_VP8 = 1 : VP82. VIDEO_CODEC_H264 = 2 : (default Accepted value)H.264 |
qualityAdaptIndication | The video quality adaptation of this statistics. | Compared to the last statistics (2 seconds ago) video quality(Based on target bitrate/ targetBitrate and target frame rate/ targetFrameRate ), the video quality this time: 1. The local video quality remains unchanged. Local video quality improved. 2. The local video quality has deteriorated. |
- Local video stream status monitoring
When the state of the local video changes, the SDK will trigger the onLocalVideoStateChanged
callback to report the current local video state to you.state. When the local video fails, you can use the error code to troubleshoot the problem.
- Remote video stream statistics report
onRemoteVideoStats
callback reports the video stream statistics of each remote user/host in the current call. You can understandTo each remote user/host video width/height and the following important parameter information.
parameter | describe | Remark |
---|---|---|
rxStreamType | Video stream type. | For large or small video streams, see Dual Stream Mode for details. |
receivedBitrate | During the statistical period, the actualRemote video receivedBit rate. | |
packetLossRate | During the statistical period, the actualRemote video receivedFlow packet loss rate. | 1. Stage 2 + 3 + 4 in the figure 2. herein refers to the use of anti-packet loss loss after technologyRate, than the use of anti-packet loss packet loss rate before the technology is moreLow. |
decoderOutputFrameRate | Remote video decoderOutput frame rate. | |
rendererOutputFrameRate | Remote video rendererOutput frame rate. | |
totalFrozenTime | The remote user/host is atSend video after joining the channelFrequency Caton when the cumulativelong. | During the call, the video frame rate should not be lower than 5 fpsWhen the interval between two consecutively rendered videos exceeds500 ms, it counts as a video Caton . |
frozenRate | Remote user/host cardThe cumulative duration of the instant accounts for the videoPercentage of effective timeCompare. | Video duration effective means remote user / anchor frequency is addedAfter the channel, neither stopped sending the video stream, norDisable the call duration of the video module. |
In the communication scenario, you will receive the video stream statistics of all remote users (not including yourself) in the channel every 2 seconds.
In the live broadcast scenario, if you are an anchor, you will receive the video streams of all remote anchors (not including yourself) in the channel every 2 secondsStatistics; if you are a viewer, you will receive the video stream statistics of all remote hosts in the channel every 2 seconds.
CloudHub
video module
refers to the video processing process, not the actual module in the SDK. When sending a video stream, the video module refers toProcessing procedures such as frequency acquisition, pre-processing, and encoding; when receiving video streams, the video module refers to video decoding, post-processing, rendering/playing, etc.Processing processUsers can only enable/disable their own video module.
Remote video stream status monitoring
When the video stream status of the remote user/host changes, the SDK will trigger the onRemoteVideoStateChanged
callback to report the remote video to youThe current status of the frequency stream and the reason for the status change
- In the communication scenario, this callback will report to you the video stream status information of all remote users (not including yourself) in the channel.
- In a live broadcast scenario, if you are an anchor, this callback will report to you the video streaming status of all remote anchors (not including yourself) in the channelStatus information; if you are a viewer, this callback will report to you the video stream status information of all remote hosts in the channel.
API reference
onNetworkQuality
onRtcStats
onLocalAudioStats
onLocalAudioStateChanged
onRemoteAudioStats
onRemoteAudioStateChanged
onLocalVideoStats
onLocalVideoStateChanged
onRemoteVideoStats
onRemoteVideoStateChanged
Development considerations
onLocalAudioStateChanged
、onRemoteAudioStateChanged
、onLocalVideoStateChanged
and onRemoteVideoStateChanged
Correction state monitor not every 2 seconds SDK is triggered automatically, each trigger conditions see text.