webrtcbin get-stats don't contain any rtpstats.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

webrtcbin get-stats don't contain any rtpstats.

Faraz Khan
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin get-stats don't contain any rtpstats.

Matthew Waters
Various information provided by the get-stats signal are incomplete.  You may have to implement some of the information you need inside webrtcbin itself.

Cheers
-Matt

On 7/10/20 3:25 pm, Faraz Khan wrote:
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin get-stats don't contain any rtpstats.

Faraz Khan
Oh interesting. Seemed like rtpinputstats (from the RR reports) were already baked in. I'm specifically looking for fraction lost and interarrival jitter. Do I have to install a signal for rtcp packets and extracts those reports myself? 

For some reason I thought rtpbin would do this for me.

Thanks!

On Tue, Oct 6, 2020, 10:41 PM Matthew Waters <[hidden email]> wrote:
Various information provided by the get-stats signal are incomplete.  You may have to implement some of the information you need inside webrtcbin itself.

Cheers
-Matt

On 7/10/20 3:25 pm, Faraz Khan wrote:
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin get-stats don't contain any rtpstats.

Matthew Waters
No, you don't 'need' to do anything for rtpbin to expose the stats, they just aren't always exposed in the webrtcbin stats as the webrtcbin stats are incomplete.

Cheers
-Matt

On 7/10/20 5:06 pm, Faraz Khan wrote:
Oh interesting. Seemed like rtpinputstats (from the RR reports) were already baked in. I'm specifically looking for fraction lost and interarrival jitter. Do I have to install a signal for rtcp packets and extracts those reports myself? 

For some reason I thought rtpbin would do this for me.

Thanks!

On Tue, Oct 6, 2020, 10:41 PM Matthew Waters <[hidden email]> wrote:
Various information provided by the get-stats signal are incomplete.  You may have to implement some of the information you need inside webrtcbin itself.

Cheers
-Matt

On 7/10/20 3:25 pm, Faraz Khan wrote:
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin get-stats don't contain any rtpstats.

Faraz Khan
Gotcha. This issue made me think otherwise. Seems like these guys (gstreamer devs) are getting way more stats than me:



On Tue, Oct 6, 2020, 11:29 PM Matthew Waters <[hidden email]> wrote:
No, you don't 'need' to do anything for rtpbin to expose the stats, they just aren't always exposed in the webrtcbin stats as the webrtcbin stats are incomplete.

Cheers
-Matt

On 7/10/20 5:06 pm, Faraz Khan wrote:
Oh interesting. Seemed like rtpinputstats (from the RR reports) were already baked in. I'm specifically looking for fraction lost and interarrival jitter. Do I have to install a signal for rtcp packets and extracts those reports myself? 

For some reason I thought rtpbin would do this for me.

Thanks!

On Tue, Oct 6, 2020, 10:41 PM Matthew Waters <[hidden email]> wrote:
Various information provided by the get-stats signal are incomplete.  You may have to implement some of the information you need inside webrtcbin itself.

Cheers
-Matt

On 7/10/20 3:25 pm, Faraz Khan wrote:
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin get-stats don't contain any rtpstats.

Faraz Khan
For posterity the problem was that I was using gstreamer 1.16 where this stuff isn't linked up. All works fine using master. Thanks for the webrtcbin folks! 

On Wed, Oct 7, 2020 at 7:30 AM Faraz Khan <[hidden email]> wrote:
Gotcha. This issue made me think otherwise. Seems like these guys (gstreamer devs) are getting way more stats than me:



On Tue, Oct 6, 2020, 11:29 PM Matthew Waters <[hidden email]> wrote:
No, you don't 'need' to do anything for rtpbin to expose the stats, they just aren't always exposed in the webrtcbin stats as the webrtcbin stats are incomplete.

Cheers
-Matt

On 7/10/20 5:06 pm, Faraz Khan wrote:
Oh interesting. Seemed like rtpinputstats (from the RR reports) were already baked in. I'm specifically looking for fraction lost and interarrival jitter. Do I have to install a signal for rtcp packets and extracts those reports myself? 

For some reason I thought rtpbin would do this for me.

Thanks!

On Tue, Oct 6, 2020, 10:41 PM Matthew Waters <[hidden email]> wrote:
Various information provided by the get-stats signal are incomplete.  You may have to implement some of the information you need inside webrtcbin itself.

Cheers
-Matt

On 7/10/20 3:25 pm, Faraz Khan wrote:
Hi everyone,
Gstreamer noob here - but have worked on C/C++ audio/video apps for many years now. I have successfully established a webrtc connection with electron as the receiver (and gstreamer as send-only) and am now looking to implement some sort of simplistic bitrate control and also just to understand how gstreamer works.

My first attempt was to get webrtc peerconnection stats. I did:

GstPromise *p = gst_promise_new_with_change_func(_on_stats, NULL, NULL);
g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL, p);

And decode them using:

gboolean on_stats_iter(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize (value);
    g_print ("%15s: %s", g_quark_to_string (field), str);
    std::cout << std::endl;
    g_free (str);
    return TRUE;
}

static void _on_stats (GstPromise * promise, gpointer user_data) {
    const GstStructure *reply = gst_promise_get_reply(promise);
    gst_structure_foreach(reply, on_stats_iter, (gpointer)reply);
}

And this generates: 
peer-connection-stats: "peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)peer-connection-stats\;"
codec-stats-sink_0: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)2002222005\;"
transport-stats_webrtcdtlstransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;"
ice-candidate-pair_webrtcnicetransport0: "transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"
codec-stats-sink_1: "codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)180230225.79899999\,\ id\=\(string\)codec-stats-sink_1\,\ payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\ ssrc\=\(uint\)1224562656\;"


This has the correct SSRC and codec info - but missing RTP information and the data channel stats are incorrect (I do have a open and working data channel).

How does one proceed to debug this? What am I missing?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel