frigate: [Support]: Recording breaks if disabled by MQTT on Frigate start

Describe the problem you are having

I have two cameras setup (same model) and both are setup via HA to enable/disable the camera’s RTSP server and Frigate’s Recording feature via a single button click. The problem I am experiencing is that after I enable/disable the recording feature in Frigate, the recording never resumes. When I navigate to the camera recording page I get the following error:

No Recordings Found

Make sure you have enabled the record role in your configuration for the livingRoom camera.

And if I look at the recording folder I see no new video files are being created. I can recover the recording feature by restarting the Frigate container, but enabling/disabling the recording feature breaks it again. Looking through the logs I don’t see any obvious failures, it looks like Frigate is not correctly re-enabling the recording feature.

Version

0.9.4-26ae608

Frigate config file

{
  "birdseye": {
    "enabled": true,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "babyRoom": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": false,
        "fps": 5,
        "height": 1080,
        "max_disappeared": 25,
        "width": 1920
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://<user>:<pass>@<ip>:8554/unicast",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -i rtsp://<user>:<pass>@<ip>:8554/unicast -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/babyRoom-%Y%m%d%H%M%S.mp4 -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 99,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 180,
        "mask": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "babyRoom",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "objects": {}
          }
        },
        "retain_days": 1
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": false,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "zones": {}
    },
    "livingRoom": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": false,
        "fps": 5,
        "height": 1080,
        "max_disappeared": 25,
        "width": 1920
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://<user>:<pass>@<ip>:8554/unicast",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -avoid_negative_ts make_zero -i rtsp://<user>:<pass>@<ip>:8554/unicast -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/livingRoom-%Y%m%d%H%M%S.mp4 -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 99,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 180,
        "mask": "",
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "livingRoom",
      "objects": {
        "filters": {
          "person": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "person"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [],
          "retain": {
            "default": 10,
            "objects": {}
          }
        },
        "retain_days": 1
      },
      "rtmp": {
        "enabled": false
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": false,
        "height": null,
        "quality": 70,
        "required_zones": [],
        "retain": {
          "default": 10,
          "objects": {}
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "zones": {}
    }
  },
  "database": {
    "path": "/media/frigate/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": null,
    "width": 1280
  },
  "detectors": {
    "cpu": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": [
      "-hide_banner",
      "-loglevel",
      "warning"
    ],
    "hwaccel_args": [],
    "input_args": [
      "-avoid_negative_ts",
      "make_zero",
      "+genpts+discardcorrupt",
      "-vsync",
      "drop",
      "-use_wallclock_as_timestamps",
      "1"
    ],
    "output_args": {
      "detect": [
        "-f",
        "rawvideo",
        "-pix_fmt",
        "yuv420p"
      ],
      "record": [
        "-f",
        "segment",
        "-segment_time",
        "10",
        "-segment_format",
        "mp4",
        "-reset_timestamps",
        "1",
        "-strftime",
        "1",
        "-c",
        "copy",
        "-an"
      ],
      "rtmp": [
        "-c",
        "copy",
        "-f",
        "flv"
      ]
    }
  },
  "live": {
    "height": 720,
    "quality": 8
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {},
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "mqtt",
    "password": "<password>",
    "port": 1883,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": "<user>"
  },
  "objects": {
    "filters": null,
    "mask": "",
    "track": [
      "person"
    ]
  },
  "record": {
    "enabled": false,
    "events": {
      "max_seconds": 300,
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [],
      "retain": {
        "default": 10,
        "objects": {}
      }
    },
    "retain_days": 0
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": false,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 10,
      "objects": {}
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  }
}

Relevant log output

[2021-10-27 09:55:08] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59438]


[2021-10-27 09:55:11] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59438]


[2021-10-27 09:55:11] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59452]


[2021-10-27 09:56:39] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59452]


[2021-10-27 10:02:35] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51250]


[2021-10-27 10:02:40] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51250]


[2021-10-27 10:02:41] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59664]


[2021-10-27 10:02:41] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51262]


[2021-10-27 10:02:52] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51262]


[2021-10-27 10:02:56] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59664]


[2021-10-27 10:02:57] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59694]


[2021-10-27 10:02:59] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59694]


[2021-10-27 10:02:59] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59708]


[2021-10-27 10:03:00] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59708]


[2021-10-27 10:03:00] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59718]


[2021-10-27 10:03:02] frigate.mqtt                   INFO    : Turning on detection for livingRoom via mqtt


[2021-10-27 10:03:03] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59718]


[2021-10-27 10:03:03] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59730]


[2021-10-27 10:03:05] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59730]


[2021-10-27 10:03:05] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59740]


[2021-10-27 10:03:16] frigate.mqtt                   INFO    : Turning on snapshots for livingRoom via mqtt


[2021-10-27 10:03:17] frigate.mqtt                   INFO    : Turning off snapshots for livingRoom via mqtt


[2021-10-27 10:03:22] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59740]


[2021-10-27 10:03:22] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59770]


[2021-10-27 10:03:24] frigate.mqtt                   INFO    : Turning off detection for livingRoom via mqtt


[2021-10-27 10:03:25] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59770]


[2021-10-27 10:03:26] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59788]


[2021-10-27 10:03:27] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59788]


[2021-10-27 10:03:27] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59798]


[2021-10-27 10:03:31] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59798]


[2021-10-27 10:03:31] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59810]


[2021-10-27 10:03:33] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59810]


[2021-10-27 10:03:33] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59824]


[2021-10-27 10:03:35] frigate.mqtt                   INFO    : Turning off recordings for livingRoom via mqtt


[2021-10-27 10:03:37] frigate.mqtt                   INFO    : Turning on recordings for livingRoom via mqtt


[2021-10-27 10:03:40] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59824]


[2021-10-27 10:03:40] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59838]


[2021-10-27 10:03:42] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59838]


[2021-10-27 10:03:42] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59848]


[2021-10-27 10:03:43] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59848]


[2021-10-27 10:03:43] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59858]


[2021-10-27 10:03:44] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59858]


[2021-10-27 10:03:44] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59866]


[2021-10-27 10:03:45] frigate.mqtt                   INFO    : Turning off recordings for livingRoom via mqtt


[2021-10-27 10:03:46] frigate.mqtt                   INFO    : Turning on detection for livingRoom via mqtt


[2021-10-27 10:03:56] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51480]


[2021-10-27 10:03:58] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51480]


[2021-10-27 10:04:17] frigate.mqtt                   INFO    : Turning on recordings for livingRoom via mqtt


[2021-10-27 10:04:21] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51620]


[2021-10-27 10:04:22] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51620]


[2021-10-27 10:04:57] frigate.mqtt                   INFO    : Turning off detection for livingRoom via mqtt


[2021-10-27 10:06:39] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:59866]


[2021-10-27 10:08:09] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:60374]


[2021-10-27 10:09:39] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:60374]

FFprobe output from your camera

ffprobe version 4.4.1-with-options Copyright (c) 2007-2021 the FFmpeg developers
  built with Apple clang version 12.0.5 (clang-1205.0.22.11)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-demuxer=dash --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --disable-htmlpages --extra-version=with-options --enable-opencl --enable-videotoolbox
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[rtsp @ 0x7fef29811000] max delay reached. need to consume packet
[rtsp @ 0x7fef29811000] RTP: missed 2 packets
[rtsp @ 0x7fef29811000] max delay reached. need to consume packet
[rtsp @ 0x7fef29811000] RTP: missed 7 packets
Input #0, rtsp, from 'rtsp://<user>:<pass>@<ip>:8554/unicast':
  Metadata:
    title           : LIVE555 Streaming Media v2020.05.15
    comment         : LIVE555 Streaming Media v2020.05.15
  Duration: N/A, start: 0.000375, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, 25 fps, 15.08 tbr, 90k tbn, 50 tbc
  Stream #0:1: Audio: pcm_mulaw, 16000 Hz, 1 channels, s16, 128 kb/s

Frigate stats

{"babyRoom":{"camera_fps":5.1,"capture_pid":230,"detection_fps":0.0,"pid":227,"process_fps":0.0,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"cpu":{"detection_start":0.0,"inference_speed":215.87,"pid":219}},"livingRoom":{"camera_fps":5.1,"capture_pid":228,"detection_fps":0.0,"pid":225,"process_fps":0.0,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":60.2,"mount_type":"tmpfs","total":67.1,"used":6.9},"/media/frigate/clips":{"free":160025.7,"mount_type":"zfs","total":173435.4,"used":13409.7},"/media/frigate/recordings":{"free":160025.7,"mount_type":"zfs","total":173435.4,"used":13409.7},"/tmp/cache":{"free":999.5,"mount_type":"tmpfs","total":1000.0,"used":0.5}},"uptime":127266,"version":"0.9.4-26ae608"}}

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wireless

Camera make and model

Wyze Pan w/ dafang hacks

Any other information that may be helpful

No response

About this issue

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

Most upvoted comments

@blakeblackshear I finally got a chance to check out the beta (specifically beta 6) and can confirm this bug is fixed. Thanks! Awesome job on this and frigate as a whole! WIll close out the bug.

@blakeblackshear I did a little more experimentation and I think I found the root cause. If I have the cameras set to record when frigate starts I am able to enable/disable recording without issue. However, if the MQTT state is set to disable recording when frigate starts, re-enabling at a later time does not restart recording.

Got the same issue. I hope Blake figures this out!