double-take: [BUG] Don't understand the `frigate.attempts.mqtt` setting

Describe the bug This is more of a config question than a bug. I was wondering if frgiate publishes the actual image to MQTT and DT picks it up. If true, I was trying to set frigate.attempts.mqtt to true and setting the snapshot and latest settings to 0 would mean that DT will take the image published to MQTT and not try to download it from frigate. I am not even sure I understand the functionality but was just playing around with settings. I think DT is reporting that it can’t even find a person whereas Frigate using AI Server found the person and published the event. I even removed the min_area setting without luck. However, if I set attempts.latest and attempts.snapshot to default or anything other than 0, it works. So not sure what is going on here. IIRC, I remember seeing only MQTT labels in the UI thumbnail list in the previous versions but now none of them are MQTT labels.

If this is not how the integration is supposed to work, then we can ignore this and move on.

Here is my config:

---
auth: true

mqtt:
  host: m
  username: USERNAME
  password: PASSWORD

frigate:
  url: http://f:5000
  update_sub_labels: true
  min_area: 4096
  labels:
    - person
  image:
    height: 720
  attempts:
    latest: 0
    snapshot: 0
    mqtt: true
    delay: 2
  
logs:
  level: silly
  
detectors:
  deepstack:
    url: http://ds:5000
    timeout: 15
    opencv_face_required: true
  aiserver:
    url: http://cpai:5000
    timeout: 60
    opencv_face_required: true

Version of Double Take 1.13.11.8

Expected behavior maybe pick up the image from MQTT and process it?

Screenshots Here is my log output:

home_dt.1.m308n5oqkwkk@potter    | verbose: Incoming event from frigate: {"before": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787361.207806, "snapshot": null, "label": "person", "sub_label": null, "top_score": 0.0, "false_positive": true, "start_time": 1700787361.207806, "end_time": null, "score": 0.92138671875, "box": [869, 412, 1086, 950], "area": 116746, "ratio": 0.4033457249070632, "region": [681, 407, 1261, 987], "stationary": false, "motionless_count": 0, "position_changes": 0, "current_zones": [], "entered_zones": [], "has_clip": false, "has_snapshot": false, "attributes": {}, "current_attributes": []}, "after": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787361.331878, "snapshot": {"frame_time": 1700787361.331878, "box": [880, 397, 1093, 941], "area": 115872, "region": [683, 390, 1267, 974], "score": 0.92578125, "attributes": []}, "label": "person", "sub_label": null, "top_score": 0.923583984375, "false_positive": false, "start_time": 1700787361.207806, "end_time": null, "score": 0.92578125, "box": [880, 397, 1093, 941], "area": 115872, "ratio": 0.3915441176470588, "region": [683, 390, 1267, 974], "stationary": false, "motionless_count": 0, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": true, "has_snapshot": false, "attributes": {}, "current_attributes": []}, "type": "new"}
home_dt.1.m308n5oqkwkk@potter    | info: processing garage: 1700787361.207806-4z62ld
home_dt.1.m308n5oqkwkk@potter    | info: done processing garage: 1700787361.207806-4z62ld in 0 sec
home_dt.1.m308n5oqkwkk@potter    | info: {
home_dt.1.m308n5oqkwkk@potter    |   id: '1700787361.207806-4z62ld',
home_dt.1.m308n5oqkwkk@potter    |   duration: 0,
home_dt.1.m308n5oqkwkk@potter    |   timestamp: '2023-11-24T00:56:01.720Z',
home_dt.1.m308n5oqkwkk@potter    |   attempts: 0,
home_dt.1.m308n5oqkwkk@potter    |   camera: 'garage',
home_dt.1.m308n5oqkwkk@potter    |   zones: [],
home_dt.1.m308n5oqkwkk@potter    |   counts: { person: 0, match: 0, miss: 0, unknown: 0 },
home_dt.1.m308n5oqkwkk@potter    |   matches: [],
home_dt.1.m308n5oqkwkk@potter    |   misses: [],
home_dt.1.m308n5oqkwkk@potter    |   unknowns: [],
home_dt.1.m308n5oqkwkk@potter    |   token: '********'
home_dt.1.m308n5oqkwkk@potter    | }
home_dt.1.m308n5oqkwkk@potter    | verbose: Event type: frigate
home_dt.1.m308n5oqkwkk@potter    | verbose: FRIGATE.URL: http://f:5000; FRIGATE.UPDATE_SUB_LABELS: true; best.length: 0
home_dt.1.m308n5oqkwkk@potter    | verbose: Incoming event from frigate: {"before": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787361.331878, "snapshot": {"frame_time": 1700787361.331878, "box": [880, 397, 1093, 941], "area": 115872, "region": [683, 390, 1267, 974], "score": 0.92578125, "attributes": []}, "label": "person", "sub_label": null, "top_score": 0.923583984375, "false_positive": false, "start_time": 1700787361.207806, "end_time": null, "score": 0.92578125, "box": [880, 397, 1093, 941], "area": 115872, "ratio": 0.3915441176470588, "region": [683, 390, 1267, 974], "stationary": false, "motionless_count": 0, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": true, "has_snapshot": false, "attributes": {}, "current_attributes": []}, "after": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787361.53252, "snapshot": {"frame_time": 1700787361.331878, "box": [880, 397, 1093, 941], "area": 115872, "region": [683, 390, 1267, 974], "score": 0.92578125, "attributes": []}, "label": "person", "sub_label": null, "top_score": 0.923583984375, "false_positive": false, "start_time": 1700787361.207806, "end_time": null, "score": 0.86376953125, "box": [923, 424, 1126, 900], "area": 96628, "ratio": 0.4264705882352941, "region": [704, 370, 1300, 966], "stationary": false, "motionless_count": 3, "position_changes": 1, "current_zones": ["driveway"], "entered_zones": ["driveway"], "has_clip": true, "has_snapshot": true, "attributes": {}, "current_attributes": []}, "type": "update"}
home_dt.1.m308n5oqkwkk@potter    | info: processing garage: 1700787361.207806-4z62ld
home_dt.1.m308n5oqkwkk@potter    | info: done processing garage: 1700787361.207806-4z62ld in 0 sec
home_dt.1.m308n5oqkwkk@potter    | info: {
home_dt.1.m308n5oqkwkk@potter    |   id: '1700787361.207806-4z62ld',
home_dt.1.m308n5oqkwkk@potter    |   duration: 0,
home_dt.1.m308n5oqkwkk@potter    |   timestamp: '2023-11-24T00:56:01.991Z',
home_dt.1.m308n5oqkwkk@potter    |   attempts: 0,
home_dt.1.m308n5oqkwkk@potter    |   camera: 'garage',
home_dt.1.m308n5oqkwkk@potter    |   zones: [ 'driveway' ],
home_dt.1.m308n5oqkwkk@potter    |   counts: { person: 0, match: 0, miss: 0, unknown: 0 },
home_dt.1.m308n5oqkwkk@potter    |   matches: [],
home_dt.1.m308n5oqkwkk@potter    |   misses: [],
home_dt.1.m308n5oqkwkk@potter    |   unknowns: [],
home_dt.1.m308n5oqkwkk@potter    |   token: '********'
home_dt.1.m308n5oqkwkk@potter    | }
home_dt.1.m308n5oqkwkk@potter    | verbose: Event type: frigate
home_dt.1.m308n5oqkwkk@potter    | verbose: FRIGATE.URL: http://f:5000; FRIGATE.UPDATE_SUB_LABELS: true; best.length: 0
home_dt.1.m308n5oqkwkk@potter    | verbose: Incoming event from frigate: {"before": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787361.53252, "snapshot": {"frame_time": 1700787361.331878, "box": [880, 397, 1093, 941], "area": 115872, "region": [683, 390, 1267, 974], "score": 0.92578125, "attributes": []}, "label": "person", "sub_label": null, "top_score": 0.923583984375, "false_positive": false, "start_time": 1700787361.207806, "end_time": null, "score": 0.86376953125, "box": [923, 424, 1126, 900], "area": 96628, "ratio": 0.4264705882352941, "region": [704, 370, 1300, 966], "stationary": false, "motionless_count": 3, "position_changes": 1, "current_zones": ["driveway"], "entered_zones": ["driveway"], "has_clip": true, "has_snapshot": true, "attributes": {}, "current_attributes": []}, "after": {"id": "1700787361.207806-4z62ld", "camera": "garage", "frame_time": 1700787365.281423, "snapshot": {"frame_time": 1700787361.331878, "box": [880, 397, 1093, 941], "area": 115872, "region": [683, 390, 1267, 974], "score": 0.92578125, "attributes": []}, "label": "person", "sub_label": null, "top_score": 0.923583984375, "false_positive": false, "start_time": 1700787361.207806, "end_time": 1700787369.686066, "score": 0.748046875, "box": [1108, 297, 1186, 549], "area": 19656, "ratio": 0.30952380952380953, "region": [985, 267, 1305, 587], "stationary": false, "motionless_count": 2, "position_changes": 1, "current_zones": ["driveway"], "entered_zones": ["driveway"], "has_clip": true, "has_snapshot": true, "attributes": {}, "current_attributes": []}, "type": "end"}

Hardware

  • Architecture or platform: amd64
  • OS: Ubuntu Server
  • Browser (if applicable): Firefox
  • Docker image (if applicable): skrashevich/double-take:latest

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I have suddenly started to receive mqtt and snaphots together. Here’s my config:

mqtt:
  host: 192.168.1.10
  username: ****
  password: ****
  client_id: double-take
  topics:
    # mqtt topic for frigate message subscription
    frigate: frigate/events
    #  mqtt topic for home assistant discovery subscription
    homeassistant: homeassistant
    # mqtt topic where matches are published by name
    matches: double-take/matches
    # mqtt topic where matches are published by camera name
    cameras: double-take/cameras
    
frigate:
  url: http://192.168.1.10:5000
  update_sub_labels: true
  stop_on_match: true
  min_area: 0
  labels:
    - person
  zones:
    - camera: doorcam
      zone: entrance
  attempts:
    # number of times double take will request a frigate latest.jpg for facial recognition
    latest: 10
    # number of times double take will request a frigate snapshot.jpg for facial recognition
    snapshot: 10
    # process frigate images from frigate/+/person/snapshot topics
    mqtt: true
    # add a delay expressed in seconds between each detection loop
    delay: 0
    image:
      height: 1080
  cameras:
    - doorcam
    
cameras:
  doorcam:
    mqtt:
      timestamp: False
      bounding_box: False
      crop: false
      quality: 80
      height: 1080
      
  
      
detectors:
  compreface:
    url: http://192.168.1.10:8000
    # recognition api key
    key: *****
    # number of seconds before the request times out and is aborted
    timeout: 15
    # minimum required confidence that a recognized face is actually a face
    # value is between 0.0 and 1.0
    det_prob_threshold: 0.8
    # require opencv to find a face before processing with detector
    opencv_face_required: false
    # comma-separated slugs of face plugins
    # https://github.com/exadel-inc/CompreFace/blob/master/docs/Face-services-and-plugins.md)
    # face_plugins: mask,gender,age
    # only process images from specific cameras, if omitted then all cameras will be processed
    # cameras:
    #   - front-door
    #   - garage
detect:
  match:
    # save match images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed to consider a result a match
    confidence: 97
    # hours to keep match images until they are deleted
    purge: 168
    # minimum area in pixels to consider a result a match
    min_area: 3600

  unknown:
    # save unknown images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed before classifying a name as unknown
    confidence: 97
    # hours to keep unknown images until they are deleted
    purge: 128
    # minimum area in pixels to keep an unknown result
    min_area: 3600

In the log appears now: 23-11-29 21:46:18 info: Double Take v1.13.11.8 23-11-29 21:46:19 info: MQTT: connected 23-11-29 21:46:19 info: MQTT: subscribed to frigate/events, frigate/doorcam/person/snapshot

However (might be frigate settings???) the match was done first on “latest”. MQTT seems to be a bit later (mqtt was fired from frigate around 7 seconds after the match on “latest”, and it’s the same pic as registered as a snapshot in frigate. I’ll do some tests only with mqtt and see if this fires a few pics from frigate or just one (snapshot pic). Sublabels also were updated. So, as I have not changed the DoubleTake version, it seems like config file was wrong.