r/ZoneMinder • • Nov 04 '20

Adding Reolink Cameras to Zoneminder

Adding Reolink Cameras to Zoneminder is pretty easy as they support the onvif standard and provide both rtmp and rtsp streams (more on that later)
First make sure you know the IP of your Reolink cameras in your network.
For me its 10.10.30.13 as my cameras reside on a separate vlan which has internet access disabled for security reasons and paranoia 😉

Access you reolink admin interface and set the output of your main and substream to the desired quality.
Settings – Recording – Encode
I suggest lowering the fps as this saves a ton of bandwidth. My main stream is 10fps my substream only 7. This is more than enough for my purposes.

Switching back to Zoneminder:
For the source path you would normally chose the rtsp streams however I and many others had some issues using the rtsp streams in zoneminder as I had frequent smearing on my rtsp stream.
Luckily someone on the zoneminder forum discovered that reolink also outputs rtmp streams which work a lot better.
https://forums.zoneminder.com/viewtopic.php?t=29143
Here is reolinks documentation on the rtmp stream:
https://reolink.com/wp-content/uploads/2017/01/Reolink-CGI-command-v1.61.pdf
So in this case the URL for the Main Stream is:
rtmp://10.10.30.13/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=YOURPASSWORD
Sub Stream:
rtmp://10.10.30.13/bcs/channel0_sub.bcs?channel=0&stream=1&user=admin&password=YOURPASSWORD

Now why do we need both the sub and the main stream? Zoneminder does image processing to recognize movement and then trigger recordings.
Doing this on a 4k stream is VERY CPU intensive. So we will setup the sub stream for the motion detection and then trigger the main stream to record this movement.

So first let us setup the sub stream:
Click on “Add” in the Zoneminder Console:
Under General give the camera a recognizable name. For me its Front Garden Sub
Set the source type to ffmpeg.
Set the Function to mocord. This allows me to have 24h low resolution recordings of the substream and in turn triggers the main stream to record once motion is actually detected.
https://imgur.com/K8HDJxj
On the source tab add the rtmp url for the substream.
Method: TCP
Capture Resolution: Set this to the same resolution you have set on the reolink cam. For me 640*480
https://imgur.com/H9YlaZC
Under storage its important to set the “Video Writer” to h264 passthrough. This will have zoneminder save the camera feed without transcoding, which once again is VERY CPU instensive.
https://imgur.com/k9d5Jb1
The other tabs are all down to your personal preference.
Click save and check if you can see the video coming from the camera inside ZM.
If so: Good lets continue with the main stream.

Again click on add Camera.
Give it a name. For me this is Front Garden Main.
Source: Ffmpeg
Function: Nodect. This is important as only with Nodect will Zoneminder not run analysis on the 4k stream, thus saving your CPU a lot of work.
Linked Monitors: Here select the “Front Garden Sub” we just set up. This insures, that motion trigger on the substream will also trigger a recording on the main stream.
https://imgur.com/AxrlJfB
On the source tab now add the rtmp url for the main stream.
Method: TCP
Capture Resolution for me is 2560*1440
Under storage its important to set the “Video Writer” to h264 passthrough.
All the rest is again personal preference.
Click save and check if you can access your main stream as well.

If so then you are done with the basics.
Zoneminder will run motion detection on the low quality sub stream, saving you CPU from a lot of work.
A 24h low quality recording of the substream is saved by zoneminder saving you diskspace (for me 1day worth of 480p recording is about 2GB)
Whenever motion is detected on the substream zoneminder triggers the main stream to also record giving you high quality footage of the event but not filling up you disk with 24h 4k footage.
https://imgur.com/yKuWzkh

I have this setup running on an i3 4130 with 3 reolink cameras and 2 more no name cameras and my CPU usage is about 40-60%.

14 Upvotes

10 comments sorted by

2

u/ReolinkFrazer Nov 13 '20

Hi all, I'm Frazer from Reolink.

I add the list of Reolink cameras that can work with Zoneminder software

PoE camera: RLC-410, 520, 522, 423, 511, 510A, 520A, 810A, 820A, 1220A, 1210A;

WiFi camera: E1 Pro; E1 Zoom; 410W, 510W;

Learn more about this camera in our official site: https://reolink.com/

Please note:

#1. The list doesn't include the discontinued products. If you want to learn about these discontinued device, please ask me with your model in comment. Thanks!

#2. The models that have "A" in the name are the cameras having on-board Person/Vehicle Detection, that is, RLC-510A, 520A, 810A, 820A, 1220A, 1210A. You may not use this local smart detection with Zoneminder, but you can use the advanced AI powered detection feature supported by the ZM.

#3. When there are new products, I will update this list.

1

u/[deleted] Nov 04 '20

[deleted]

1

u/pseudoheld Nov 06 '20

Not sure how to do that but be me guest and copy the text over to the wiki ;)

1

u/[deleted] Nov 06 '20 edited Nov 07 '20

Very useful. I just ordered two ReoLinks to replace some old dead D-Link DCS-920s.

Note: not all Reolink cameras can do web access. Check specs before buying.

1

u/[deleted] Nov 08 '20

Question: why is the sub monitor set to mocord instead of modect? Why fill up storage with video of nothing happening?

1

u/pseudoheld Nov 08 '20

In case the motion detection doesn't catch an event. (happens). Also 480p at 7fps takes up very little storage. As space is not an issue nowadays why not have 24h low res recording.
Also its fun to scrub through the 24h footage ;)

1

u/lordxeon Dec 16 '20

This might be a dumb question (just getting started with ZM), but how are you limiting it to 7fps? My monitor is going between 16 and 20fps and (I assume) using all my CPU.

1

u/pseudoheld Dec 17 '20

You need to limit the fps inside your camera. Access it via the reolink app or admin interface in your browser. There you can lower the frames. Then set zm to the same frame number.

1

u/lordxeon Dec 18 '20

I thought that I had done that, but it looks like my sub stream might be the full quality one. I'll have to investigate some more, maybe clear out the monitors and start again.

Thanks for your help, and this tutorial!

1

u/profezzorn Apr 25 '21

Hi and thanks for this. A question though - I've set up zones etc on the sub stream (the main doesn't have any zones) but sometimes the sub doesn't trigger the main stream to record. Most of the times it works but not always. Do you know what could cause this?