I use webrtcsink to stream video with a simple local configuration (two computers, local network). I’ve noticed that an internet connection is needed, otherwise the STUN server cannot be reached, and the pipeline fails.
libnice-WARNING **: 07:11:37.086: Agent: 0x7f3018024610: s:1: Can't resolve STUN server: Error resolving “stun.l.google.com”: Temporary failure in name resolution
Is a STUN server mandatory for such simple configurations? Can I make it work offline?
I’m doing this webrtcbin.set_property("stun-server", None::<String>);
instead of
if let Some(stun_server) = settings.stun_server.as_ref() {
webrtcbin.set_property("stun-server", stun_server);
}
in webrtcsink/imp.rs That’s what you suggest right?
Unfortunately I’ve got
0:00:03.178448549 51618 0x7fd20c020f60 ERROR webrtcnice nice.c:470:_add_stun_server:<webrtcbin-b3649156-fac9-4b19-92a0-36cb20b3aa91:ice> Stun server ‘’ has no host, must be of the form stun://:
which still work if I’m online, and not when I am offline. I guess libnice fallback to a default stun server. What do you think?
I’ve the same error If I set gst-launch-1.0 webrtcsink stun-server=None ..
Sorry, I forgot you were using Gst.parse_launch in Python (my suggestion was a Rust call to the element factory with property initialisation, not a modification of gst-plugin-rs).
Sorry, same error with the Gst.parse_launch(f"webrtcsink stun-server=NULL [...]")
0:00:00.383785094 15553 0x7fae3001f800 ERROR webrtcnice nice.c:470:_add_stun_server:<webrtcbin-aaab2123-b4d1-46a5-a90e-21484bc08f22:ice> Stun server ‘’ has no host, must be of the form stun://:
Streaming still works though If I am online, but if I’m not, this message spams and nothing is sent
Don’t set the stun-server property to NULL as that will print that error. I’m not sure why it is implemented like that, it could as well just ignore NULL. Maybe worth creating an issue in Gitlab about that
FWIW I think that’s unrelated to your actual problem, but I’m not sure why it should get stuck like this just because it fails resolving the STUN server. Or at least I would consider that a bug: it should just not use STUN in that case.
What gst-plugins-rs version do you use? I tried again locally: I see the error with webrtcsink stun-server=test but not with webrtcsink stun-server=NULL.
Well my mistake, the error was due to the rust code I modified. So I just pulled and compiled the plugin (commit a946895fad446acc06daf9f53b62cdaf2e87bfb8 ). The error is gone, but it is still not working.
The following example works when online, does not when offline. There is no error, but on the signalling server, the ice candidates are not sent. The consumer is waiting and there is no sound.
I was testing this example on a single computer with network disabled. I know this is an artificial setup, but I don’t need two computers to develop (although I do for testing). Now, on rare occasions, I develop offline. So it could be a real problem. I don’t if it worth opening a bug issue though.
Anyway, I’ll test in real conditions and I’ll let you know.
Keep in mind that Firefox refuses to allow WebRTC connections when offline - they have a completely artificial check along the lines of if (internet != connected) abort();, meaning you can’t use WebRTC over LAN alone.