# WebRtcStats RTSP stream -\> WebRtc

**URL:** <https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167>\
**Category:** How to implement?\
**Tags:** v2\
**Created:** [June 12, 2020, 4:30pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167 "2020-06-12T16:30:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robbevw](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/robbevw/32/614_2.png) [@robbevw](https://openvidu.discourse.group/u/robbevw)\
**Post date:** [June 12, 2020, 4:30pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167/1 "2020-06-12T16:30:20Z")

</div>

Hi,

In my current project we are using Kurento and OpenVidu to have the feed of an IP camera (will be a 3D camera) to play in a Microsoft HoloLens.  
One thing we would like to develop is a latency indicator. While going throught the documentation of Kurento we found that there is a way to get WebRtcStats.

We are modifying the OpenVidu server, so that just after the creation of the media pipeline we set it to get the latency stats:

> pipeline.setLatencyStats(true)

After we try and get the latency stats: we created a custom websocket method to start sending a custom websocket event with these latencyStats. The media pipeline we receive through the KurentoParticipant, which we can get from the rpcConnection.

 ![image002](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/1956df5f72952960d98550a7b8ff9af3590fa1be.png)

Everything seems to run, but the stats we are getting seem of: 0.0 for every stat. So somewhere it goes wrong, we just don’t know where. Can anyone help and point us in the right direction?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 14, 2020, 4:56pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167/2 "2020-06-14T16:56:22Z")

</div>

As you can see in this Kurento example:

[https://doc-kurento.readthedocs.io/en/stable/tutorials/js/tutorial-loopback-stats.html](https://doc-kurento.readthedocs.io/en/stable/tutorials/js/tutorial-loopback-stats.html)

WebRtcStats are working correctly in a simple pipeline. But maybe in the pipeline created by OpenVidu they can not be gathered.

End to end latency (from publisher to subscriber) is difficult to obtain as communication is split in two parts:

```auto
Publisher Browser --> KMS 

```

and

```auto
KMS --> Subscriber Browser

```

---

<div class="post-metadata">

**Author:** ![robbevw](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/robbevw/32/614_2.png) [@robbevw](https://openvidu.discourse.group/u/robbevw)\
**Post date:** [June 15, 2020, 2:39pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167/3 "2020-06-15T14:39:27Z")

</div>

Yes, I’ve tried that example and that indeed works. I’ve tried implementing something similar in our project, but to no avail.

So I can conclude from your post that it is not possible to gather latency information from an RTSP stream (ip camera) to a WebRTC client or should it normally be possible to retrieve those stats and are we missing an important part?

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 15, 2020, 5:10pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167/4 "2020-06-15T17:10:13Z")

</div>

I think it is not possible, at least without digging into KMS code.

---

<div class="post-metadata">

**Author:** ![raggnic](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/raggnic/32/948_2.png) [@raggnic](https://openvidu.discourse.group/u/raggnic)\
**Post date:** [August 31, 2020, 5:14pm UTC](https://openvidu.discourse.group/t/webrtcstats-rtsp-stream-webrtc/1167/5 "2020-08-31T17:14:03Z")

</div>

Hi  
I guess I’m doing something similar with Hololens, Microsoft WebRTC and OpenVidu.

@robbevw, so far I’ve managed to join a room, publish the video from the hololens to this room, but I’m struggling with the ReceiveVideoFrom RPC. How do you setup the SDP Offer of the RPC call?
