Can't create webrtcsrc and a signaller

Hi all,

I am still experimenting with webrtcsink and rust. My goal is to create a system that listens for a specific peer in order to dynamically adapt a pipeline by adding a webrtcsrc element with the correct peer ID.

I have tried using a signaller with the listener role, which seems to trigger the signals I need. However, when I attempt to create a webrtcsrc element, I encounter the following error:

(listener:83772): GLib-GObject-WARNING **: 17:11:48.556: cannot register existing type 'GstRSWebRTCSignallerRole'
thread '<unnamed>' panicked at net/webrtc/src/signaller/
assertion failed: type_.is_valid()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at src/
Failed to create webrtcsrc: BoolError { message: "Failed to load element factory 'webrtcsrc' for creating element", filename: "/home/fabien/.cargo/registry/src/", function: "gstreamer::element_factory::ElementBuilder::build::{{closure}}", line: 285 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here’s a minimal example that reproduces the error:

use glib::MainLoop;
use gst::prelude::*;
use gstrswebrtc::signaller::SignallableExt;
use gstrswebrtc::signaller::Signaller;
use gstrswebrtc::signaller::WebRTCSignallerRole;

fn main() {

    let signaller = Signaller::new(WebRTCSignallerRole::Listener);
    signaller.set_property("uri", &"ws://");

    signaller.connect("producer-added", false, move |args| {
        let peer_id = args[1].get::<String>().unwrap();
        println!("Producer added: {}", peer_id);

    signaller.connect("producer-removed", false, move |args| {
        let peer_id = args[1].get::<String>().unwrap();
        println!("Producer removed: {}", peer_id);


    //this raises the error ---
    let webrtcsrc = gst::ElementFactory::make("webrtcsrc")
        .expect("Failed to create webrtcsrc");
    // ---

    let main_loop = MainLoop::new(None, false);;
name = "listener"
version = "0.1.0"
edition = "2021"

glib = "0.19.7"
gst = { version = "0.22.5", package = "gstreamer" }
gst-plugin-webrtc = "0.12.6"

Could someone please let me know if I am doing something wrong?

Thank you,

gst-plugin-webrtc is statically linked to your application and requires explicit registration:


With the next release of the Rust plugins, if you only plan on using the default signaller, you will be able to reduce required dependencies. With current main branch, this shrinks the number of dependent crates from 394 to 250 on my system:

gst = { git = "", package = "gstreamer" }
gst-plugin-webrtc = { git = "", default-features = false }
1 Like