Reolink CX820 with Frigate
I recently got a Reolink CX820 IP camera with the intention of setting it up with Frigate. I was concerned about compatibility because I couldn't find a complete configuration for this model specifically, only reports of people having issues with it. Fortunately, the CX820 happens to work reliably with Frigate, including two-way talk.
I relied heavily on the official Frigate documentation for Reolink cameras. I'm just documenting what worked for me in case it helps others.
The issue
The camera's main RTSP stream is unstable in Frigate — typically I'd get a single frame before the stream stopped.
The main stream uses H.265/HEVC encoding, which I suspect is at least partially the cause. The sub stream which uses H.264 doesn't have this issue. The older CX810's main stream reportedly works well over RTSP when you change the encoding to H.264, but the CX820 doesn't offer that option.
As an alternative, the Frigate docs suggest consuming the HTTP-FLV stream for the video and RTSP for the two-way talk feature. That combination proved reliable for me.
Steps I followed
-
Connect the camera to your network and access it using the Reolink app.
-
In the camera settings, enable HTTP and RTSP, and restart the camera for the settings to take effect.
-
(Optional) Uninstall the Reolink app if you prefer — at this point the camera can be configured entirely through the camera's web interface, which I find much faster.
-
Download FFmpeg binaries from https://github.com/btbn/ffmpeg-builds/releases and pick the build that matches your platform; in my case
ffmpeg-n8.1-latest-linux64-gpl-8.1.tar.xz. The Frigate docs recommend at least version 8.0, which includes "http-flv-enhanced over H.265"-support. I placed the binaries in/config/custom-ffmpegwith the following structure:config/ ├── config.yaml # Frigate config └── custom-ffmpeg/ # FFmpeg 8.x binaries └── bin/ ├── ffmpeg ├── ffplay └── ffprobe -
Configure Frigate with the following settings:
go2rtc: streams: cx820_main: - ffmpeg:http://<camera-ip>/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=<user>&password=<pwd>#video=copy#audio=copy#audio=opus - rtsp://<user>:<pwd>@<camera-ip>:554/Preview_01_sub # Yes, we use the sub stream for two-way talk, not the main stream. cx820_sub: - ffmpeg:http://<camera-ip>/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=<user>&password=<pwd> - rtsp://<user>:<pwd>@<camera-ip>:554/Preview_01_sub cameras: front_door: enabled: true live: streams: Main: cx820_main Sub: cx820_sub ffmpeg: hwaccel_args: preset-vaapi # For Intel / AMD hardware acceleration. Adjust this according to your platform. See https://docs.frigate.video/configuration/ffmpeg_presets. inputs: - path: rtsp://127.0.0.1:8554/cx820_main input_args: preset-rtsp-restream roles: - record - path: rtsp://127.0.0.1:8554/cx820_sub input_args: preset-rtsp-restream roles: - detect ffmpeg: path: /config/custom-ffmpeg
That's it. The docs suggest changing additional camera settings, but I didn't find them necessary. I'll update this post if anything changes.
Final notes
Firmware
My camera shipped with firmware v3.2.0.4698_2503192244 and worked perfectly. I later upgraded to v3.2.0.5375_2509162386, which continues to work well.
ffprobe output
# Sub stream
$ ./ffprobe rtsp://<user>:<pwd>@<camera-ip>:554/Preview_01_sub
Input #0, rtsp, from 'rtsp://<user>:<pwd>@<ip>:554/Preview_01_sub':
Metadata:
title : Session streamed by "preview"
comment : reolink rtsp stream
Duration: N/A, start: 0.000063, bitrate: N/A
Stream #0:0: Video: h264 (libopenh264) (High), yuv420p(progressive), 640x360, 4 fps, 54 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
# Main stream
$ ./ffprobe rtsp://<user>:<pwd>@<ip>:554/Preview_01_main
Input #0, rtsp, from 'rtsp://<user>:<pwd>@<ip>:554/Preview_01_main':
Metadata:
title : Session streamed by "preview"
comment : reolink rtsp stream
Duration: N/A, start: 0.000188, bitrate: N/A
Stream #0:0: Video: hevc (Main), none, 3840x2160, 25 fps, 25.08 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
Unsupported codec with id 173 for input stream 0
The last line (Unsupported codec with id 173 for input stream 0) appears because my Fedora desktop is using the free build of FFmpeg, which doesn't include HEVC, i.e., H.265 support. Installing a non-free build with HEVC support will remove that message.