reostream

module
v0.2.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0

README

reostream

A camera proxy for Reolink cameras. It sits between your cameras and Frigate (or any NVR), pulls video over Reolink's own Baichuan protocol, and serves it as RTSP and HTTP MPEG-TS.

It does not replace Frigate. Frigate still does detection and recording; reostream only changes where Frigate gets the video from.

Reolink cameras --Baichuan--> reostream --RTSP--> go2rtc / Frigate / Blue Iris
                                        --HTTP--> mpv / VLC / scripts

Why

Reolink's RTSP server is broken on some models. On a Duo 3 it gave green blocks, gray frames and smearing. Same camera, same encoder, same thirty minutes, both transports:

transport segments segments with bitstream errors
Baichuan 184 0
RTSP 178 147

Reolink's own NVR looks fine because it uses Baichuan, not RTSP. A fisheye here also loses about 21% of its frames over RTSP. Method in docs/measurements.md.

Neolink did this first and made the protocol understandable. It has had no commits since January 2025. reostream is a new implementation, not a fork.

Quickstart

docker run -d --name reostream --restart unless-stopped \
  --network host \
  -v reostream-data:/data \
  ghcr.io/volttech21/reostream:latest

docker logs reostream

Host networking lets reostream see your real network: it finds cameras on its own (battery ones too), and cameras can upload clips to it. Where you can't use it, map the ports instead: -p 8560:8560 -p 8561:8561 -p 8562:8562 -p 2121-2131:2121-2131.

  1. The log prints a one-time token. Open http://<host>:8562/claim and paste it.
  2. Keep the password it gives you.
  3. Add cameras: the page searches your network and lists what it finds. Enter a password for each one you want. Port 9000 on a wired camera must be reachable; it is on by default.

Your streams are at rtsp://<host>:8561/<camera> and http://<host>:8560/<camera>.ts.

On Unraid, install reostream from Community Apps. Prefer compose, a plain binary or systemd? See docs/setup.md.

Status page

Using it with Frigate

Feed go2rtc from reostream's RTSP, and point Frigate at go2rtc. One camera connection then serves detect, record and live view.

go2rtc:
  streams:
    driveway:
      - rtsp://reostream:8561/driveway
      - ffmpeg:driveway#audio=opus
    driveway_sub:
      - rtsp://reostream:8561/driveway_sub

cameras:
  driveway:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/driveway_sub
          input_args: preset-rtsp-restream
          roles: [detect]
        - path: rtsp://127.0.0.1:8554/driveway
          input_args: preset-rtsp-restream
          roles: [record, audio]

The #audio=opus line is optional; it gives browsers and apps audio in live view.

Name the go2rtc stream exactly like the Frigate camera (driveway above). Frigate's own page can pick another stream through live.streams, but the Advanced Camera Card in Home Assistant ignores that and asks go2rtc for the camera's name, so a different name gives a blank card.

If Frigate runs on Docker's default bridge network and reostream on host networking, 127.0.0.1 inside the Frigate container is the container itself, not the host, and gives "connection refused". Use the host's LAN address in the go2rtc URLs instead.

If a camera's main stream runs at about half its frame rate, look at its Frame Rate Mode in the Reolink app or on its Settings tab: on Auto some cameras lower the frame rate in low light. Set it to Constant.

Read RTSP over TCP, which go2rtc and Frigate's presets do. Over UDP a big keyframe is hundreds of packets and losing any one damages the frame: a 16 MP Duo 3 main stream read over UDP had 101 of 394 frames damaged even on loopback. When recordings show green or gray smears, look at go2rtc's /api/streams: a reader's senders show a drops count (left out while it is zero), which is where frames dropped on the way to Frigate show up, since neither reostream nor Frigate logs them.

Without go2rtc, Frigate can read http://reostream:8560/driveway.ts directly.

The streams are open to your network by default. To ask for a login, set username and password under [rtsp] (it covers ports 8560 and 8561) and use rtsp://user:password@reostream:8561/driveway; see docs/setup.md.

Endpoints

RTSP, port 8561 HTTP, port 8560
/<cam> /<cam>.ts main stream
/<cam>_sub /<cam>_sub.ts sub stream
/<cam>_extern /<cam>_extern.ts extern: the middle stream (about 896x512 H.264) most clients never offer

Also on port 8560:

/<cam>.keyframe latest keyframe, raw
/<cam>.frames raw access units with a small header, for your own decoder; see docs/setup.md
/<cam>.still.ts the latest keyframe as a one-frame MPEG-TS; never touches the camera
/api/status per-stream JSON: connected, fps, bitrate, clients, reconnects, last error
/metrics the same for Prometheus

