Connect go2rtc for door camera live view
Door camera live view on a virtual intercom requires low-latency video in the browser. OpenApp integrates go2rtc for RTSP → WebRTC paths and exposes stream metadata on public intercom sessions via get_public_session_streams.
This guide is for building operators and integrators wiring lobby cameras to Virtual Access intercom flows. Setup: go2rtc integration.
Architecture
Section titled “Architecture”NVR / camera (RTSP) → go2rtc integration (discovered stream entities) → Virtual intercom session (call / video) → GET .../sessions/{id}/streams → WebRTC for visitor UIOne-time setup
Section titled “One-time setup”- Add go2rtc integration with NVR host, credentials, and channel discovery (getting started).
- Link Virtual Access portal + door entity for unlock.
- Start a portal session with
mode": "video"when the deployment supports it — see Virtual intercom flow.
Start a video session
Section titled “Start a video session”SDK
session = await client.public_access.portal_start_session( portal_id, target_entity_id=entity_id, mode="video",)streams = await client.public_access.session_streams(session["session_id"])const session = await fetch( `${apiBase}/public/access/portals/${portalId}/sessions`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ target_entity_id: entityId, mode: "video", }), },).then((r) => r.json() as Promise<{ session_id: string }>);
const streams = await fetch( `${apiBase}/public/access/sessions/${session.session_id}/streams`,).then((r) => r.json());use openapp_sdk::Client;use serde_json::json;
let client = Client::builder() .api_key("https://api.openapp.house/api/v1_openapp_YOUR_SECRET") .build()?;
let session = client .public_access() .portal_start_session( portal_id, &json!({ "target_entity_id": entity_id, "mode": "video" }), ) .await?;let streams = client .public_access() .session_streams(session["session_id"].as_str().unwrap()) .await?;body := *openapiclient.NewPublicPortalCreateSessionRequest(entityID, "video")session, httpResp, err := client.PublicAccessAPI.PostPublicPortalSessions(ctx, portalID). PublicPortalCreateSessionRequest(body). Execute()if err != nil { return err}defer httpResp.Body.Close()
streams, httpResp2, err := client.PublicAccessAPI.GetPublicSessionStreams(ctx, session.GetSessionId()).Execute()if err != nil { return err}defer httpResp2.Body.Close()_ = streamsSave session_id from the response when you only need the session first; call session_streams separately when you need WebRTC metadata.
HTTP API (curl)
export OPENAPP_API_BASE='https://api.openapp.house/api/v1'export PUBLIC_PORTAL_ID='01HPUBLICPORTAL000000000000'export TARGET_ENTITY_ID='01HENTITY000000000000000000'
curl -sS -X POST \ -H "Content-Type: application/json" \ -d '{ "target_entity_id": "'"${TARGET_ENTITY_ID}"'", "mode": "video" }' \ "${OPENAPP_API_BASE}/public/access/portals/${PUBLIC_PORTAL_ID}/sessions"Save session_id from the response.
Fetch WebRTC stream metadata
Section titled “Fetch WebRTC stream metadata”SDK
streams = await client.public_access.session_streams(session_id)const streams = await fetch( `${apiBase}/public/access/sessions/${sessionId}/streams`,).then((r) => r.json());use openapp_sdk::Client;
let client = Client::builder() .api_key("https://api.openapp.house/api/v1_openapp_YOUR_SECRET") .build()?;
let streams = client.public_access().session_streams(session_id).await?;streams, httpResp, err := client.PublicAccessAPI.GetPublicSessionStreams(ctx, sessionID).Execute()if err != nil { return err}defer httpResp.Body.Close()_ = streamsHTTP API (curl)
export SESSION_ID='01HSESSION000000000000000000'
curl -sS \ "${OPENAPP_API_BASE}/public/access/sessions/${SESSION_ID}/streams"Response shape: PublicSessionStreamsResponse — use fields for your WebRTC client (PeerJS / go2rtc routing). Full examples: Public Access — streams.
Agent notes
Section titled “Agent notes”- Stream entities from go2rtc carry
profilemetadata — match the door camera channel in integration config. - Video paths are public session routes; do not confuse with org-scoped entity RBAC.
- Test reachability with
GET .../portals/{id}/reachablebefore go-live.