Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to switch off detect #1322

Closed
mike-code opened this issue Jul 3, 2021 · 21 comments
Closed

Unable to switch off detect #1322

mike-code opened this issue Jul 3, 2021 · 21 comments
Labels

Comments

@mike-code
Copy link

Describe the bug
I am unable to turn off detect role. I was looking for an NVR to perform a 24/7 recording with seamless option to manage recordings/clips, archive the important ones etc. I'm not really looking into any motion detection, AI recognition etc. Perhaps Frigate is not the tool I'm looking for, nonetheless, I was wondering if that's perhaps not intended to force detect, provided I don't have any TPU thus my poor raspberry CPU would be quickly overwhelmed.

Version of frigate
0.8.4-5043040

Config file
Include your full config file wrapped in triple back ticks.

detectors:
  cpu1:
    type: cpu
mqtt:
  host: mqtt
cameras:
  foobar:
    ffmpeg:
      output_args:
        record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy
      inputs:
        - path: rtsp://cam01.home:554/s0
          roles:
            - record
    width: 1920
    height: 1080
    fps: 30
    record:
      enabled: True
      retain_days: 14
    detect:
      enabled: False

Frigate container logs

Creating network "frigate_default" with the default driver
Creating frigate_mqtt_1 ... done
Creating frigate_frigate_1 ... done
Attaching to frigate_mqtt_1, frigate_frigate_1
frigate_1  |  * Starting nginx nginx
frigate_1  |    ...done.
frigate_1  | Error parsing config: The detect role is required for dictionary value @ data['cameras']['foobar']['ffmpeg']['inputs']
frigate_frigate_1 exited with code 1

Frigate stats

n/a

FFprobe from your camera

Run the following command and paste output below

n/a
@blakeblackshear
Copy link
Owner

Many features of frigate require an input to be decoded. You can turn off detection in the config, but one input must be assigned the detect role.

@stale
Copy link

stale bot commented Aug 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 2, 2021
@stale stale bot closed this as completed Aug 5, 2021
@balthisar
Copy link

@blakeblackshear, how does one disable detection in the config? None of the documentation address this. Like @mike-code, I really only want to record.

@bafplus
Copy link

bafplus commented Sep 10, 2021

@blakeblackshear, how does one disable detection in the config? None of the documentation address this. Like @mike-code, I really only want to record.

just add (see first code of config above just below "record"):

detect:
  enabled: False

Dont forget to still mark one of the inputs as "-detect", Frigate needs that to function.
But by declaring detect to false it wont run the actual detection.

@balthisar
Copy link

That's one of the first things I tried, but:

Error parsing config: extra keys not allowed @ data['detect']['enabled']

I'm using a fresh blakeblackshear/frigate:stable-amd64, which I just now realize is seven months old. I'll give one of the latest a shot, which will probably be easier than checking your commit log ;-)

@bafplus
Copy link

bafplus commented Sep 10, 2021

That's one of the first things I tried, but:

Error parsing config: extra keys not allowed @ data['detect']['enabled']

I'm using a fresh blakeblackshear/frigate:stable-amd64, which I just now realize is seven months old. I'll give one of the latest a shot, which will probably be easier than checking your commit log ;-)

Have u put that detect block within the camera block?
You have to specify that in each camera block you have in the frigate.yaml.

@balthisar
Copy link

Well, that makes a lot more sense than it being a global level setting! I was misled because record/enabled/false actually worked at the global level for me!

Thanks, cheers!

@simondsmason
Copy link

Re-opening this thread. The following config for one of my cameras is triggering person events. I don't want it to trigger any events, only record. If I read the thread above it should not trigger any events?

kitchen:
ffmpeg:
inputs:
- path: rtsp://admin:PW@IP//h264Preview_01_main
roles:
- rtmp
- detect
detect:
enabled: false
motion:
mask:
- 0,720,433,720,433,677,0,676

I have tried with or without the - detect in the roles but it still triggers. Is there something I should be configuring differently? Thanks.

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 3, 2023

@simondsmason you probably have MQTT enabling detect, simply disable it in the Web UI and it won't be run

@simondsmason
Copy link

@NickM-27 I do have them enabled in the UI. Sorry - thought that this would sync with the config - didn't realize that they are independent controls. Have just turned them off and will see how it goes.

@simondsmason
Copy link

@NickM-27 I have turned off the person detection on three cameras and each time it has come back on within a day or so. I am not sure how long exactly but it is definitely turning back on. I have the detect, enabled: false in the config for these cameras and I have the toggle detection off in the Web UI. So something is turning the detection back on after some time. So not sure exactly what to do to keep it off? Thanks.

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 8, 2023

Most likely it is going to be something in HA if you have the integration setup. Either way it will show in the logs what has turned on / off detect

@simondsmason
Copy link

I do have have the HA integration setup. I have two automations running to notify me based on detection. I looked in the logs but a backup had run so not much to go on. If it happens again I will look in the log. Thanks.

@simondsmason
Copy link

@NickM-27 The issue has happened several times. Most recently today, on three cameras it turned on detect and recordings but not snapshots. Detect turned back on in my events around 8am this morning. So I thought to look at the last 12 hours of logs. And sure enough at 7:59 I see the following: Turning on recordings for kitchen via mqtt. Then in mqtt I see the following below. What I don't know is where to look now or if the information below is telling me where the command to turn on detect and recordings is coming from? I looked in HA logbook but I can't find anything there - but I never seem to find anything in logbook so I can't be sure I am using it correctly. Any help in my investigation would be appreciated. Thanks.

1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/detect/set', ... (2 bytes))
1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/detect/set', ... (2 bytes))
1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/detect/state', ... (2 bytes))
1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/detect/state', ... (2 bytes))
1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/detect/state', ... (2 bytes))
1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/recordings/set', ... (2 bytes))
1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/recordings/set', ... (2 bytes))
1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/recordings/state', ... (2 bytes))
1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/recordings/state', ... (2 bytes))
1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/recordings/state', ... (2 bytes))
1674219576: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes))
1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes))
1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes))
1674219577: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes))
1674219577: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes))
1674219577: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes))
1674219577: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/stats', ... (1798 bytes))
1674219577: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/stats', ... (1798 bytes))

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 20, 2023

@NickM-27 The issue has happened several times. Most recently today, on three cameras it turned on detect and recordings but not snapshots. Detect turned back on in my events around 8am this morning. So I thought to look at the last 12 hours of logs. And sure enough at 7:59 I see the following: Turning on recordings for kitchen via mqtt. Then in mqtt I see the following below. What I don't know is where to look now or if the information below is telling me where the command to turn on detect and recordings is coming from? I looked in HA logbook but I can't find anything there - but I never seem to find anything in logbook so I can't be sure I am using it correctly. Any help in my investigation would be appreciated. Thanks.

1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/detect/set', ... (2 bytes)) 1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/detect/set', ... (2 bytes)) 1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/detect/state', ... (2 bytes)) 1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/detect/state', ... (2 bytes)) 1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/detect/state', ... (2 bytes)) 1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/recordings/set', ... (2 bytes)) 1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/recordings/set', ... (2 bytes)) 1674219576: Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/recordings/state', ... (2 bytes)) 1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/recordings/state', ... (2 bytes)) 1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/recordings/state', ... (2 bytes)) 1674219576: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes)) 1674219576: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes)) 1674219576: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (3 bytes)) 1674219577: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes)) 1674219577: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes)) 1674219577: Sending PUBLISH to 1k9Z86JOAIwgVYeEeopcba (d0, q0, r0, m0, 'frigate/kitchen/motion', ... (2 bytes)) 1674219577: Received PUBLISH from frigate (d0, q0, r0, m0, 'frigate/stats', ... (1798 bytes)) 1674219577: Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/stats', ... (1798 bytes))

No where in the frigate code is /set called so it will be coming from outside frigate

@simondsmason
Copy link

@NickM-27 You lost me. "where in the frigate code is /set called"? What is the frigate code? I see that in the frigate log the detecter is being turned on by mqtt. I see in the mqtt log that it is sending publish to frigate with a detect/set. But I have no idea where this call to mqtt is coming from and the log doesn't show the origin? And in HA I only have two automations setup for frigate and they are both on another camera. I have no doubt that I am overlooking something? Thanks for the help - it is frustrating to have these cameras keep turning themselves on and I would like to put an end to it.

@NickM-27
Copy link
Collaborator

What I'm saying is the frigate software itself does not call /set so it's coming externally. Either from HA or something else that communicates via MQTT. There may be a way to enable more verbose MQTT logs so it'll show the origin that sent the message

@simondsmason
Copy link

@NickM-27 I checked the mqtt logging and it is set to all, which is the highest log level.

What I don't understand, and this is probably my lack of experience with mqtt, is that I see these two commands:

Received PUBLISH from frigate (d0, q0, r1, m0, 'frigate/kitchen/detect/set', ... (2 bytes))

and then this:

Sending PUBLISH to frigate (d0, q0, r0, m0, 'frigate/kitchen/detect/set', ... (2 bytes))

There is no other reference to kitchen/detect/set. That reads like it received a command from frigate to go to frigate? And Frigate reports in the log:

Turning on detection for kitchen via mqtt

So based on all of the logs I have found so far it is doesn't seem possible to diagnose this?

@NickM-27
Copy link
Collaborator

@simondsmason can you confirm the version of Frigate you're running?

@simondsmason
Copy link

@NickM-27 0.11.1-2EADA21

@NickM-27
Copy link
Collaborator

Oh, in that case what you're seeing could be from a number of things, but it should be fixed in 0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants