Reolink RLC-423: Artifacts in RTSP Stream

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
Post Reply
mewald
Posts: 7
Joined: Wed Oct 21, 2020 8:05 pm

Reolink RLC-423: Artifacts in RTSP Stream

Post by mewald »

Hi community, I am trying to connect a Reolink RLC-423 to Zoneminder. The transmitted picture is nice and shiny until something moves. Then it becomes chunky with lots of artifacts in it (sorry, that's the best way I know how to describe it). I attached a screenshot of a very mild version of that. The other attachments show the monitor configuration. As you can see I am using the low quality channel which is configured 640x480 and 7 ftps.

Zoneminder and the camera are both connencted to the same switch via cable and they're the only ones. So there's not congestion on that switch whatsoever.

Telling by the load, the server seems rather bored:

Code: Select all

load average: 0.54, 0.48, 0.22
Any ideas what's going on?
Attachments
Screenshot 2020-10-22 at 06.32.27.png
Screenshot 2020-10-22 at 06.32.27.png (129.21 KiB) Viewed 7120 times
Screenshot 2020-10-22 at 06.32.19.png
Screenshot 2020-10-22 at 06.32.19.png (153.73 KiB) Viewed 7120 times
Screenshot 2020-10-21 at 23.34.59.png
Screenshot 2020-10-21 at 23.34.59.png (223.43 KiB) Viewed 7120 times
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by burger »

1) sometimes choppy playback is an issue of TCP vs UDP, and switching to the other (usually UDP) will resolve it. You have UDP, so this is probably not it. But sometimes people will go to TCP.

2) You didn't mention what you are running this on. Is it an RPI, an x86-64 desktop, a toaster? I've seen smearing (I'd call what you are seeing smearing, not artifacts, but semantics...) when I have a stream that is too high res, and too fast for the device.

Last time I tested, it was an RPI that had issues smearing upon motion. While I didn't do it, the fix was the GPU_MEM fix here: https://wiki.zoneminder.com/Single_Board_Computers

Could also try increasing key frames on camera.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
mewald
Posts: 7
Joined: Wed Oct 21, 2020 8:05 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by mewald »

It's not a toaster. That much I can tell.

Code: Select all

$ cat /proc/cpuinfo | grep "model name"
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
model name	: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          31831        3839       20095          12        7895       27890
Swap:             0

$ fdisk -l
Disk /dev/nvme0n1: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO Plus 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 17D437B0-C178-4269-A6E0-846E5212ED4D

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme0n1p2 1050624 1953525134 1952474511  931G Linux filesystem
root@ratchet:~# lspci
00:00.0 Host bridge: Intel Corporation Device 9b51
00:02.0 VGA compatible controller: Intel Corporation Device 9bca (rev 04)
00:08.0 System peripheral: Intel Corporation Skylake Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Device 02f9
00:14.0 USB controller: Intel Corporation Device 02ed
00:14.2 RAM memory: Intel Corporation Device 02ef
00:14.3 Network controller: Intel Corporation Device 02f0
00:15.0 Serial bus controller [0c80]: Intel Corporation Device 02e8
00:15.2 Serial bus controller [0c80]: Intel Corporation Device 02ea
00:16.0 Communication controller: Intel Corporation Device 02e0
00:17.0 SATA controller: Intel Corporation Device 02d3
00:1c.0 PCI bridge: Intel Corporation Device 02bc (rev f0)
00:1d.0 PCI bridge: Intel Corporation Device 02b0 (rev f0)
00:1d.5 PCI bridge: Intel Corporation Device 02b5 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device 0284
00:1f.3 Audio device: Intel Corporation Device 02c8
00:1f.4 SMBus: Intel Corporation Device 02a3
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device 02a4
00:1f.6 Ethernet controller: Intel Corporation Device 0d4f
01:00.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] (rev 06)
02:00.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] (rev 06)
02:01.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] (rev 06)
02:02.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] (rev 06)
03:00.0 System peripheral: Intel Corporation JHL7540 Thunderbolt 3 NHI [Titan Ridge 2C 2018] (rev 06)
39:00.0 USB controller: Intel Corporation JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 2C 2018] (rev 06)
3a:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981
3b:00.0 SD Host controller: Genesys Logic, Inc Device 9755
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by burger »

It looks like you should be powerful enough to run 480p at a reasonable FPS. The next thing I'd say is narrow down the problem. Do you have any other cameras you can run at a comparable resolution and FPS to rule out that it isn't your hardware?

After that, since you have a Reolink, you should review this thread: viewtopic.php?f=10&t=25874&hilit=reolink which is the most popular for Reolink. Maybe there is some setting you can change. E.g. changing to source type: libvlc instead of ffmpeg on ZM might improve the stream quality, or you might change what stream path you are accessing on the camera. IIRC, some settings had better success than others, but read the thread. I don't remember exactly.

It's always possible there's something in the camera stream that ZM can't work with. Does this choppiness happen with ffmpeg from terminal, and vlc from gui? Look for errors in the output.* Are you running anything else on the hardware? (disable X, have a minimal system, don't run ZM in a virtual machine**, etc). Make sure you update to the latest stable release. 1.30.4 does not have the same camera compatibility*** that 1.34 has. So use 1.34, or whatever is the latest even numbered release.

*https://wiki.zoneminder.com/Ffmpeg has a flag for debug mode.
**if you are careful, I'd venture that you can run small installations on a VM, but generally it's bad practice. Large installations would be a bad idea, due to VM CPU overhead which I assume is slowdown. I don't know enough about VMs effect on CPU instructions to say 100% though. Docker / Containers are better for ZM.
*** Different ffmpeg libraries
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
mewald
Posts: 7
Joined: Wed Oct 21, 2020 8:05 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by mewald »

Ok, so lot's of settings to try. I'll have to take the time and brute force the right configuration then :D

But before I do that: I just realized, the screenshot I sent shows UDP. That must have been a mistake, because with UDP I am not getting any video. Only TCP seems to work. Could that be a limitation of the camera or might there be other reasons?
mewald
Posts: 7
Joined: Wed Oct 21, 2020 8:05 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by mewald »

Soooo, after lots of reading and just as much trial and error, I came up with this config that seems to work best:

Source Type: ffmpeg
Source Path: rtmp://10.0.0.165:1935/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=password
Method: UDP
Options: reorder_queue_size=5000,allowed_media_types=video,buffer_size=10000000
Capture Resolution: 640x480
Controllable: yes
Control Address: admin:password@10.0.0.165:8000
Auto Stop Timeout: 0.25

The high quality stream is "channel0_main", the low quality on "channnel0_sub". Strangely, the high quality channnel only works when I put the low quality resolution. So instead of 2560x1920 I need to put 640x480. That was a hard thing to find.

On the camera the following settings seem to provide the best results in ZM:

Clear Stream:
Resolution: 2560x1920
Frame Rate: 30
Maximum Bitrate: 6144
H2.64 Profile: Base

Fluent Stream:
Resolution: 640x480
Frame Rate: 7
Maximum Bitrate: 160
H2.64 Profile: Base

I hope that helps someone. What do I need to do to get this information into the HCL wiki?
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Re: Reolink RLC-423: Artifacts in RTSP Stream

Post by burger »

I added it quickly. Feel free to edit further, or make a single page for it.

To get a wiki acct see:
viewforum.php?f=13
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply