QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
257 stars 41 forks source link

Memory usage 0.6.2 #157

Closed jamesahendry closed 9 months ago

jamesahendry commented 9 months ago

Can I get you to check the mem growth in the scenario where you access both the SubSteam and Mainsteam? I use this in Frigate BTW. I have some of my cams that detect on the Mainsteam only due to the field of view and I've cut the cam up into different zones within Frigate. Other cams I use substeam to detect and mainstream to record. I am seeing vastly different memory growth when I am accessing both the sub and mainstreams compared to the mainstream only (which is 4K). The 4K only memory steam is very static - very consistent on 0.6.2. The sub/main combination is consistently growing and I run reboot on the Bullseye container when it gets close to 1GB. 1 cam per container. Here's the difference yesterday. I have 3 cams running mainsteam only and 3 cams running sub/main so the consistency is absolute based on the scenarios described. There's also an auto reboot at circa 4AM due to the memory issues. I could isolcate this by spinning up a new LXC and splitting the sub/main and test if you want? In this scenario the driveway cam is mainsteam only - courtyard sub/main. As you can see the Mainstream only is static at about 240mb of memory, the cams that use the sub and mainsteam are consistantly growing.

image image

jamesahendry commented 9 months ago

use_splash = false

I also reviewed my Frigate config and I was running the subStream detect in 3480 x 2160. It shouldn't have prevented the stream loading in VLCthrough. I'll try that

QuantumEntangledAndy commented 9 months ago

When it finishes building please try out this one

QuantumEntangledAndy commented 9 months ago

VLC is often difficult in the way it expects the timestamps to be presented. I swapped out some of the code for the previous iteration and also adjusted the time stamp calculations so hopefully it will work better now

QuantumEntangledAndy commented 9 months ago

With frigate though there seems to be something with frigate opening multiple client connctions. Not sure if this is by design on frigates end, but might be putting a bit of strain on neolink

jamesahendry commented 9 months ago

When it finishes building please try out this one

I can't even open the rtsp steam on this build. Both Frigate and VLC. Is there anything different about the steam name or anything?

Have tried rtsp://10.0.45.25:8554/courtyard rtsp://10.0.45.25:8554/mainSteam

The service is up and I can telnet to it on 8554. Have wound back to 0.6.2 no issues

image

QuantumEntangledAndy commented 9 months ago

Nope if I change anything major like that I'd let you know. A log file please, because I picture of the config tells me very little.

Also please be aware that:

bind = "0.0.0.0"
stream = "both" # Does nothing here remove it

[[cameras]]
name = "courtyard"
username = "admin"
password = ""
address = "10.0.45.87:9000"
stream = "mainStream" # correct location
user_splash = false

The log will tell you the possible paths when it says avaliable at

jamesahendry commented 9 months ago

Yeah I picked that up after I sent the mail and retried it

MicheleCardamone commented 9 months ago

When it finishes building please try out this one

HI! @QuantumEntangledAndy with this build i have this error Screenshot 2023-10-05 162836

QuantumEntangledAndy commented 9 months ago

This is very odd because a no reactor is a async Tokio error. But line 1085 is not any sort of async code in fact line 1085 and column 33 dosent exist in that build. So please send me the version string that's near the top of the log so I can check which has commit this was built with.

MicheleCardamone commented 9 months ago

This is very odd because a no reactor is a async Tokio error. But line 1085 is not any sort of async code in fact line 1085 and column 33 dosent exist in that build. So please send me the version string that's near the top of the log so I can check which has commit this was built with.

image

QuantumEntangledAndy commented 9 months ago

Do you by any chance get the H265 video stream?

QuantumEntangledAndy commented 9 months ago

Might have found it, please try this build

QuantumEntangledAndy commented 9 months ago

This build has an experimental pausing of the IFrame in it that I was working on. Might need tweaking as I think it is making video frames come in waves

MicheleCardamone commented 9 months ago
> neolink.log 2>&1

Hi @QuantumEntangledAndy tested. The Tokyo error seems to no longer exist but it doesn't work anyway: main and sub totally with fps out of limit. I can't attach the log as it is larger than 25mb Screenshot 2023-10-06 175136

MicheleCardamone commented 9 months ago

Hi! @QuantumEntangledAndy any update about this problem?

QuantumEntangledAndy commented 9 months ago

There are a few different problems in this thread and it is getting difficult to track. Since the original memory one seems solved perhaps we should close this and open a new one. You can however test this build which I have been working to make the stream simpiler and more reliable in vlc

MicheleCardamone commented 9 months ago

There are a few different problems in this thread and it is getting difficult to track. Since the original memory one seems solved perhaps we should close this and open a new one. You can however test this build which I have been working to make the stream simpiler and more reliable in vlc

I haven't had the opportunity to check whether the latest builds (after 0.6.2 master) have corrected the RAM problem, but from what the other user @jamesahendry posted I think so, but for now the only version I can use it's the 0.6.2 master that I have to restart every 12 hours, or 0.5.11 which always works but has the gstreamer errors .

QuantumEntangledAndy commented 9 months ago

Well when you have time please check this latest build and then open a new issue with anything you find in it. That will help me know what still needs to be addresed. For now closing as the memory seems to be addressed

QuantumEntangledAndy commented 9 months ago

This build please, just squashed one more bug raised in another issue