본문 바로가기

프로그래밍/WebRTC

[WebRTC] peerConnection.statistics() 중 자주 확인하는 데이터

매번 키와 필드를 찾는게 구찮아서 일단 자주사용하는 webrtc 통계 데이터 샘플로 정리해 둠.

 

연결 관련 데이터

peer-connection
  id: "RTCPeerConnection"
  type: "peer-connection"
  timeStamp: 1655703464253039.0
  values: [
    "dataChannelsClosed": 0
    "dataChannelsOpened": 1
  ]

data-channel
  id: "RTCDataChannel_2"
  type: "data-channel"
  timeStamp: 1655703464253039.0
  values: [
    "bytesSent": 12410
    "messagesReceived": 9
    "messagesSent": 3
    "state": open
    "label": down
    "bytesReceived": 14213
    "dataChannelIdentifier": 1
    "protocol": 
  ]



  
local-candidate
  id: "RTCIceCandidate_GfSZa6/9"
  type: "local-candidate"
  timeStamp: 1655703464253039.0
  values: ["isRemote": 0
    "protocol": udp
    "address": 000.000.000.000
    "candidateType": prflx
    "networkType": wifi
    "transportId": RTCTransport_0_1
    "port": 52816
    "ip": 000.000.000.000
    "priority": 1853824767
  ]


remote-candidate
  id: "RTCIceCandidate_XXxVlI74"
  type: "remote-candidate"
  timeStamp: 1655703464253039.0
  values: [
    "ip": 000.000.000.000
    "isRemote": 1
    "protocol": udp
    "port": 20589
    "priority": 2130706431
    "address": 000.000.000.000
    "candidateType": host
    "transportId": RTCTransport_0_1
  ]
  

candidate-pair
    id: "RTCIceCandidatePair_2bozt0Bs_FIPYo616", 
    type: "candidate-pair", 
    timeStamp: 1666251345561840.0, 
    values: [
        "transportId": RTCTransport_0_1,
        "priority": 7241540810661953534, 
        "totalRoundTripTime": 0.008, 
        "currentRoundTripTime": 0.008, 
        "bytesSent": 0, 
        "bytesReceived": 0, 
        "packetsSent": 0, 
        "packetsReceived": 0, 
        "requestsSent": 1, 
        "responsesSent": 1, 
        "requestsReceived": 1, 
        "responsesReceived": 1,
        "consentRequestsSent": 0,  
        "packetsDiscardedOnSend": 0, 
        "bytesDiscardedOnSend": 0, 
        "state": succeeded, 
        "writable": 0, 
        "nominated": 1, 
        "remoteCandidateId": RTCIceCandidate_FIPYo616, 
        "localCandidateId": RTCIceCandidate_2bozt0Bs
    ]


certificate
  id: "RTCCertificate_figerprint"
  type: "certificate"
  timeStamp: 1655703464253039.0
  values: [
    "fingerprint": figerprint
    "fingerprintAlgorithm": sha-256
    "base64Certificate": base64Certificate
  ]



transport
  id: "RTCTransport_0_1"
  type: "transport"
  timeStamp: 1655703464253039.0
  values: [
    "bytesSent": 15132
    "bytesReceived": 17102
    "selectedCandidatePairId": RTCIceCandidatePair_GfSZa6/9_Jb/8h8mf
    "tlsVersion": FEFD
    "srtpCipher": AES_CM_128_HMAC_SHA1_80
    "dtlsCipher": TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
    "localCertificateId": RTCCertificate_fingerprint
    "packetsReceived": 32
    "dtlsState": connected
    "selectedCandidatePairChanges": 1
    "packetsSent": 29
    "remoteCertificateId": RTCCertificate_fingerprint
  ]

 

코덱

codec : video
  id: "RTCCodec_14_Outbound_125"
  type: "codec"
  timeStamp: 1655703464253039.0
  values: [
    "mimeType": video/H264
    "clockRate": 90000
    "payloadType": 125
    "transportId": RTCTransport_0_1
    "sdpFmtpLine": level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e034
  ]

codec : audio
  id: "RTCCodec_3_Inbound_111"
  type: "codec"
  timeStamp: 1655703464253039.0
  values: [
    "mimeType": audio/opus
    "channels": 2
    "transportId": RTCTransport_0_1
    "clockRate": 48000
    "sdpFmtpLine": minptime=10;useinbandfec=1
    "payloadType": 111
  ]

 

수신 : Video


id: "RTCInboundRTPVideoStream_2662451114", 
  type: "inbound-rtp", 
  timeStamp: 1665715230788162.0, 
  values: [
    "trackId": RTCMediaStreamTrack_receiver_7, 
    "ssrc": 2662451114, 
    "firCount": 0, 
    "jitterBufferEmittedCount": 117, 
    "bytesReceived": 342435, 
    "kind": video, 
    "decoderImplementation": VideoToolbox, 
    "packetsLost": 0, 
    "totalProcessingDelay": 2.252, 
    "transportId": RTCTransport_0_1, 
    "codecId": RTCCodec_7_Inbound_125, 
    "mediaType": video, 
    "lastPacketReceivedTimestamp": 1665715230774, 
    "totalInterFrameDelay": 3.874999999999998, 
    "nackCount": 0, 
    "jitterBufferDelay": 3.135, 
    "pliCount": 0, 
    "framesDropped": 0, 
    "totalSquaredInterFrameDelay": 0.132513, 
    "keyFramesDecoded": 3, 
    "totalDecodeTime": 0.356, 
    "headerBytesReceived": 7100, 
    "frameWidth": 480,
    "frameHeight": 360, 
    "framesReceived": 118, 
    "framesDecoded": 117, 
    "framesPerSecond": 30, 
    "jitter": 0.004, 
    "packetsReceived": 355
  ]


track
    id: "RTCMediaStreamTrack_receiver_7", 
  type: "track", 
  timeStamp: 1665715230788162.0, 
  values: [
    "totalPausesDuration": 0, 
    "freezeCount": 0, 
    "totalFramesDuration": 3.875, 
    "ended": 0, 
    "remoteSource": 1, 
    "trackIdentifier": track-2-7, 
    "totalFreezesDuration": 0, 
    "jitterBufferDelay": 3.135, 
    "kind": video, 
    "jitterBufferEmittedCount": 117, 
    "pauseCount": 0, 
    "sumOfSquaredFramesDuration": 0.1324390000000001, 
    "frameWidth": 480, 
    "frameHeight": 360, 
    "framesDecoded": 117, 
    "framesDropped": 0, 
    "framesReceived": 118, 
    "detached": 0
  ]

 

수신: Audio

inbound-rtp
  id: "RTCInboundRTPAudioStream_1538745721"
  type: "inbound-rtp"
  timeStamp: 1655703464253039.0
  values: [
    "concealedSamples": 0
    "jitter": 0
    "transportId": RTCTransport_0_1
    "packetsDiscarded": 0
    "concealmentEvents": 0
    "kind": audio
    "fecPacketsDiscarded": 0
    "packetsLost": 0
    "jitterBufferDelay": 0
    "packetsReceived": 0
    "mediaType": audio
    "ssrc": 1538745721
    "totalSamplesReceived": 0
    "bytesReceived": 0
    "totalAudioEnergy": 0
    "trackId": RTCMediaStreamTrack_receiver_2
    "totalSamplesDuration": 0
    "fecPacketsReceived": 0
    "removedSamplesForAcceleration": 0
    "jitterBufferEmittedCount": 0
    "headerBytesReceived": 0
    "insertedSamplesForDeceleration": 0
    "silentConcealedSamples": 0
  ]



track
  id: "RTCMediaStreamTrack_receiver_3"
  type: "track"
  timeStamp: 1655703464253039.0
  values: [
    "ended": 0
    "insertedSamplesForDeceleration": 0
    "delayedPacketOutageSamples": 0
    "kind": audio
    "totalInterruptionDuration": 0
    "jitterBufferFlushes": 0
    "silentConcealedSamples": 0
    "detached": 0
    "totalSamplesDuration": 0
    "jitterBufferTargetDelay": 0
    "interruptionCount": 0
    "totalAudioEnergy": 0
    "jitterBufferDelay": 0
    "remoteSource": 1
    "removedSamplesForAcceleration": 0
    "totalSamplesReceived": 0
    "relativePacketArrivalDelay": 0
    "jitterBufferEmittedCount": 0
    "trackIdentifier": track-audio-2
    "concealmentEvents": 0
    "concealedSamples": 0
  ]



stream
  id: "RTCMediaStream_stream-audio-1"
  type: "stream"
  timeStamp: 1655703464253039.0
  values: [
    "trackIds": <__NSSingleObjectArrayI 0x282b5e4f0>(RTCMediaStreamTrack_receiver_2)
    "streamIdentifier": stream-audio-1
  ]

 

 

송신: video

outbound-rtp
  id: "RTCOutboundRTPVideoStream_3701529920"
  type: "outbound-rtp"
  timestamp: 1655710415498706
  values: [
    "bytesSent": 0
    "codecId": "RTCCodec_2_Outbound_125"
    "encoderImplementation": unknown
    "firCount": 0
    "framesEncoded": 0
    "framesSent": 0
    "headerBytesSent": 0
    "hugeFramesSent": 0
    "keyFramesEncoded": 0
    "kind": video
    "mediaSourceId": "RTCVideoSource_2"
    "mediaType": video
    "nackCount": 0
    "packetsSent": 0
    "pliCount": 0
    "qualityLimitationDurations":[
      "bandwidth": 0
      "cpu": 0
      "none": 13
      "other": 0
    ]
    "qualityLimitationReason": none
    "qualityLimitationResolutionChanges": 0
    "retransmittedBytesSent": 0
    "retransmittedPacketsSent": 0
    "ssrc": 3701529920
    "totalEncodeTime": 0
    "totalEncodedBytesTarget": 0
    "totalPacketSendDelay": 0
    "trackId": "RTCMediaStreamTrack_sender_2"
    "transportId": "RTCTransport_0_1"
  ]
  
  
 track
  id: "RTCMediaStreamTrack_sender_2", 
  type: "track", 
  timeStamp: 1666074386513189.0, 
  values: [
    "remoteSource": 0, 
    "framesSent": 69, 
    "mediaSourceId": RTCVideoSource_2, 
    "frameWidth": 240, 
    "ended": 0, 
    "hugeFramesSent": 2, 
    "detached": 0, 
    "trackIdentifier": video-low, 
    "frameHeight": 427, 
    "kind": video
]


media-source
  id: "RTCVideoSource_2"
  type: "media-source"
  timestamp: 0
  values: [
    "framesPerSecond": 15, 
    "kind": video, 
    "frames": 48, 
    "height": 480, 
    "trackIdentifier": video, 
    "width": 640
  ]

 

송신: audio

outbound-rtp
  id: "RTCOutboundRTPAudioStream_2297615564"
  type: "outbound-rtp"
  timestamp: 1655710415498706
  values: [
    "bytesSent": 0
    "codecId": "RTCCodec_1_Outbound_111"
    "headerBytesSent": 0
    "kind": audio
    "mediaSourceId": "RTCAudioSource_1"
    "mediaType": audio
    "nackCount": 0
    "packetsSent": 0
    "retransmittedBytesSent": 0
    "retransmittedPacketsSent": 0
    "ssrc": 2297615564
    "targetBitrate": 32000
    "trackId": "RTCMediaStreamTrack_sender_1"
    "transportId": "RTCTransport_0_1"
  ]
  
  
track  
    id: "RTCMediaStreamTrack_sender_1", 
    type: "track", 
    timeStamp: 1666074386513189.0, 
    values: [
        "remoteSource": 0, 
        "ended": 0, 
        "kind": audio, 
        "detached": 0, 
        "trackIdentifier": audio, 
        "mediaSourceId": RTCAudioSource_1
    ]
  
media-source
  id: "RTCAudioSource_1"
  type: "media-source"
  timestamp:0
  values: [
    "totalSamplesDuration": 3.149999999999977, 
    "audioLevel": 0.002685628833887753, 
    "trackIdentifier": audio, 
    "totalAudioEnergy": 0.002222516045522912, 
    "kind": audio
  ]