Skip to content

Passing null to RTCPeerConnection speeds up ICE Gathering on LAN connections #70

@jfeng-dev

Description

@jfeng-dev

Stream.prototype.createPeerConnection = function() {
let peerConnectionConf = {
"iceServers": [{
"urls": ["stun:" + this.hostname + ":3478"]
}]
};
this.peerConnection = new window.RTCPeerConnection(peerConnectionConf);

this.peerConnection = new window.RTCPeerConnection(null);

I think this is a reference to the uv4l STUN server, but the server is not enabled in the uvc conf. I couldn't find any other references to a STUN server being active on the Pi. Also, I think a STUN server isn't needed if the only connection is through the local wireless network.

https://github.com/TurtleRover/turtleos/blob/ffb6273cf825e97d05eb48fbd756a17aa0d1903d/pi-gen-overlay/stage3/01-sys-tweaks/files/etc/uv4l/uv4l-uvc.conf#L108-L112

(Apologies, not sure how to have this code block render as well)

In our experience, passing in null instead of the STUN server address results in much faster ICE gathering and more reliable connection starting for the video stream. Without this change, we would have long waits for ICE gathering to complete and often the video stream would not connect at all.

I haven't tested with the uv4l STUN server enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions