QuantumEntangledAndy / neolink

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

Camera work in 0.5.8 (high cpu usage after time). work randomly with v0.5.12 (or lower) #93

Closed Lacoste313 closed 11 months ago

Lacoste313 commented 1 year ago

Hello. I have setup 6 camera B800 (4K, H265 for main) and one RLC (5MP, H.264) with neolink and frigate.

Describe the bug If i use the 0.5.8 version. All camera work fine on startup. The problem are, the cpu usage increase with the time (100% in 2-3day)

When i update to a more recent update (buffer update), my camera on frigate and VLC work randomly at starting (same iif i wait 10 min after starting neolink). One time its "cuisine" camera work, when i restart no camera work, restart again, "jardin" camera work, and one time 1000, all camera work and show image in frigate or vlc.

To Reproduce Steps to reproduce the behavior. Example:

  1. Create this configuration file:
    
    [[cameras]]
    name = "Entree"
    username = "user"
    password = ""
    address = "192.168.X"
    stream = "both"

[[cameras]] name = "Salon" username = "user" password = "" address = "192.168.X stream = "both"

[[cameras]] name = "Cuisine" username = "user" password = "" address = "192.168.X" stream = "both"

[[cameras]] name = "Buanderie" username = "user" password = "" address = "192.168.X" stream = "both"

[[cameras]] name = "Jardin" username = "user" password = "" address = "192.168.X" stream = "both"

[[cameras]] name = "Piscine" username = "user" password = "" address = "192.168.X" stream = "both"

3. Launch Neolink: with docker compose
4. buffer ready:

[2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Entree: Camera reports firmware version v3.0.0.183_21012800 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Entree: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Entree: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Piscine: Camera reports firmware version v3.0.0.183_21012800 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Piscine: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Piscine: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Cuisine: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Cuisine: Camera reports firmware version v3.0.0.183_21012800 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Cuisine: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Cuisine: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Salon: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Buanderie: Camera reports firmware version v3.0.0.183_21012800 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Buanderie: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Buanderie: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Salon: Camera reports firmware version v3.0.0.183_21012800 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Salon: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Salon: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Jardin: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::loggedin] Jardin: Camera reports firmware version v3.0.0.142_20121803 [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Jardin: Starting video stream Main Stream (Clear) [2023-05-26T20:25:10Z INFO neolink::rtsp::states::streaming] Jardin: Starting video stream Sub Stream (Fluent) [2023-05-26T20:25:20Z INFO neolink::rtsp] Cuisine: Buffers prepared [2023-05-26T20:25:20Z INFO neolink::rtsp] Piscine: Buffers prepared [2023-05-26T20:25:20Z INFO neolink::rtsp] Buanderie: Buffers prepared [2023-05-26T20:25:20Z INFO neolink::rtsp] Salon: Buffers prepared [2023-05-26T20:25:20Z INFO neolink::rtsp] Entree: Buffers prepared [2023-05-26T20:25:20Z INFO neolink::rtsp] Jardin: Buffers prepared

5. Launch frigate: with docker compose
6. no frame received
<img width="686" alt="Capture d’écran 2023-05-26 à 22 27 33" src="https://github.com/QuantumEntangledAndy/neolink/assets/99512636/76e66821-79c7-46c5-8d4a-9142a7f413b0">

7. logs frigate:

2023-05-26 22:26:23.119704428 [INFO] Starting Frigate... 2023-05-26 22:26:30.413070376 [2023-05-26 22:26:30] frigate.app INFO : Starting Frigate (0.12.0-da3e197) 2023-05-26 22:26:30.491846516 [2023-05-26 22:26:30] peewee_migrate INFO : Starting migrations 2023-05-26 22:26:30.515207452 [2023-05-26 22:26:30] peewee_migrate INFO : There is nothing to migrate 2023-05-26 22:26:30.535435355 [2023-05-26 22:26:30] detector.coral INFO : Starting detection process: 435 2023-05-26 22:26:30.536036075 [2023-05-26 22:26:30] frigate.app INFO : Output process started: 437 2023-05-26 22:26:30.539774426 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Entree: 440 2023-05-26 22:26:30.542857234 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Salon: 442 2023-05-26 22:26:30.545865444 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Cuisine: 443 2023-05-26 22:26:30.549025282 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Buanderie: 444 2023-05-26 22:26:30.551962050 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Jardin: 445 2023-05-26 22:26:30.555082361 [2023-05-26 22:26:30] frigate.app INFO : Camera processor started for Piscine: 446 2023-05-26 22:26:30.558137732 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Entree: 447 2023-05-26 22:26:30.558341715 [2023-05-26 22:26:30] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-05-26 22:26:30.561435765 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Salon: 453 2023-05-26 22:26:30.564415084 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Cuisine: 455 2023-05-26 22:26:30.567664458 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Buanderie: 459 2023-05-26 22:26:30.571083965 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Jardin: 463 2023-05-26 22:26:30.577745897 [2023-05-26 22:26:30] frigate.app INFO : Capture process started for Piscine: 468 2023-05-26 22:26:33.828220987 [2023-05-26 22:26:33] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found 2023-05-26 22:26:36.595482315 [2023-05-26 22:26:36] frigate.video ERROR : Entree: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.595660857 [2023-05-26 22:26:36] frigate.video ERROR : Entree: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:36.595743148 [2023-05-26 22:26:36] frigate.video ERROR : Cuisine: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.595817193 [2023-05-26 22:26:36] frigate.video ERROR : Salon: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.595887479 [2023-05-26 22:26:36] frigate.video ERROR : Cuisine: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:36.595955069 [2023-05-26 22:26:36] frigate.video ERROR : Salon: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:36.596021256 [2023-05-26 22:26:36] frigate.video ERROR : Piscine: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.596125500 [2023-05-26 22:26:36] frigate.video ERROR : Piscine: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:36.597196682 [2023-05-26 22:26:36] frigate.video ERROR : Buanderie: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.597295559 [2023-05-26 22:26:36] frigate.video ERROR : Buanderie: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:36.597512344 [2023-05-26 22:26:36] frigate.video ERROR : Jardin: Unable to read frames from ffmpeg process. 2023-05-26 22:26:36.597623097 [2023-05-26 22:26:36] frigate.video ERROR : Jardin: ffmpeg process is not running. exiting capture thread... 2023-05-26 22:26:50.635684119 [2023-05-26 22:26:50] watchdog.Salon ERROR : Ffmpeg process crashed unexpectedly for Salon. 2023-05-26 22:26:50.635796105 [2023-05-26 22:26:50] watchdog.Salon ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-05-26 22:26:50.635887587 [2023-05-26 22:26:50] ffmpeg.Salon.detect ERROR : rtsp://192.168.X/Salon/substream: Invalid data found when processing input 2023-05-26 22:26:50.639875830 [2023-05-26 22:26:50] watchdog.Jardin ERROR : Ffmpeg process crashed unexpectedly for Jardin. 2023-05-26 22:26:50.639998437 [2023-05-26 22:26:50] watchdog.Jardin ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-05-26 22:26:50.640102296 [2023-05-26 22:26:50] ffmpeg.Jardin.detect ERROR : rtsp://192.168.X/Jardin/mainstream: Invalid data found when processing input 2023-05-26 22:26:50.641648687 [2023-05-26 22:26:50] watchdog.Cuisine ERROR : Ffmpeg process crashed unexpectedly for Cuisine. 2023-05-26 22:26:50.641790818 [2023-05-26 22:26:50] watchdog.Cuisine ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-05-26 22:26:50.641928290 [2023-05-26 22:26:50] ffmpeg.Cuisine.detect ERROR : rtsp://192.168.X/Cuisine/substream: Invalid data found when processing input 2023-05-26 22:26:50.644343800 [2023-05-26 22:26:50] ffmpeg.Salon.record ERROR : rtsp://192.168.X/Salon/mainstream: Invalid data found when processing input 2023-05-26 22:26:50.644663288 [2023-05-26 22:26:50] watchdog.Salon INFO : Terminating the existing ffmpeg process... 2023-05-26 22:26:50.644799267 [2023-05-26 22:26:50] watchdog.Salon INFO : Waiting for ffmpeg to exit gracefully... 2023-05-26 22:26:50.646371861 [2023-05-26 22:26:50] watchdog.Entree ERROR : Ffmpeg process crashed unexpectedly for Entree. 2023-05-26 22:26:50.649682653 [2023-05-26 22:26:50] watchdog.Piscine ERROR : Ffmpeg process crashed unexpectedly for Piscine. 2023-05-26 22:26:50.649694277 [2023-05-26 22:26:50] watchdog.Buanderie ERROR : Ffmpeg process crashed unexpectedly for Buanderie. 2023-05-26 22:26:50.649700568 [2023-05-26 22:26:50] watchdog.Buanderie ERROR : The following ffmpeg logs include the last 100 lines prior to exit.


The error lines after "TPU found" flood the log after that.

**Expected behavior**
supposed to show video 

**Versions**
NVR software: i dont pass by the nvr
Neolink software: latest
Reolink camera model and firmware: latest

So i reapeat, when i use the 0.5.8, all work fine, exept the CPU overloading with the time.
Lacoste313 commented 1 year ago

so, strangely, now after the reboot, i get the image for all camera in frigate and stop show error in log.

but i get this error in neolink logs:

[2023-05-26T20:25:20Z INFO  neolink::rtsp] Cuisine: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Piscine: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Buanderie: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Salon: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Entree: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Jardin: Buffers prepared

(neolink:7): GStreamer-WARNING **: 22:27:56.390: free_priv_data: object finalizing but still has 1 parents (object:0x7efdd47c2ea0)

(neolink:7): GStreamer-CRITICAL **: 22:27:56.390: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:27:56.469: free_priv_data: object finalizing but still has 1 parents (object:0x7efdbc0bd360)

(neolink:7): GStreamer-WARNING **: 22:28:45.549: free_priv_data: object finalizing but still has 1 parents (object:0x7efdcc2b7d80)

(neolink:7): GStreamer-WARNING **: 22:28:45.549: free_priv_data: object finalizing but still has 1 parents (object:0x7efdcc67e000)

(neolink:7): GStreamer-WARNING **: 22:28:45.590: free_priv_data: object finalizing but still has 1 parents (object:0x7efdd02cc240)

(neolink:7): GStreamer-CRITICAL **: 22:28:45.590: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:30:08.189: free_priv_data: object finalizing but still has 1 parents (object:0x7efdd463d240)

(neolink:7): GStreamer-WARNING **: 22:30:08.189: free_priv_data: object finalizing but still has 1 parents (object:0x7efdd469db40)

(neolink:7): GStreamer-WARNING **: 22:30:08.230: free_priv_data: object finalizing but still has 1 parents (object:0x7efdb4274480)

(neolink:7): GStreamer-CRITICAL **: 22:30:08.230: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:30:32.070: free_priv_data: object finalizing but still has 1 parents (object:0x7efdc406a6c0)

(neolink:7): GStreamer-WARNING **: 22:30:32.070: free_priv_data: object finalizing but still has 1 parents (object:0x7efdcc1d5360)

(neolink:7): GStreamer-WARNING **: 22:30:32.150: free_priv_data: object finalizing but still has 1 parents (object:0x7efd4805ed80)

(neolink:7): GStreamer-WARNING **: 22:30:32.150: free_priv_data: object finalizing but still has 1 parents (object:0x7efce40165a0)

(neolink:7): GStreamer-WARNING **: 22:31:57.470: free_priv_data: object finalizing but still has 1 parents (object:0x7efd480e8000)

(neolink:7): GStreamer-CRITICAL **: 22:31:57.470: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:31:57.510: free_priv_data: object finalizing but still has 1 parents (object:0x7efd48101240)

(neolink:7): GStreamer-CRITICAL **: 22:31:57.511: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:31:57.590: free_priv_data: object finalizing but still has 1 parents (object:0x7efd48163480)

(neolink:7): GStreamer-CRITICAL **: 22:31:57.590: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:31:57.630: free_priv_data: object finalizing but still has 1 parents (object:0x7efdd43036c0)

(neolink:7): GStreamer-CRITICAL **: 22:31:57.632: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:32:23.470: free_priv_data: object finalizing but still has 1 parents (object:0x7efd480a8000)

(neolink:7): GStreamer-CRITICAL **: 22:32:23.470: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(neolink:7): GStreamer-WARNING **: 22:32:23.510: free_priv_data: object finalizing but still has 1 parents (object:0x7efdb4274360)

(neolink:7): GStreamer-CRITICAL **: 22:32:23.511: gst_mini_object_unref: assertion 'mini_object != NULL' failed

And if i reboot, iam sure i need to reboot 100 time for making all camera working again

any idea? thanks

QuantumEntangledAndy commented 1 year ago

I can't really tell from the logs and I'm not really able to replicate so I really don't know.

Your second set of errors from gstreamer aren't errors. Those are normal messages for when a media stream is dropped. We test if a media is live in gatreamer by trying to use the media if it errors then we know that the connection has closed if not then we know we can send data to the media.

QuantumEntangledAndy commented 1 year ago

Can you test maybe one camera at a time and also test via other methods like ffplay. Can we stream in ffplay but not frigate etc.

QuantumEntangledAndy commented 1 year ago

If we get the buffers prepared message it means that there are at least 66 frames ready to send to any client that asks for it. It's a little odd that frigate says nothing is comming though. Could you also send your docker-compose and frigate config?

QuantumEntangledAndy commented 1 year ago

Also do you have gst_debug set in that first log you sent. If so then no connection was made from frigate to gstreamer at all. If that's the case I'd like to see what sort of network you setup in compose and what you do to connect. Are you using the link keyword in the compose for example. Do you use fixed up addresses in frigate things like that.

Lacoste313 commented 1 year ago

Thanks for the reply.

i forgot to specify, i have already set the bitratee of the camera at min (4096 for the 4K).

I can't really tell from the logs and I'm not really able to replicate so I really don't know.

Your second set of errors from gstreamer aren't errors. Those are normal messages for when a media stream is dropped. We test if a media is live in gatreamer by trying to use the media if it errors then we know that the connection has closed if not then we know we can send data to the media.

Yep i understand, random problem are hardto fix :/

So that make sens for the second line error, if show only when all working fine. I remember that

Can you test maybe one camera at a time and also test via other methods like ffplay. Can we stream in ffplay but not frigate etc.

Let me the time to modify all config file for only one camera and try this and post my config + compose for frigate and neolink

If we get the buffers prepared message it means that there are at least 66 frames ready to send to any client that asks for it. It's a little odd that frigate says nothing is comming though.

yes, and i have the same on VLC, just ethernal loading

Also do you have gst_debug set in that first log you sent. If so then no connection was made from frigate to gstreamer at all. If that's the case I'd like to see what sort of network you setup in compose and what you do to connect. Are you using the link keyword in the compose for example. Do you use fixed up addresses in frigate things like that.

I dont have gst_debug set in the first log. How i can set it ?

I dont have link in my compose. I just use a camera network, with frigate and neolink in. No fixed ip for the contenainer but for my server yes. I use this fixed IP with the exposed port of concerned service.

I post my enterly config in same time. just need to modify some confidential setting.

thanks

Lacoste313 commented 1 year ago

For neolink: docker-compose.yaml (i use .env file)

version: "3.3"

networks:
  default:
    name: ${NETWORK}
    external: ${EXTERNAL}

services:
  service:
    image: ${IMAGE}:${VERSION}
    container_name: ${NAME}
    user: ${USER}
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    ports:
      - ${PORT}:8554
    volumes:
      - ${CONFIG_DIR}:/etc/neolink.toml 
    labels:
      - wud.watch=${WUD_WATCH}
      - wud.display.name=${NAME}
      - wud.display.icon=${WUD_ICON}
      - wud.tag.include=${WUD_TAG}
      - wud.link.template=${WUD_LINK}
    restart: ${RESTART}

.env

###  Global Conf 
TZ=Europe/Brussels
CONFIG_DIR=./config/neolink.toml
RESTART=unless-stopped
DOCK_SOCK=/var/run/docker.sock

### User 
PUID=XXX  
PGID=YYY
USER=XXX:YYY

### Image conf 
IMAGE=quantumentangledandy/neolink
# VERSION=0.5.8
VERSION=v0.5.12
NAME=neolink
PORT=8554

### Network
NETWORK=camera  
EXTERNAL=true  

### Label conf
# wud
WUD_WATCH=true 
WUD_TAG=^v\d+\.\d+\.\d+ 
WUD_ICON=
WUD_LINK=https://github.com/QuantumEntangledAndy/neolink/releases/tag/v$${major}.$${minor}.$${patch} 

the config.toml with one camera:

[[cameras]]
name = "Entree"
username = "USER"
password = "PASS"
address = "192.168.2.11:9000" # fixed IP for the camera in second VLAN
stream = "both"
# rtsp://192.168.1.11:8554/Entree/mainstream 

For frigate: docker-compose.yaml:

version: "3.3"

networks:
  default:
    name: ${NETWORK}
    external: ${EXTERNAL}

services:
  service:
    image: ${IMAGE}:${VERSION}
    container_name: ${NAME}
    privileged: true
    hostname: "frigate"
    shm_size: "1024mb"
    devices:
      - "/dev/dri/renderD128" # for intel hwaccel
      - "/dev/bus/usb:/dev/bus/usb" # passes the USB Coral, needs to be modified for other versions
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    ports:
      - ${PORT}:5000
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${CONFIG_DIR}:/db 
      - ${CONFIG_FILE}:/config/config.yml:ro
      - ${RECORD_DIR}:/media/frigate:rw
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: "900mb"
    labels:
      - wud.watch=${WUD_WATCH}
      - wud.display.name=${NAME}
      - wud.display.icon=${WUD_ICON}
      - wud.tag.include=${WUD_TAG}
      - wud.link.template=${WUD_LINK}
    restart: ${RESTART}

.env file:

###  Global Conf 
TZ=Europe/Brussels
RESTART=unless-stopped
DOCK_SOCK=/var/run/docker.sock

### User 
PUID=XXX 
PGID=YYY

### Image conf 
IMAGE=ghcr.io/blakeblackshear/frigate
VERSION=0.12.0
NAME=frigate
PORT=8001

### Volume
CONFIG_DIR=./config
CONFIG_FILE=./config/config.yml
RECORD_DIR=/volume3/Camera

### Network
NETWORK=camera  
EXTERNAL=true 

### Label conf
# wud
WUD_WATCH=true
WUD_TAG=^v\d+\.\d+\.\d+ 
WUD_ICON=
WUD_LINK=https://github.com/blakeblackshear/frigate/releases/tag/v$${major}.$${minor}.$${patch} 

config.yaml:

# ANCHOR MQTT
mqtt:
 host: SERVER_IP
 port: PORT
 user: USER
 password: PASS

# ANCHOR DETECTOR
detectors:
  coral:
    type: edgetpu
    device: usb

# ANCHOR DB
database:
  path: /media/frigate/frigate.db

# ANCHOR CAMERA
cameras:
# STUB ENTREE
  Entree:
    ui:
      order: 3
    ffmpeg:
      # hwaccel_args: -c:v hevc
      inputs:
        - path: rtsp://192.168.1.11:8554/Entree/mainstream
          roles:
            - record
        - path: rtsp://192.168.1.11:8554/Entree/substream 
          roles:
            - detect
    rtmp:
      enabled: False 
    record:
      enabled: True
      retain:
        days: 7
        mode: all
      events:
        objects:
          - person
        retain:
          default: 20
          mode: active_objects
    detect:
      enabled: True
      width: 640 
      height: 360 
      fps: 7
    snapshots: 
      enabled: True
        # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
    objects:
      track:
        - person
        - cat
        - dog
      filters:
        person:
          threshold: 0.79
          mask: 576,313,604,254,640,251,640,360,508,360,511,285
        cat:
          threshold: 0.7
        dog:
          threshold: 0.74

The docker network: docker network create --driver bridge --ipv6=false --subnet=172.28.2.0/24 --gateway=172.28.2.1 camera

That's all my conf.

Lacoste313 commented 1 year ago

exactly the same problem with only one camera 4K.

neolink logs:

[2023-05-27T13:02:17Z INFO  neolink] Neolink 384a0271bdbcf3227d4160859c052e8c1cb9d1f8 release
[2023-05-27T13:02:17Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-05-27T13:02:17Z INFO  neolink_core::bc_protocol] Entree: Trying TCP discovery
[2023-05-27T13:02:17Z INFO  neolink_core::bc_protocol] Entree: TCP Discovery success at 192.168.2.11:9000
[2023-05-27T13:02:17Z INFO  neolink::rtsp::states::loggedin] Entree: Camera time is already set: 2023-05-27 15:02:19.0 -01:00:00
[2023-05-27T13:02:17Z INFO  neolink::rtsp::states::loggedin] Entree: Camera reports firmware version v3.0.0.183_21012800
[2023-05-27T13:02:17Z INFO  neolink::rtsp::states::streaming] Entree: Starting video stream Main Stream (Clear)
[2023-05-27T13:02:17Z INFO  neolink::rtsp::states::streaming] Entree: Starting video stream Sub Stream (Fluent)
[2023-05-27T13:02:27Z INFO  neolink::rtsp] Entree: Buffers prepared

frigate:

2023-05-27 15:02:34.614379217  [INFO] Starting Frigate...
2023-05-27 15:02:42.216821746  [2023-05-27 15:02:42] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-05-27 15:02:42.254957235  [2023-05-27 15:02:42] peewee_migrate                 INFO    : Starting migrations
2023-05-27 15:02:42.270330932  [2023-05-27 15:02:42] peewee_migrate                 INFO    : There is nothing to migrate
2023-05-27 15:02:42.274153142  [2023-05-27 15:02:42] frigate.comms.dispatcher       ERROR   : Received invalid set command: Entree/recordings/set
2023-05-27 15:02:42.274479828  [2023-05-27 15:02:42] frigate.comms.dispatcher       ERROR   : Received invalid set command: Entree/snapshots/set
2023-05-27 15:02:42.324130734  [2023-05-27 15:02:42] detector.coral                 INFO    : Starting detection process: 434
2023-05-27 15:02:42.324272229  [2023-05-27 15:02:42] frigate.app                    INFO    : Output process started: 435
2023-05-27 15:02:42.327596278  [2023-05-27 15:02:42] frigate.app                    INFO    : Camera processor started for Entree: 439
2023-05-27 15:02:42.331105977  [2023-05-27 15:02:42] frigate.app                    INFO    : Capture process started for Entree: 441
2023-05-27 15:02:42.359654224  [2023-05-27 15:02:42] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-05-27 15:02:45.467016184  [2023-05-27 15:02:45] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-05-27 15:02:48.174111941  [2023-05-27 15:02:48] frigate.video                  ERROR   : Entree: Unable to read frames from ffmpeg process.
2023-05-27 15:02:48.174260937  [2023-05-27 15:02:48] frigate.video                  ERROR   : Entree: ffmpeg process is not running. exiting capture thread...
2023-05-27 15:03:02.398358905  [2023-05-27 15:03:02] watchdog.Entree                ERROR   : Ffmpeg process crashed unexpectedly for Entree.
2023-05-27 15:03:02.398478733  [2023-05-27 15:03:02] watchdog.Entree                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-27 15:03:02.400585839  [2023-05-27 15:03:02] ffmpeg.Entree.detect           ERROR   : rtsp://192.168.1.11:8554/Entree/substream: Invalid data found when processing input
2023-05-27 15:03:02.403581017  [2023-05-27 15:03:02] ffmpeg.Entree.record           ERROR   : rtsp://192.168.1.11:8554/Entree/mainstream: Invalid data found when processing input
2023-05-27 15:03:02.403695449  [2023-05-27 15:03:02] watchdog.Entree                INFO    : Terminating the existing ffmpeg process...
2023-05-27 15:03:02.405876593  [2023-05-27 15:03:02] watchdog.Entree                INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-27 15:03:09.060663245  [2023-05-27 15:03:09] frigate.video                  ERROR   : Entree: Unable to read frames from ffmpeg process.
2023-05-27 15:03:09.060775257  [2023-05-27 15:03:09] frigate.video                  ERROR   : Entree: ffmpeg process is not running. exiting capture thread...
2023-05-27 15:03:12.410258341  [2023-05-27 15:03:12] watchdog.Entree                ERROR   : Ffmpeg process crashed unexpectedly for Entree.
2023-05-27 15:03:12.410344283  [2023-05-27 15:03:12] watchdog.Entree                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-27 15:03:12.410421415  [2023-05-27 15:03:12] ffmpeg.Entree.detect           ERROR   : rtsp://192.168.1.11:8554/Entree/substream: Invalid data found when processing input
2023-05-27 15:03:12.415199832  [2023-05-27 15:03:12] ffmpeg.Entree.record           ERROR   : rtsp://192.168.1.11:8554/Entree/mainstream: Invalid data found when processing input
2023-05-27 15:03:12.415328237  [2023-05-27 15:03:12] watchdog.Entree                INFO    : Terminating the existing ffmpeg process...
2023-05-27 15:03:12.415495026  [2023-05-27 15:03:12] watchdog.Entree                INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-27 15:03:17.522803986  [2023-05-27 15:03:17] frigate.video                  ERROR   : Entree: Unable to read frames from ffmpeg process.
2023-05-27 15:03:17.522922993  [2023-05-27 15:03:17] frigate.video                  ERROR   : Entree: ffmpeg process is not running. exiting capture thread...
2023-05-27 15:03:22.417575095  [2023-05-27 15:03:22] watchdog.Entree                ERROR   : Ffmpeg process crashed unexpectedly for Entree.
2023-05-27 15:03:22.417722702  [2023-05-27 15:03:22] watchdog.Entree                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-27 15:03:22.419865555  [2023-05-27 15:03:22] ffmpeg.Entree.detect           ERROR   : rtsp://192.168.1.11:8554/Entree/substream: Invalid data found when processing input
2023-05-27 15:03:22.422672093  [2023-05-27 15:03:22] ffmpeg.Entree.record           ERROR   : rtsp://192.168.1.11:8554/Entree/mainstream: Invalid data found when processing input
2023-05-27 15:03:22.422787074  [2023-05-27 15:03:22] watchdog.Entree                INFO    : Terminating the existing ffmpeg process...
2023-05-27 15:03:22.422900674  [2023-05-27 15:03:22] watchdog.Entree                INFO    : Waiting for ffmpeg to exit gracefully...

work randomly at staring one time i get the image, another time no, another time i need to wait 5 min to get the image in frigate

I go to search to set gst_debug and post log after thats.

with VLC (frigate stoped and neolink restarted) rtsp://192.168.1.11:8554/Entree/mainstream i get the stream all time now with one camera but, i need to wait relatively long time (approx 30 sec) to showing up (buffer prepared before i try to join the stream)

QuantumEntangledAndy commented 1 year ago

Waiting a long time for buffer prepared is to be expected for such a high nitrate like this. A lot of data needs to be transmitted before we recieve enough frames. You can try reducing the buffer size by adding buffer_size = 50 into the [[cameras]] part of the config.

Also are these frigate errors the ones you get before buffers ready message. Before the buffer ready message we send a dummy stream (since we cannot know the stream parameters yet). This dummy stream ends after 500 frames and and is expected to give you this error at that time.

QuantumEntangledAndy commented 11 months ago

Closing because I think this is addressed in latest, but if not please re-open