Plugins do not get the whole RTCP stuff: most RTCP, including RR/SR, are terminated by the core, which then only passes limited RTCP messages to the core (e.g., REMB, FIR, etc.). If you want to have statistics info on a call, you should use the admin API instead, which summarizes what is exchanged via RTCP too in its stats: http://www.meetecho.com/blog/understanding-the-janus-admin-api/
To get triggers on insufficient bandwidth on the plugin side, you can make use on the slow_link callback: the core will notify plugins using that callback when there are problems on either uplink or downlink for a media connection the plugin is handling, something it usually inferes from the amount of NACKs sent or received.
Hey :)
On Saturday, 4 June 2016 13:17:12 UTC+1, Lorenzo Miniero wrote:Plugins do not get the whole RTCP stuff: most RTCP, including RR/SR, are terminated by the core, which then only passes limited RTCP messages to the core (e.g., REMB, FIR, etc.). If you want to have statistics info on a call, you should use the admin API instead, which summarizes what is exchanged via RTCP too in its stats: http://www.meetecho.com/blog/understanding-the-janus-admin-api/Not sure if I understood correctly, but when I do use the admin api to take a look at packet loss (through admin.html in demos/) the packet loss again doesnt match up. It shows zero (http://pastebin.com/4RkAwC6y) when I can see via webrtc-internals and by the stuttering of the video it definitely is not zero :D
"video_nacks": 1046,
In any case, as you say below, its really the plugin side I want this info to be exposed.To get triggers on insufficient bandwidth on the plugin side, you can make use on the slow_link callback: the core will notify plugins using that callback when there are problems on either uplink or downlink for a media connection the plugin is handling, something it usually inferes from the amount of NACKs sent or received.Is there a reason why packet loss isn't exposed to plugins? I don't believe the flexibility/fidelity I desire in implementing a rate control algorithm will be given by relying on the slow_link callback?
--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Higginson
Ok sounds good, i think I'll explore both slow_link but also seeing about getting packetloss from the core (or possibly sending it via getstats back to the plugin)
Are you able to give a pointer of where rtcp packets getting packet loss are 'terminated' by the core? Are i correct in thinking it just doesn't pass these packets on, or does terminated mean something else?
Thanks,Andrew Higginson
On Sat, 4 Jun 2016 at 14:15 Lorenzo Miniero <lmin...@gmail.com> wrote:
Il giorno sabato 4 giugno 2016 14:51:11 UTC+2, Andrew Higginson ha scritto:Hey :)
On Saturday, 4 June 2016 13:17:12 UTC+1, Lorenzo Miniero wrote:Plugins do not get the whole RTCP stuff: most RTCP, including RR/SR, are terminated by the core, which then only passes limited RTCP messages to the core (e.g., REMB, FIR, etc.). If you want to have statistics info on a call, you should use the admin API instead, which summarizes what is exchanged via RTCP too in its stats: http://www.meetecho.com/blog/understanding-the-janus-admin-api/Not sure if I understood correctly, but when I do use the admin api to take a look at packet loss (through admin.html in demos/) the packet loss again doesnt match up. It shows zero (http://pastebin.com/4RkAwC6y) when I can see via webrtc-internals and by the stuttering of the video it definitely is not zero :DIt also shows a ton of video nacks, though:"video_nacks": 1046,which definitely justify the stuttering video.In any case, as you say below, its really the plugin side I want this info to be exposed.To get triggers on insufficient bandwidth on the plugin side, you can make use on the slow_link callback: the core will notify plugins using that callback when there are problems on either uplink or downlink for a media connection the plugin is handling, something it usually inferes from the amount of NACKs sent or received.Is there a reason why packet loss isn't exposed to plugins? I don't believe the flexibility/fidelity I desire in implementing a rate control algorithm will be given by relying on the slow_link callback?The reason is that it makes more sense to just implement it once in the core, which already handles the termination of the other media layers, rather than force each plugin to do the exact same thing over and over. Plugin developers should only worry about getting media and the possibility to generate/route some of their own, without having to worry about much else. If you need to be aware of problems in the network in order to adapt, the slow_link callback I mentioned allows you to do that, as it's triggered whenever NACKs in either direction exceed some threshold (which means the streaming plugin has been notified in your example above). Different plugins can then handle this feedback in different ways. The EchoTest, for instance, reacts by cutting down the cap bitrate, and telling the user about this, do that banwidth consumption is reduced automatically. Other plugins like VideoRoom and Record&Play just notify the user, and leave decisions up to the application level, e.g., to also reduce the bitrate, to close some streams, or other: different applications using the same plugin may want to do different things, which is why an autmated logic is not always a good idea.Not sure what kind of rate control you'd like to do, and if it is in a new plugin or the Streaming one, but whatever it is, the slow_link callback is probably the way to go. If you believe it doesn't provide enough info as it is, feel free to play with the core or provide suggestions on how to improve that.As a side note, we're also working on a new mechanism called the Events API in a separate branch: https://github.com/meetecho/janus-gateway/pull/536That would allow you to receive info from multiple sources (core, plugins) on the whole lifecycle of a session, which might be of interest to you as well. Still WIP and incomplete, but feedback there would be even more welcome.L.--Thanks for the quick reply :DAndrew Higginson
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew Higginson
Thanks,Andrew Higginson
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----Andrew Higginson
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Higginson
Andrew Higginson
Thanks,Andrew Higginson
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew Higginson
--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew Higginson
--Andrew Higginson
void janus_streaming_incoming_rtcp(janus_plugin_session *handle, int video, char *buf, int len) {
if (handle == NULL || handle->stopped || g_atomic_int_get(&stopping) || !g_atomic_int_get(&initialized))
return;
rtcp_header *rtcp = (rtcp_header*) buf;
int total = len;
while(rtcp) {
if (rtcp->type == RTCP_RR) {
rtcp_rr *rr = (rtcp_rr*)rtcp;
uint32_t fractionlost = ntohl(rr->rb[0].flcnpl) >> 24;
uint32_t packetloss = ntohl(rr->rb[0].flcnpl) & 0x00FFFFFF;
JANUS_LOG(LOG_INFO, " Fraction Lost: %d, CumPacket: %d\n", fractionlost, packetloss);
break;
}
/* If this is a compound packet, move onto next one */
int length = ntohs(rtcp->length);
total -= length*4+4;
if (length == 0 || total <= 0) {
// No more left to process
break;
}
rtcp = (rtcp_header *)((uint32_t*)rtcp + length + 1);
}
}
Thanks,Andrew Higginson
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew Higginson
--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew Higginson
--Andrew Higginson
Ok so I believe I've worked it all out now, just posting in case someone needs a similar thing.I was getting confused thinking rtcp_context was the same as an RTCP packet (which it isn't!)
The core does seem to pass through the RTCP packets I need (RR) via the incoming_rtcp plugin method and so the packet can be accessed like so (code adapted from code in rtcp.c). In the example, I log the cumulative packet loss and fraction of packet loss in the RR RTCP packets (http://tools.ietf.org/html/rfc3550#section-6.4.1)
I think we're only parsing SR right now, while we ignore RR. We should probably update the context for incoming RR as well.