webrtcbin get-stats don't contain any rtpstats.

Faraz Khan farazrkhan at gmail.com
Wed Oct 7 04:25:39 UTC 2020


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201006/59dc5308/attachment.htm>


More information about the gstreamer-devel mailing list