如何在WEBRTC中使用outbounds?

时间:2016-09-05 12:11:43

标签: java statistics webrtc kurento outbound

我正在测试Kurento Room Demo。我有兴趣获得视频会议的所有可能统计数据。

我在每个参与者中使用getPublisher()和getEndpoint()运行getStats()测试,这样我就可以获得有关每个比特率的信息,丢失了多少数据包......

我只是这样得到inboundrtps和endpointrtps,但我也需要Outboundrtps。有人可以帮我解决这些问题吗?

另外,我只关注比特率,延迟和数据包丢失。在检查每个参与者的连接质量时,是否还有其他有趣的数据?

非常感谢你。

编辑,代码:

Map<String, Stats> statsMap = null;

try{
statsMap = participant.getPublisher().getEndpoint().getStats();
}catch(Exception e){
break;
}

for (Stats stat : statsMap.values()) {

switch(stat.getType()) {
case inboundrtp:
RTCInboundRTPStreamStats inboundStats = (RTCInboundRTPStreamStats) stat;

System.out.println("Packets Lost: " + inboundStats.getPacketsLost());
System.out.println("Packets Received: " + inboundStats.getPacketsReceived());
System.out.println("BytesReceived: " + inboundStats.getBytesReceived());

System.out.println(inboundStats.getFractionLost());
System.out.println(inboundStats.getJitter());
System.out.println(inboundStats.getMediaTrackId());
System.out.println(inboundStats.getTransportId());
System.out.println(inboundStats.getSsrc());
System.out.println(inboundStats.getRemb());
System.out.println(inboundStats.getTimestamp());
break;
case outboundrtp:
RTCOutboundRTPStreamStats outboundStats = (RTCOutboundRTPStreamStats) stat;
System.out.println(outboundStats.getTargetBitrate());
break;
case endpoint:
EndpointStats statsendpoint = (EndpointStats) stat;
System.out.println("Audio Latency: " + statsendpoint.getInputAudioLatency());
System.out.println("Video Latency: " + statsendpoint.getInputVideoLatency());
break;
default:
break;
}
}

0 个答案:

没有答案