blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.46k stars 1.68k forks source link

[Config Support]: Second identical camera has green screen #7442

Closed Surfingjelly closed 1 year ago

Surfingjelly commented 1 year ago

Describe the problem you are having

Hi,

I recently added a second Reolink 520a camera to Frigate (the Living Room Cam below), replicating the original config for the first fully working cam (the nursery cam). However the 'MSE' stream on the living room cam shows a solid green screen, whereas the Nursery Cam is working.

I'm conscious the links for the go2rtc section aren't set up correctly for my use with Home Assistant, but this wasn't hindering the original working cam.

Oddly the errors in the logs relate to the nursery cam, but that remains working- recording events correctly, can see the live stream etc.

Edit: Interestingly, the camera switching to night mode has made it a bit better - only part of the screen is green, and only sometimes. There's a lot of smearing of the stream though.

Version

0.12.1-367D724

Frigate config file

mqtt:
  enabled: true
  host: ip_address
  user: xxxxx
  password: xxxxx

detectors:
  coral:
    type: edgetpu
    device: pci:0

ffmpeg:
  hwaccel_args: preset-vaapi
  output_args:
    record: preset-record-generic-audio-aac

detect:
  enabled: true # <---- disable detection until you have a working camera feed
  width: 640 # <---- update for your camera's resolution
  height: 480 # <---- update for your camera's resolution

record:
  enabled: true
  retain:
    days: 2
    mode: all
  events:
    retain:
      default: 7
      mode: motion

go2rtc:
  streams:
    nursery_cam: 
      - rtsp://user:pword@ip_address:port/h264Preview_01_main
      - "ffmpeg:reolink#audio=opus"
    nursery_cam_sub: 
      - rtsp://user:pword@ip_address:port/h264Preview_01_sub
    living_room_cam: 
      - rtsp://user:pword@ip_address:port/h264Preview_01_main
      - "ffmpeg:reolink#audio=opus"
    living_room_cam_sub: 
      - rtsp://user:pword@ip_address:port/h264Preview_01_sub

cameras:
  nursery_cam:
    ffmpeg:
      inputs:
        - path: rtsp://user:pword@ip_address:port/h264Preview_01_main
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://user:pword@ip_address:port/h264Preview_01_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

  living_room_cam:
    ffmpeg:
      inputs:
        - path: rtsp://user:pword@ip_address:port/h264Preview_01_main
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://user:pword@ip_address:port/h264Preview_01_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

objects:
  track:
    - person
    - dog

Relevant log output

2023-08-10 20:25:23.664983023  [INFO] Starting Frigate...
2023-08-10 20:25:24.706303535  [2023-08-10 20:25:24] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-10 20:25:24.727060165  [2023-08-10 20:25:24] peewee_migrate                 INFO    : Starting migrations
2023-08-10 20:25:24.731308400  [2023-08-10 20:25:24] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-10 20:25:24.747331281  [2023-08-10 20:25:24] detector.coral                 INFO    : Starting detection process: 288
2023-08-10 20:25:24.754532470  [2023-08-10 20:25:24] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as pci:0
2023-08-10 20:25:24.760668161  [2023-08-10 20:25:24] frigate.app                    INFO    : Output process started: 290
2023-08-10 20:25:24.760675125  [2023-08-10 20:25:24] frigate.app                    INFO    : Camera processor started for nursery_cam: 308
2023-08-10 20:25:24.764303238  [2023-08-10 20:25:24] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-08-10 20:25:24.769888660  [2023-08-10 20:25:24] frigate.app                    INFO    : Camera processor started for living_room_cam: 310
2023-08-10 20:25:24.777288248  [2023-08-10 20:25:24] frigate.app                    INFO    : Capture process started for nursery_cam: 312
2023-08-10 20:25:24.787955366  [2023-08-10 20:25:24] frigate.app                    INFO    : Capture process started for living_room_cam: 314
2023-08-10 20:25:30.069651266  [2023-08-10 20:25:30] frigate.video                  ERROR   : nursery_cam: Unable to read frames from ffmpeg process.
2023-08-10 20:25:30.070262799  [2023-08-10 20:25:30] frigate.video                  ERROR   : nursery_cam: ffmpeg process is not running. exiting capture thread...
2023-08-10 20:25:44.859038640  [2023-08-10 20:25:44] watchdog.nursery_cam           ERROR   : Ffmpeg process crashed unexpectedly for nursery_cam.
2023-08-10 20:25:44.859563755  [2023-08-10 20:25:44] watchdog.nursery_cam           ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-10 20:25:44.860101012  [2023-08-10 20:25:44] ffmpeg.nursery_cam.detect      ERROR   : [rtsp @ 0x55ca1d229e40] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2023-08-10 20:25:44.860700772  [2023-08-10 20:25:44] ffmpeg.nursery_cam.detect      ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-10 20:25:44.861258141  [2023-08-10 20:25:44] ffmpeg.nursery_cam.detect      ERROR   : Output file #0 does not contain any stream
2023-08-10 20:25:50.106014859  [2023-08-10 20:25:50] frigate.video                  ERROR   : nursery_cam: Unable to read frames from ffmpeg process.
2023-08-10 20:25:50.106426879  [2023-08-10 20:25:50] frigate.video                  ERROR   : nursery_cam: ffmpeg process is not running. exiting capture thread...
2023-08-10 20:25:54.886500999  [2023-08-10 20:25:54] watchdog.nursery_cam           ERROR   : Ffmpeg process crashed unexpectedly for nursery_cam.
2023-08-10 20:25:54.886882638  [2023-08-10 20:25:54] watchdog.nursery_cam           ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-10 20:25:54.887360976  [2023-08-10 20:25:54] ffmpeg.nursery_cam.detect      ERROR   : [rtsp @ 0x560096365e40] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2023-08-10 20:25:54.887720066  [2023-08-10 20:25:54] ffmpeg.nursery_cam.detect      ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-10 20:25:54.888052305  [2023-08-10 20:25:54] ffmpeg.nursery_cam.detect      ERROR   : Output file #0 does not contain any stream
2023-08-10 20:26:00.146505871  [2023-08-10 20:26:00] frigate.video                  ERROR   : nursery_cam: Unable to read frames from ffmpeg process.
2023-08-10 20:26:00.146647778  [2023-08-10 20:26:00] frigate.video                  ERROR   : nursery_cam: ffmpeg process is not running. exiting capture thread...
2023-08-10 20:26:04.908875355  [2023-08-10 20:26:04] watchdog.nursery_cam           ERROR   : Ffmpeg process crashed unexpectedly for nursery_cam.
2023-08-10 20:26:04.909496739  [2023-08-10 20:26:04] watchdog.nursery_cam           ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-10 20:26:04.909508943  [2023-08-10 20:26:04] ffmpeg.nursery_cam.detect      ERROR   : [rtsp @ 0x55590d54fe40] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2023-08-10 20:26:04.909796976  [2023-08-10 20:26:04] ffmpeg.nursery_cam.detect      ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2023-08-10 20:26:04.910073614  [2023-08-10 20:26:04] ffmpeg.nursery_cam.detect      ERROR   : Output file #0 does not contain any stream

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

PCIe

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

I see some problems here

- "ffmpeg:reolink#audio=opus"

is wrong, reolink should be changed to match the name of the stream

also, you should be using http-flv not rtsp, rtsp is known to have issues like this on reolink cameras

Surfingjelly commented 1 year ago

Thanks - the first was an oversight (the first camera was called reolink before adding the second).

I'm confused as the RTSP stream has (and is) working perfectly fine for the nursery camera, but not the other, despite the same config. I'd seen in the docs that this had been flagged, but know people have got reolink cameras running with rtsp. How would I switch to http-flv and what are the benefits/downsides compared to rtsp?

NickM-27 commented 1 year ago

I'm confused as the RTSP stream has (and is) working perfectly fine for the nursery camera, but not the other, despite the same config.

Can be network conditions or other issues, but I used to run a fully reolink setup and this type of issue was very common with rtsp, I had to ask support for a beta firmware that fixed the issue.

How would I switch to http-flv and what are the benefits/downsides compared to rtsp?

Make sure http is enabled and then using it like the docs show, there are no downsides to it for 4MP cameras

Surfingjelly commented 1 year ago

Awesome - thank you. I'll have a play around with my settings and config and see where I get to; hopefully a fully working setup for both cameras!

Surfingjelly commented 1 year ago

So I have 2 working RTSP streams - I'd flicked a switch on the network switch attached to the living room cam which was limiting the ports speed. I do think I need to be properly looking into the best setup, and properly sorting rtc2go, but for now it lets me keep an eye on the dog while we're out which is great. Huge thanks for the support!

NickM-27 commented 1 year ago

Feel free to create a new issue if something else comes up