Page 1 of 1

RPi 4/Reolink Capture problems

Posted: Mon Sep 20, 2021 9:00 pm
by bartleyo
I have installed zoneminder on my new RPi4 following the debian instructions.

I can capture from my Reolink 411 camera using rtsp but it suffers from almost continuous tearing so I am trying to get RTMP to work.

Just changing the capture to RTMP will not capture any images at all. I get the following log entries repeatedly:
Capturezm.PNG
Capturezm.PNG (117.82 KiB) Viewed 4036 times
I have tried to activate logging but even though it says in the log that FFMPEG logs are enabled I can't find them anywhere :( . I have followed the instructions to activate logging here https://zmeventnotification.readthedocs ... ml#logging

I have run FFMPEG from the command line

Code: Select all

ffmpeg -i 'rtmp://10.0.0.102/bcs/channel0_sub.bcs?channel=0&Stream=1&user=admin&password=xxxx' webcam.mp4
and it captures from the camera with no problem at all.

I then found a mention of increasing the GPU memory so increased that to 512MB

I also found a reference about X265 encoding so changed the optional parameters to

Code: Select all

# Lines beginning with # are a comment 
# For changing quality, use the crf option
# 1 is best, 51 is worst quality
#crf=23
vcodec libx264
(I had to comment out the "crf" line as I didn't know how to separate multiple parameters)

This has improved it very slightly, I now have 11 events captured but all are corrupted except the third one which captured a single frame image from the camera.

I would really like to see what parameters are being sent to FFMPEG so I can try to work out what is wrong or needed - Can anyone tell me where to find the FFMPEG logs which would show the detailed information of what it is doing?

Re: RPi 4/Reolink Capture problems

Posted: Tue Sep 21, 2021 2:22 pm
by bbunge
Zoneminder on Buster with Pi4 is problematic. I have not been able to get a good performing ZM system on Buster 32 bit.

However, Ubuntu 20.04 server on Pi4, 32 or 64 bit runs Zoneminder very well!

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 12:09 am
by bartleyo
Thanks for the reply. So I have now installed Zoneminder on Ubuntu 20.04 on a Pi 4 8GB but it unfortunately won't capture a thing on either rtsp or rtmp.

Can anyone tell where the FFMPEG log files are or how to locate them?

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 12:50 am
by bbunge

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 7:32 am
by bartleyo
Hi, thanks for the link but it's about PTZ of reolink cameras rather than getting ZoneMinder to capture from them. Did you post mean to post another link?

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 10:25 am
by kitkat
bartleyo wrote: Mon Sep 20, 2021 9:00 pm I also found a reference about X265 encoding so changed the optional parameters to

Code: Select all

# Lines beginning with # are a comment 
# For changing quality, use the crf option
# 1 is best, 51 is worst quality
#crf=23
vcodec libx264
(I had to comment out the "crf" line as I didn't know how to separate multiple parameters)
Try removing all the #commented lines.

I'm not atall sure that it will fix your issues but #comments caused errors with FFMpeg for me and at least one other user.

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 4:48 pm
by bartleyo
Thanks, unfortunately no change. :(

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 5:06 pm
by bartleyo
@bbunge - which version of Zoneminder did you install on Ubuntu?

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 7:18 pm
by bbunge
bartleyo wrote: Wed Sep 22, 2021 5:06 pm @bbunge - which version of Zoneminder did you install on Ubuntu?
1.36.5

Will do a quick setup and install of 1.36.7 on 20.04. Stay tuned...

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 7:20 pm
by bartleyo
Finally got it working! Ended up being a firewall problem on my network, the RTMP protocol was being blocked.

One camera keeps dropping out but the other seems ok.

Thanks all :)

The FFMPEG problem turned out to be some installation related issue. I re-installed it all and they just started coming out in the debug directory.

Re: RPi 4/Reolink Capture problems

Posted: Wed Sep 22, 2021 8:16 pm
by bbunge
OK, fresh install of Ubuntu 20.04 Server on Pi4 8GB

First I disabled auto upgrades
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
Change 1 to 0

Set the system timezone (use your timezone):
sudo timedatectl set-timezone America/New_York

Installed LAMP per ZM Wiki: https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.36.x
Secured Mariadb
Changed some Mariadb settings
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
In the [mysql] area add:
innodb_file_per_table = ON
innodb_buffer_pool_ size = 256M
innodb_log_file_size - 32M

*Note: the above database settings are my starting point for a 4 GB or 8 GB Pi4. Install and run mysqltuner to see what else needs adjusted. Rub mysqltuner from time to time as the innodb_buffer_pool_size will need to be adjusted as the number of events grows.
Restart Mariadb
service mysql restart

Finish the Zoneminder install with the script from the WIKI
In Zoneminder options set the TIMEZONE

Easily running a 1080P cam on mocord.

Re: RPi 4/Reolink Capture problems

Posted: Thu Sep 23, 2021 4:22 pm
by bartleyo
Thanks. All working ok now.

Raspberry Pi4 8GB, Ubuntu 20.04 64 bit, boot from SD card and writing video to 1GB USB HDD.

I have two cameras(reolink 410 and 411)

Two sources defined, set to Modect on the low-res 640/356 rtmp streams. Storing video and stills.

Then two more sources defined set to Nodect on the high-res 2550x1440 rtmp streams with no decoding and just storing video on a passthrough.
Capture1.PNG
Capture1.PNG (98.83 KiB) Viewed 3673 times
Capture2.PNG
Capture2.PNG (33.2 KiB) Viewed 3673 times
Capture3.PNG
Capture3.PNG (26.05 KiB) Viewed 3673 times