What it does

  • One connection per stream, held open whether anyone is watching or not.
  • Timestamps from the camera's own clock, so frame rates come out right.
  • A slow client is disconnected, never buffered. No client can stall a camera.
  • New clients start at a keyframe. Audio is carried when the camera sends it.
  • Two-way audio: on cameras with a speaker, Frigate's talk button works through it.
  • The camera's own detections (motion, person, vehicle, animal) go to MQTT and to Frigate as events, so a small box can lean on the camera instead of decoding everything.
  • Apple Home: the cameras show in the Home app as one HomeKit bridge, with live video, pictures and motion sensors, no Homebridge needed.
  • Recordings from the camera's SD card, and a small FTP receiver that keeps a copy of each clip the camera uploads.
  • Battery cameras: found by their own UDP search, woken only while someone is watching, battery level shown without waking them. Ones paired to a Home Hub sleep too, with battery = true.
  • Sessions are closed cleanly. A camera left with an open session refuses connections for minutes.
  • A web page on port 8562 for status, live view, config, logs and camera settings.

No ffmpeg, GStreamer or RTSP server in the serving path.

Tested on

On my own cameras:

Model Count Firmware
RLC-810A (8 MP bullet) 6 v3.1.0.956_24022103
FE-P (fisheye) 1 v3.0.0.5336_2509021915
Duo 3 PoE (dual lens panorama) 1 v3.0.0.5049_2506302188
TrackMix PoE (PTZ, auto tracking) 1 v3.2.0.5931_2601294931
Argus PT Ultra (battery, Wi-Fi) 1 v3.0.0.5808_26041006

reostream has been the only video path for this fleet's Frigate since September: 23 streams, 82 Mbps, about 65% of one core of a 2012 Xeon (E5-1650), about 70 MB of memory. Numbers in docs/measurements.md.

Reported working by users (thank you!):

Model What works Reported in
RLC-833A (v3.1.0.3016) video, two-way talk GitHub #18
E1 Pro (v3.1.0.1414) video, two-way talk GitHub #18
E1 video, privacy mode GitHub #13
E1 Zoom 8 MP video, two-way talk, pan/tilt Reddit
RLC-822A (6 cameras) video GitHub #1
Video Doorbell PoE (D340P, v3.0.0.6460) video, audio, two-way talk GitHub #1, Reddit
Video Doorbell (wired 2K) video Reddit
Video Doorbell Wi-Fi (2nd gen, v3.0.0.7106) video (main, sub, extern), motion, two-way talk (silent on v3.0.0.6460) Reddit, GitHub #7, #36
CX820 video Reddit
Duo Floodlight Wi-Fi v2 video Reddit
Duo 4K Wi-Fi (3 cameras) video Reddit
RLC-811A (v3.1.0.4695) video, audio Reddit
Lumus Pro (v3.2.0.4243) video, audio, two-way talk (Frigate: NVIDIA decoding works; on Intel, hardware decoding off for it) GitHub #17, Reddit
RLC-410-5MP video (Frigate) Reddit
RLC-420 video (Frigate) Reddit
RLC-420-5MP video (Frigate) Reddit
RLC-422 video (Frigate) Reddit
RLC-510A video (Frigate) Reddit
RLC-520A video (Frigate) Reddit
Duo PoE video (Frigate) Reddit
Duo 2 PoE video (Frigate) Reddit
Duo Floodlight PoE video (Frigate) Reddit
E1 Outdoor video (Frigate) Reddit
FE-W video (Frigate) Reddit
CX810 (v3.1.0.6126) video, audio Reddit
RLC-522 (v3.0.0.757, 4 cameras) video (main and sub, Frigate) GitHub #35, #40
RLC-820A video Reddit
RLC-510WA (Wi-Fi) video Reddit
RLC-823S2 (v3.1.0.5714) video (Frigate) GitHub #33
Elite Floodlight (Wi-Fi) video (main and sub, Frigate) Reddit
Solar Floodlight Cam (battery, Wi-Fi; v3.0.0.6133) video on demand, live motion from waking, Frigate GitHub #36
Duo 3 PoE (v3.2.0.5770) video (main, sub, extern), audio Reddit
RLC-1224A (12 MP, 3 cameras) video at full resolution (Frigate) Reddit
RLC-410W video GitHub Discussion #11
D800 (v3.0.0.82) video (main; it allows one connection at a time) GitHub Discussion #11
Omvi X16 PoE (v3.2.0.7318) video (main, sub, zoom, zoom sub), audio on sub and zoom, Frigate GitHub #42
Omvi 2i PoE (v3.2.0.7034) video (all four streams), audio, Frigate GitHub #42

