这是我从Android中的Peerconnection叮当声库中获得的统计信息报告信息。
如果可能,我想在 UI 上显示一个指示器,以根据此报告向用户显示当前呼叫质量。
我不确定如何确定它是好的通话质量还是不良的质量
发送视频统计信息
ssrc_2849248716_send
bytesSent=44487
codecImplementationName=HWEncoder
framesEncoded=30
mediaType=video
packetsLost=0
packetsSent=68
qpSum=2200
ssrc=2849248716
transportId=Channel-0-1
AdaptationChanges=0
AvgEncodeMs=0
BandwidthLimitedResolution=true
CodecName=VP8
ContentType=realtime
CpuLimitedResolution=false
EncodeUsagePercent=0
FirsReceived=0
FrameHeightInput=720
FrameHeightSent=360
FrameRateInput=30
FrameRateSent=30
FrameWidthInput=1280
FrameWidthSent=640
HasEnteredLowResolution=false
hugeFramesSent=0
NacksReceived=0
PlisReceived=0
Rtt=0
TrackId=ARDAMSv0
接收视频统计信息
ssrc_1142651072_recv
bytesReceived=22760
codecImplementationName=HWDecoder
framesDecoded=21
mediaType=video
packetsLost=0
packetsReceived=31
qpSum=1684
transportId=Channel-0-1
CaptureStartNtpTimeMs=0
CodecName=VP8
ContentType=realtime
CurrentDelayMs=108
DecodeMs=14
FirsSent=0
FrameHeightReceived=360
FrameRateDecoded=34
FrameRateOutput=34
FrameRateReceived=25
FrameWidthReceived=640
InterframeDelayMax=46
JitterBufferMs=77
MaxDecodeMs=21
MinPlayoutDelayMs=0
NacksSent=0
PlisSent=0
RenderDelayMs=10
TargetDelayMs=108
TimingFrameInfo=126116936,-226,-207,-13,-13,-1,-226,-226,5772436049,5772436065,5772436217,5772436273,5772436065,0,1
TrackId=ARDAMSv0
BWE 统计 = BWEFORVIDEO
ActualEncBitrate=291163
ReceiveBandwidth=0
SendBandwidth=1654217
BucketDelay=0
RetransmitBitrate=0
TargetEncBitrate=1654217
TransmitBitrate=389383
连接统计信息 = Conn-0-1-0
ActiveConnection=true
bytesReceived=17759
bytesSent=31747
packetsSent=75
Readable=true
requestsSent=3
consentRequestsSent=1
responsesSent=3
requestsReceived=3
responsesReceived=3
ChannelId=Channel-0-1
localCandidateId=Cand-P/Rpk08E
LocalCandidateType=prflx
remoteCandidateId=Cand-gAVGaHs7
RemoteCandidateType=relay
Rtt=110
packetsDiscardedOnSend=0
TransportType=udp
Writable=true
onPeerConnectionStatsReady: fps = 30 target BR = 1654217 actual BR = 291163
我建议向用户展示基本统计数据作为第一步,例如Packet loss %
,bandwidth (upload & download)
,如果可能的话,网络信号强度。每两秒计算一次。
裁判:
Chromes Webrtc 统计数据:chrome://webrtc-internals
信号强度:如何在 JavaScript 中检测互联网速度?
丢包:Math.round((totalPacketLost/totalPacketSent) * 1000);