blakeblackshear / frigate

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

[Support]: Frigate always disables snapshots for one of my cameras #5552

Closed felipecrs closed 1 year ago

felipecrs commented 1 year ago

Describe the problem you are having

  1. It's enabled in the config file

  2. When Frigate starts, the snapshots comes disabled:

    frigate.comms.dispatcher       INFO    : Turning off snapshots for video_porteiro
  3. If I enabled from UI it only stays enabled before next reboot

  4. Same if I change from the Home Assistant switch

https://user-images.githubusercontent.com/29582865/220140216-4238c74e-f0f2-48a4-8c0b-1e17197e0cf7.mp4

Version

Latest dev branch, but it was happening before

Frigate config file

snapshots:
  enabled: true
cameras:
  video_porteiro:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/video_porteiro?video=copy
          input_args: preset-rtsp-restream-low-latency
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/video_porteiro_hd
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
      output_args:
        record: preset-record-generic-audio-copy
    detect:
      width: 1280
      height: 720
    live:
      height: 720
    zones:
      video_porteiro_area:
        coordinates: 956,720,835,617,724,617,512,720

Relevant log output

N/A

FFprobe output from your camera

N/A

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Dahua VTO2202F-P-S2

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

Frigate 0.12 has no memory and will not set based on MQTT retained values (because it clears them). So if this is happening on reboot it is due to an automation or something running on frigate startup. I'd suggest enabling mqtt debug logs, restart frigate, and see where the topic is being set

felipecrs commented 1 year ago

Documentation does not mention how to enable mqtt logs, is it like following:

logger:
  default: info
  logs:
    mqtt: debug
felipecrs commented 1 year ago

Ops my bad, it actually mentions here:

https://deploy-preview-4055--frigate-docs.netlify.app/configuration/advanced

I was looking at the full config file.

NickM-27 commented 1 year ago

Sorry I meant logs on your mqtt broker, but frigate mqtt logs will probably hold the same data

felipecrs commented 1 year ago

Hm, deleting this topic in MQTT fixed the issue:

https://user-images.githubusercontent.com/29582865/220142250-fb1f99dd-17ba-4035-9d5f-106034691554.mp4

Thanks!

NickM-27 commented 1 year ago

That's odd, we would expect that to be cleared on startup automatically

https://github.com/blakeblackshear/frigate/blob/a8c567d877e9874312cf1cb525da6cfa717b0a04/frigate/comms/mqtt.py#L160-L164

felipecrs commented 1 year ago

Maybe that's a small bug then... Well, I'd recommend not spending time on it unless someone else complains.

Henk72 commented 1 year ago

I have the same issue, Frigate disables the recording and snapshot, even tough I enabled them in the config. I think it is indeed in my case MQTT related.

fliespl commented 1 year ago

Having same issue with reolink camera. The only one with screenshots disabled after restart.

2023-05-09 20:09:39.259394676  [2023-05-09 20:09:39] frigate.app                    INFO    : Camera processor started for eufy1: 695
2023-05-09 20:09:39.264027776  [2023-05-09 20:09:39] frigate.app                    INFO    : Camera processor started for eufy2: 696
2023-05-09 20:09:39.280436919  [2023-05-09 20:09:39] frigate.app                    INFO    : Camera processor started for eufy3: 698
2023-05-09 20:09:39.280786056  [2023-05-09 20:09:39] frigate.app                    INFO    : Capture process started for reolink: 699
2023-05-09 20:09:39.280989158  [2023-05-09 20:09:39] frigate.app                    INFO    : Capture process started for eufy1: 702
2023-05-09 20:09:39.281171250  [2023-05-09 20:09:39] frigate.app                    INFO    : Capture process started for eufy2: 706
2023-05-09 20:09:39.285632917  [2023-05-09 20:09:39] frigate.app                    INFO    : Capture process started for eufy3: 709
...
2023-05-09 20:09:39.301448665  [2023-05-09 20:09:39] frigate.comms.dispatcher       INFO    : Turning on snapshots for eufy1
2023-05-09 20:09:39.302145637  [2023-05-09 20:09:39] frigate.comms.dispatcher       INFO    : Turning on snapshots for eufy2
2023-05-09 20:09:39.303604270  [2023-05-09 20:09:39] frigate.comms.dispatcher       INFO    : Turning on snapshots for eufy3

Also from HA:

https://ss.codeone.pl/ss-2023-05-09-22-17-37-1683663457-CBAakp1b.png (marked manual "turn on" on screen).

Burkey2k commented 1 year ago

I have this same issue also, and deleting the topic in MQTT has no effect (have deleted all retains I could find).

felipecrs commented 1 year ago

I'm reopening my own issue, following my own comment:

Maybe that's a small bug then... Well, I'd recommend not spending time on it unless someone else complains.

Burkey2k commented 1 year ago

For clarity, I have two Tapo cameras, and it only affects one of them. Exact same behaviour as described above otherwise. I will have more time to investigate on MQTT explorer this weekend, but after a few hours of going through logs and troubleshooting last night, I'm at a loss (but I'm in no way am expert!).

eloquentvogon commented 1 year ago

I have noticed on my wyze and foscam that snapshots are also disabled after restart

monkmad commented 1 year ago

I have the same issue. My setup has 5 Reolink cameras and one other. On startup, it always defaults to snapshots disabled for three cameras and I have to toggle it On in the UI. Setting snapshots to enabled in the config (under each camera --> mqtt) has no effect. I'm on the latest stable version.

NickM-27 commented 1 year ago

Setting snapshots to enabled in the config (under each camera --> mqtt) has no effect

That's the wrong place in the config that you would enable snapshots, so seems like that would be the issue

monkmad commented 1 year ago

Maybe I got it wrong; I have Snapshots --> Enabled : True in my config file, but also the mqtt setting under each camera, as explained here

Is that not how to do it?

Here are actual snippets from my config file:

snapshots:
  retain:
    default: 180

and

cameras:
  familyroom:
    record:
      enabled: true
    mqtt:
      enabled: True
    ffmpeg:
NickM-27 commented 1 year ago

I don't see snapshots -> enabled in your example, that is the only part that would matter.

monkmad commented 1 year ago

Ah! For some reason, I mistakenly thought the default value was True. Setting it explicitly to true fixed all the cameras. D'oh! 🤦 Thanks!

NickM-27 commented 1 year ago

I am going to close this, users experiencing this issue should create their own separate issue and provide the config file, logs, etc. so it will be immediately obvious what the problem is.

Henk72 commented 1 year ago

In my case the issue was caused by a retain flag at MQTT level

PeggyFree commented 1 month ago

Hm, deleting this topic in MQTT fixed the issue: MQTT_Explorer_fyMJ8KBXgy.mp4

Thanks!

This topic deletion also solved the issue in my config, thanks for the detailed answer !