IP camera video stream: go2rtc and Frigate
How to feed video from mixed cameras to several applications reliably. The backbone is go2rtc: it holds one connection to the camera and fans it out to many clients. On top sits Frigate for recording and object detection — optionally with a Hailo accelerator. Plus the camera types and the traps that cost days.
01What you will learn
- Why you never point every application straight at the camera — and what restreaming does.
- How the main and sub streams are split and what each is for.
- How to lay out go2rtc and Frigate without mixing them up.
- Which traps lurk with the different kinds of camera.
- What GDPR requires when a camera watches people.
02Before you start
- At least one IP camera with an RTSP stream and access to its settings.
- Docker on a Linux machine (or a Raspberry Pi) for go2rtc and Frigate 🔒 local.
- A Hailo accelerator is optional. If you have one, its setup is in the lesson Hailo-8 and Frigate on a Raspberry Pi 5.
- Keep the camera's login details in a secret store, not in a text file you share.
03Steps
-
The principle: never straight at the camera
Many cameras limit the number of simultaneous RTSP connections and have touchy audio. If Home Assistant, Frigate and your panel each connect on their own, the camera chokes. So you put go2rtc between them: it opens one connection to the source and fans it out to many clients.
flowCamera # one connection → go2rtc # restream to many clients → Frigate · Home Assistant · panel⛔A direct view can bring the camera downIn our experience a live view aimed straight at an older camera crashes it — the RTSP connection limit plus an audio codec the application can't digest. Go through go2rtc, and#media=videostrips the audio from the stream. -
Main stream and sub stream
Most cameras offer two streams: a main one (high resolution) and a sub one (low). On Dahua-style cameras the path is the same and only
subtypechanges:0is the main stream,1the sub stream. The rule in Frigate: detection runs on the sub stream, recording on the main stream. That way the accelerator isn't drowned in high resolution, and the recording keeps its quality.yaml · go2rtc# values in <…> are placeholders; real credentials live in a secret store streams: hall_main: rtsp://<user>:<pass>@<camera-host>:554/cam/realmonitor?channel=1&subtype=0#media=video hall_sub: rtsp://<user>:<pass>@<camera-host>:554/cam/realmonitor?channel=1&subtype=1#media=videoyaml · Frigate reads from the restreamcameras: hall: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/hall_sub input_args: preset-rtsp-restream roles: [detect] - path: rtsp://127.0.0.1:8554/hall_main input_args: preset-rtsp-restream roles: [record] detect: fps: 5 # the value the documentation recommendsTwo things to remember.
#media=videotells go2rtc to ignore the audio, and#backchannel=0stops it opening a two-way-audio channel that can block the camera. Need sound? Drop the first and add an audio codec your application accepts. -
go2rtc and Frigate: two different go2rtc
Frigate ships its own embedded go2rtc. If you also run a standalone go2rtc on the same machine, you have two separate instances. By default go2rtc listens on
1984(API and web UI),8554(RTSP) and8555(WebRTC) — two instances can't share the same ports, so change them on one. The version at the time of writing is v1.9.14 (19 Jan 2026), which the Frigate documentation also links to.⚠️Don't publish the go2rtc interfaceAccess to the go2rtc API is access to your server: theexecandechosources can run commands. In Frigate they are off by default; they are turned on only with an environment variable, and only if you trust the whole config. Keep the interface on the internal network, or behind a reverse proxy with login.⚠️Snapshots throughframe.jpegThe go2rtc documentation describeswidth/wandheight/hparameters for the snapshot. On our setup?w=did not change the size ⚠️ — we haven't compared across versions. If it has no effect for you, scale in the application that fetches the snapshot. -
Camera types — each with its own trap
The traps here are field observations, not guarantees for every model. Check against your own camera.
Camera Stream Specifics and trap Professional IP camera (e.g. the Dahua family) H.264, two streams The most predictable with go2rtc — its authors call it a reference implementation of the protocol. Give it a fixed address (DHCP reservation), or the paths in go2rtc break. The clock drifts — turn on NTP sync. For the camera's HTTP API, curl --anyauthpicks the login method itself.USB webcam raw or MJPEG Our model offered only raw and MJPEG video (see what yours offers with v4l2-ctl --list-formats-ext) ⚠️ — then it needs transcoding to H.264 with ffmpeg. The device is opened by one process, so one ffmpeg holds it and everything else reads from go2rtc.Cheap camera with a sleep mode H.264 It sleeps without motion → a periodic end of stream (EOF) is normal, don't chase it as an error. ESP32-CAM-type board MJPEG A bad picture and reboots usually mean weak power. Give it a stable 5 V with enough current and a short cable. ✅Transcoding is a last resortgo2rtc recommends ffmpeg for transcoding only when needed. If the camera already gives H.264, transcode nothing — that keeps the processor free. -
Detection: with or without an accelerator
Frigate can detect people and cars on the processor too, but its documentation does not recommend that for real use: an accelerator or OpenVINO in CPU mode is better. With a Hailo, the detector type is
hailo8l; while you set it up, use the Hailo and Frigate 0.18 lesson — the retention keys are there too. In short: the host driver must be the one Frigate requires, not the one built into the kernel; a mismatch blocks the detector.ℹ️Why two streams here as wellThe detector looks at a low-resolution picture at few frames per second — that is enough for it. The main stream goes only to recording. This way one camera barely loads the accelerator. -
The camera watches people: GDPR
Recording people is personal-data processing. The European Data Protection Board (EDPB) Guidelines 3/2019 say, in short: the household exemption is narrow; write down the purpose; put up a sign as the first layer of information; keep recordings short (usually a few days; beyond 72 hours needs a stronger justification); don't record sound unless you need it; face recognition is biometric processing under Art. 9; large-scale systematic monitoring of a publicly accessible area needs a data protection impact assessment (Art. 35(3)(c)).
⚠️This is not legal adviceFor your own case, ask a lawyer or your data protection authority. Details and the retention configuration in Frigate 0.18 are in the Hailo and Frigate lesson.
04Check
1. Why don't we point every application straight at the camera?
2. Why might a USB webcam need transcoding and a single process holding the device?
3. Which stream do we use for what in Frigate?
4. A camera that sleeps without motion gives a periodic end of stream (EOF). What does it mean?
05What's next
06Sources
- go2rtc — README — ports, supported sources, security.
- go2rtc — RTSP module — the address format for Dahua,
#media=video,#backchannel=0. - go2rtc — releases — v1.9.14 is the latest as of 01.10.2026.
- Frigate — Restream — one stream from the camera, main and sub stream, limits on
exec. - Frigate — object detectors — CPU not recommended; Hailo.
- EDPB — Guidelines 3/2019 — processing of personal data through video devices.
- KAGAMI Academy — Hailo-8 and Frigate — accelerator setup and retention.
- KAGAMI's own field observations with different cameras (the traps in step 4).