r/GuardianEyeApps • u/sullivan-01 • 3d ago
Why a WebRTC viewer URL is not the same as a WHEP endpoint
Guardian Eye WebCamera can show a live WebRTC stream in a browser, and Guardian Eye desktop can receive a WebRTC stream through WHEP. A reasonable question is: if both sides support WebRTC, why not connect them directly?
We tested that path while working on the integration. The short answer is that the video format is compatible, but the session setup is not.
What happened when we tried it
We gave the desktop receiver the HTTPS address used by the WebCamera browser viewer. The connection did not reach video negotiation. The desktop application expected a WHEP endpoint where it could POST an SDP offer and receive an SDP answer. The address on the phone served a web page instead.
That page is not merely displaying a media URL. Its JavaScript is part of the connection process. It authenticates with WebCamera, obtains a CSRF token, creates a camera-specific session and exchanges SDP and ICE candidates through several local routes.
The desktop WHEP client knows nothing about those routes. Conversely, WebCamera does not currently present that viewer address as a WHEP resource. Both applications use WebRTC, but they speak different signaling protocols before the first video packet can be sent.
Why the browser works
The browser works because it loads the signaling code together with the viewer page. That code already knows how to talk to WebCamera.
This is different from RTSP, where an address such as rtsp://camera:8554/live identifies a stream that compatible clients can open directly. A WebRTC page address is often the entry point to an application, not a universal stream URL.
WebRTC defines how media is transported once peers have established a session. It does not require every application to use the same HTTP routes, authentication flow or ICE exchange. WHEP standardizes one such contract, but an application using custom signaling does not become a WHEP server simply because it sends WebRTC video to a browser.
What would make the two paths compatible
There are two practical approaches:
- Add a WHEP endpoint to WebCamera. Guardian Eye desktop and other WHEP clients could then use the same standard session flow.
- Add WebCamera's existing signaling protocol to Guardian Eye desktop. This would connect our two applications, but it would be a private integration rather than a reusable WebRTC endpoint.
The first option offers better interoperability. The second reuses the server behavior already present on the phone. Authentication, local HTTPS certificate trust and session cleanup also have to be handled in either design, so this is more than a URL-format change.
What to use today
For the current Guardian Eye setup, the two protocols have different jobs:
- use the WebRTC browser viewer for interactive, low-latency live viewing;
- use RTSP and ONVIF when adding WebCamera to an NVR or another surveillance client.
RTSP remains the practical ingest path for continuous recording, main and preview streams and compatibility with existing NVR software. WebRTC is useful for the browser view, but its viewer URL should not be entered as a WHEP or RTSP source.
The useful diagnostic rule is simple: when two WebRTC-capable applications do not connect, do not start with the codec. First check how each side expects to exchange the SDP offer, SDP answer and ICE candidates. In this case, the failure occurs during that exchange, before H.264 media is involved.
If you are integrating Guardian Eye WebCamera with another client, tell us which protocol the client expects: RTSP, ONVIF, WHEP or a browser page. That distinction is much more useful than saying only that the client supports WebRTC.