Network quality data in Janus

Hello!

Is it possible to observe publisher ping, packet loss, etc in Janus gateway?

You can use Admin API or Event handlers.

I found this, but I don’t see anything about ping there:

 "rtcp": {
                    "main": {
                        "base": 90000,
                        "rtt": 0,
                        "lost": 0,
                        "lost-by-remote": 0,
                        "jitter-local": 0,
                        "jitter-remote": 0,
                        "in-link-quality": 0,
                        "in-media-link-quality": 0,
                        "out-link-quality": 0,
                        "out-media-link-quality": 0
                    }
                },

What you call “ping” is the round-trip time (rtt).

Whats the dimension of this value? Because I am sitting behind VPN which is in USA. Calling ping from cmd to janus server, I am getting 300~ ms. But in rtt value for Janus publisher I have 0, for subscriber I have 34 in one of media array item.

It’s milliseconds, and it’s what RTCP tells us. It’s normal for that to be 0 for publishers, since we use Receiver Reports to calculate it, and we’ll only get a RR from subscribers.

Okay, got you

And why does I have bitrate: 0. That means, that bitrate is taken from room settings cap? Just in case it is not duplicated in publisher object?

 "plugin_specific": {
        "type": "publisher",
        "room": "9b95a4ae-011a-406b-8fe6-b74cc6877f1c",
        "id": "997f8086-4dc6-4768-a1e3-8fda8283580d",
        "private_id": 2745007882,
        "bitrate": 0,
        "streams": [
            {
                "type": "audio",
                "mindex": 0,
                "mid": "0",
                "codec": "opus",
                "audio-level-dBov": 127,
                "talking": false,
                "subscribers": 5
            },
            {
                "type": "video",
                "mindex": 1,
                "mid": "1",
                "codec": "vp8",
                "subscribers": 5
            }
        ],
        "hangingup": 0,
        "destroyed": 0
    },

@lorenzo when I use event handlers for media events, how frequently am I supposed to get these events?

Yes. For average bitrate from a publisher, and bitrate currently sent to a subscriber, check the RTCP properties.

@lorenzo So, does it impossible to check user connection data, when he is alone in room?

And when I am alone in room, I have such data for my publisher audio stream:

 "in": {
                        "packets": 30458,
                        "bytes": 1675186,
                        "bytes_lastsec": 0
                    },

Where are they from? Are they empty packets recieved from Janus?

What do you mean where are they from? It’s the data the publisher is sending to Janus. The in container is from the Janus perspective (data coming in). When you’re a publisher, you send data even if you’re alone.

Use the getStats WebRTC API to get data on PeerConnections directly in the browser.

2 Likes