Your camera not here? Open an issue with the model, firmware and what worked, and it goes on the list.

Camera control

Each camera has a page with three tabs:

  • Live: the player, stream picker, pan/tilt with presets, talk, snapshot, floodlight, and every stream URL to copy.
  • Recordings: clips from the SD card on a timeline, plus clips saved by reostream.
  • Settings: image, name and timestamp, encoding, lights, audio, pan/tilt (auto return, auto tracking), FTP, email and push alerts, network services, date and time, and every raw value for anything not covered. Instant settings save as you change them; ones that restart the stream or the camera ask first. A blue dot marks a setting changed from the camera's factory value, with a button to put it back. Settings can be copied to other cameras.

Camera page

reocam, a separate command line tool, reads and changes camera settings over the same protocol. Streaming does not need it.

reocam -address 192.0.2.50 -password secret probe

probe reports which messages the camera answers. See docs/control.md for reading and writing settings and what to watch out for.

More

  • docs/setup.md: other ways to run it, the config file, the control page, RTSP, the frames feed, recordings and saved clips, alerts, Apple Home, battery cameras
  • docs/control.md: camera control with reocam
  • docs/protocol.md: what the Baichuan wire actually does
  • docs/measurements.md: how every number above was measured

License

AGPL v3. Free to use, run and modify. If you distribute a modified version or run one as a service for others, you must publish your changes.

A commercial license without that obligation is available. See COPYRIGHT.

Directories

Path Synopsis
cmd
bcpcap command
Command bcpcap decodes a Baichuan conversation out of a packet capture.
Command bcpcap decodes a Baichuan conversation out of a packet capture.
bcprobe command
Command bcprobe connects to one camera and writes its video elementary stream to stdout.
Command bcprobe connects to one camera and writes its video elementary stream to stdout.
reocam command
Command reocam controls a camera over Baichuan.
Command reocam controls a camera over Baichuan.
reoevent command
Command reoevent turns a battery camera's cloud event reports into local MQTT.
Command reoevent turns a battery camera's cloud event reports into local MQTT.
reostream command
Command reostream serves Reolink camera video as MPEG-TS over HTTP for every camera listed in a config file, reconnecting failed streams with backoff and never running two connections to the same stream at once.
Command reostream serves Reolink camera video as MPEG-TS over HTTP for every camera listed in a config file, reconnecting failed streams with backoff and never running two connections to the same stream at once.
talkstop command
internal
adpcm
Package adpcm encodes 16 bit mono PCM as IMA ADPCM, the "DVI4" variant the Reolink cameras accept for two-way audio.
Package adpcm encodes 16 bit mono PCM as IMA ADPCM, the "DVI4" variant the Reolink cameras accept for two-way audio.
alarms
Package alarms follows a camera's own detection state: it holds a Baichuan session subscribed to alarm events (message 31, then 33 pushes) and reports each change -- motion starting or stopping, an object type appearing or going away.
Package alarms follows a camera's own detection state: it holds a Baichuan session subscribed to alarm events (message 31, then 33 pushes) and reports each change -- motion starting or stopping, an object type appearing or going away.
baichuan
Package baichuan implements the Reolink Baichuan protocol.
Package baichuan implements the Reolink Baichuan protocol.
bcevent
Package bcevent interprets the cloud event reports a battery camera emits (bcudp cf31 packets) as motion, recording and status.
Package bcevent interprets the cloud event reports a battery camera emits (bcudp cf31 packets) as motion, recording and status.
bcudp
Package bcudp carries a Baichuan byte stream over the UDP transport that battery cameras speak instead of TCP port 9000.
Package bcudp carries a Baichuan byte stream over the UDP transport that battery cameras speak instead of TCP port 9000.
cgi
Package cgi talks to a Reolink camera's HTTP API.
Package cgi talks to a Reolink camera's HTTP API.
config
Package config loads the TOML file that lists the cameras reostream serves.
Package config loads the TOML file that lists the cameras reostream serves.
control
Accounts: read only, on purpose, with no exception carved out anywhere in this file.
Accounts: read only, on purpose, with no exception carved out anywhere in this file.
fakecam
Package fakecam fakes a Baichuan camera for tests, without a socket library of its own and without any protocol logic.
Package fakecam fakes a Baichuan camera for tests, without a socket library of its own and without any protocol logic.
fakeclip
Package fakeclip builds small MP4 clips for tests, shaped like a battery camera's motion clips: H.264 video and, optionally, AAC-LC at 16 kHz mono, either as a plain file (sample tables in the moov, one mdat) or a fragmented one (an empty moov, then a moof+mdat pair per keyframe interval), the way a battery doorbell writes them.
Package fakeclip builds small MP4 clips for tests, shaped like a battery camera's motion clips: H.264 video and, optionally, AAC-LC at 16 kHz mono, either as a plain file (sample tables in the moov, one mdat) or a fragmented one (an empty moov, then a moof+mdat pair per keyframe interval), the way a battery doorbell writes them.
fakenvr
Package fakenvr fakes a Reolink NVR's Baichuan port for tests: it logs a client in, then serves every preview the client asks for, as many as it asks for and on as many channels, interleaved on the one connection the way a recorder interleaves them.
Package fakenvr fakes a Reolink NVR's Baichuan port for tests: it logs a client in, then serves every preview the client asks for, as many as it asks for and on as many channels, interleaved on the one connection the way a recorder interleaves them.
frames
Package frames serves a camera stream's access units over HTTP, one length-prefixed record per frame, for a client that owns its own decoder.
Package frames serves a camera stream's access units over HTTP, one length-prefixed record per frame, for a client that owns its own decoder.
ftpd
Package ftpd is the small FTP server cameras upload their clips to.
Package ftpd is the small FTP server cameras upload their clips to.
homekit
Package homekit puts reostream's cameras in Apple's Home app (#32): one bridge, named reostream unless the config says otherwise, with a camera accessory per wired camera, so the Home app pairs once for all of them.
Package homekit puts reostream's cameras in Apple's Home app (#32): one bridge, named reostream unless the config says otherwise, with a camera accessory per wired camera, so the Home app pairs once for all of them.
hub
Package hub broadcasts MPEG-TS chunks from one camera goroutine to any number of HTTP clients.
Package hub broadcasts MPEG-TS chunks from one camera goroutine to any number of HTTP clients.
mp4read
Package mp4read reads the video track of the MP4 files Reolink cameras write (to their SD card, and over FTP): a plain moov with an avc1 or hvc1 track, or a fragmented file (battery doorbells) whose moov is empty and whose samples sit in moof+mdat pairs.
Package mp4read reads the video track of the MP4 files Reolink cameras write (to their SD card, and over FTP): a plain moov with an avc1 or hvc1 track, or a fragmented file (battery doorbells) whose moov is empty and whose samples sit in moof+mdat pairs.
mqtt
Package mqtt is a minimal MQTT 3.1.1 client: enough to feed motion and status into mosquitto / Home Assistant / Frigate, and to hear another tool's motion (Subscribe), without pulling in a full client library.
Package mqtt is a minimal MQTT 3.1.1 client: enough to feed motion and status into mosquitto / Home Assistant / Frigate, and to hear another tool's motion (Subscribe), without pulling in a full client library.
presence
Package presence keeps a battery camera present to a recorder without waking it.
Package presence keeps a battery camera present to a recorder without waking it.
rtsp
Package rtsp serves camera streams over RTSP.
Package rtsp serves camera streams over RTSP.
server
Package server exposes hub streams as MPEG-TS over HTTP.
Package server exposes hub streams as MPEG-TS over HTTP.
stream
Package stream joins one camera to one hub: dial, depacketize, mux, publish, on repeat until the context is canceled or something fails.
Package stream joins one camera to one hub: dial, depacketize, mux, publish, on repeat until the context is canceled or something fails.
supervisor
Package supervisor keeps every configured camera stream running, one goroutine per stream, restarting it with backoff when it fails.
Package supervisor keeps every configured camera stream running, one goroutine per stream, restarting it with backoff when it fails.
talk
Package talk plays audio from an RTSP client through a camera's speaker.
Package talk plays audio from an RTSP client through a camera's speaker.
ts
Package ts muxes decoded camera frames into an MPEG-TS byte stream.
Package ts muxes decoded camera frames into an MPEG-TS byte stream.
webui
Package webui is the session, auth and rendering plumbing behind the reostream daemon's operator page -- one process, one page, covering both the fleet and the cameras on it.
Package webui is the session, auth and rendering plumbing behind the reostream daemon's operator page -- one process, one page, covering both the fleet and the cameras on it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL