QuantumEntangledAndy / neolink

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

Are these errors normal in Frigate? And how is camera battery getting depleted? #87

Closed anthonws closed 1 year ago

anthonws commented 1 year ago

Are these errors from Frigate expected? I got the idea that you implemented fake frames to be presented by neolink, so that when the camera stream was paused, clients connected to it would not have issues and the stream would show the last captured frame (hopefully I haven't understood it incorrectly).

2023-05-19 21:11:39.909072933  [2023-05-19 21:11:39] watchdog.tapas_balcony         INFO    : No frames received from tapas_balcony in 20 seconds. Exiting ffmpeg...
2023-05-19 21:11:39.909372421  [2023-05-19 21:11:39] watchdog.tapas_balcony         INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-19 21:11:41.032179980  21:11:41.031 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:159 > error="read tcp 172.18.0.2:42462->192.168.1.10:8889: i/o timeout" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-05-19 21:11:42.908109026  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.908116357  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.922360692  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.922368023  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: ffmpeg process is not running. exiting capture thread...
2023-05-19 21:11:45.510840994  [2023-05-19 21:11:45] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-05-19 21:11:45.511621542  [2023-05-19 21:11:45] frigate.record                 ERROR   : list index out of range
2023-05-19 21:11:50.414896782  [2023-05-19 21:11:50] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-05-19 21:11:50.414904211  [2023-05-19 21:11:50] frigate.record                 ERROR   : list index out of range
2023-05-19 21:11:52.918571035  [2023-05-19 21:11:52] watchdog.tapas_balcony         ERROR   : Ffmpeg process crashed unexpectedly for tapas_balcony.
2023-05-19 21:11:52.918578224  [2023-05-19 21:11:52] watchdog.tapas_balcony         ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-19 21:11:52.918580537  [2023-05-19 21:11:52] ffmpeg.tapas_balcony.detect    ERROR   : [rtsp @ 0x5636b28ba100] RTP: PT=60: bad cseq 637b expected=336f

Also, given the configuration for my battery camera, if no detection is triggered, the camera stream is paused. But the camera battery gotten to very low values (< 10%). What should be the optimal configuration for both camera and neolink?

''' bind = "0.0.0.0" bind_port = 8889

[[cameras]] name = "tapas_balcony" username = "MYUSER" password = "MYPASS" uid = "MYUID" stream = "subStream" [cameras.pause] on_motion = true on_client = true mode = "none" timeout = 2.1 '''

For the camera config, I have activated, via the Android app, PIR with low sensitivity.

I have checked push notifications as a debug mechanism to see if the camera would be triggering motion events, but it hasn't, which is why I am finding it odd that the battery depleted almost completely (in a full sunny environment).

Cheers, anthonws.

EDIT:

FYI, as a test, I've updated Frigate's go2RTC version to 15.0. But nothing changed.

https://github.com/AlexxIT/go2rtc/releases/tag/v1.5.0

QuantumEntangledAndy commented 1 year ago

Ok lots of questions but I'll try and answer:

| Are these errors from Frigate expected?

Depends, if that is at the start before the buffers are prepared then yes. There is a period after startup of neolink before we connect and get enough frames to work out the stream format that will cause issues in frigate.

| I got the idea that you implemented fake frames to be presented by neolink, so that when the camera stream was paused, clients connected to it would not have issues and the stream would show the last captured frame

This is a difficult one. I tried a couple of different approaches and it's not possible to just make up new fake frames without doing a decode and encode of the video. Instead what we do is keep the last few seconds of video. When a new client appears we send them this video so that the client can workout the format/size to display then we just stop sending frames. Some clients will drop the stream if there are no new frames while others will wait. If you want to wait for frames you will have to configure your client

| Also, given the configuration for my battery camera, if no detection is triggered, the camera stream is paused. But the camera battery gotten to very low values

Pausing is not a true pause. We stop pulling video frames which reduces the battery load BUT we don't fully disconnect, as we need to stay connected to listen to motion requests.

There is on-going work to listen to the push notifications instead then logout but its not done yet.

| What should be the optimal configuration for both camera and neolink?

Given config is fine, not much else that can be done to imporve battery until the push notification feature is in

Anything else you want to discuss?