question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recordings turned off at frigate restart

See original GitHub issue

Describe the problem you are having

Each time frigate docker restarts, the recording is turned off for 4 out of 5 cameras, and have to be manually started again.

Version

0.10.0-DB1255A

Frigate config file

detectors:
  coral:
    type: edgetpu
    device: usb
mqtt:
  topic_prefix: frigate
  host: 10.0.2.3
  user: user
  password: password
ffmpeg:
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport udp
  global_args: '-hide_banner -loglevel warning'
  hwaccel_args:
    - -hwaccel
    - qsv
    - -qsv_device
    - /dev/dri/renderD128
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy
    rtmp: -c copy -f flv -c:a aac

database:
  path: /config/frigate.db

logger:
  default: info
  logs:
    frigate.event: debug

detect:
  width: 1280
  height: 720
  fps: 5
  enabled: True
  max_disappeared: 25

record:
  enabled: True
  retain:
    days: 5
    mode: all


snapshots:
  enabled: True
  timestamp: True
  bounding_box: True
  crop: False
  required_zones: []
  retain:
    default: 5
    objects:
      person: 5
      car: 5


rtmp:
  enabled: True



live:
  height: 720
  quality: 8





timestamp_style:
  position: "tl"
  format: "%Y-%m-%d %H:%M:%S"
  color:
    red: 255
    green: 255
    blue: 255
  thickness: 1
  effect: "solid"




cameras:
  framsidan:
    mqtt:
      crop: False
    ffmpeg:
      inputs:
        - path: 'rtsp://user:password@IP:88/videoSub'
          roles:
            - detect
            - rtmp
        - path: 'rtsp://user:password@IP:88/videoMain'
          roles:
            - record
    objects:
      filters:
        car:
          mask: 803,175,788,293
        person:
          mask: 0,720,748,720
      track:
        - person
        - car

  baksidan:
    mqtt:
      crop: False
    ffmpeg:
      inputs:
        - path: 'rtsp://user:password@IP:554/live/ch1'
          roles:
            - detect
            - rtmp
        - path: 'rtsp://user:password@IP:554/live/ch0'
          roles:
            - record
    motion:
        mask:
          - 1280,0,1280,304,0,293,0,0
    objects:
        track:
          - person
        filters:
          person:
            mask:
              - 0,1080,1920,1080,1920,475,0,461


  frontdoor:
    mqtt:
      crop: False
    ffmpeg:
      inputs:
        - path: 'rtsp://user:password@IP:554/live/ch1'
          roles:
            - detect
            - rtmp
        - path: 'rtsp://user:password@IP:554/live/ch0'
          roles:
            - record
    motion:
        mask:
          - 865,230,1059,422,1160,720,1280,720,1280,0,0,0,0,117
          - 0,720,351,720,481,378,491,147,0,103,0,240
    objects:
        track:
          - person
        filters:
          person:
            mask: 455,233,1312,346

  northside:
    mqtt:
      crop: False
    ffmpeg:
      inputs:
        - path: 'rtsp://user:password@IP:554/live/ch1'
          roles:
            - detect
            - rtmp
        - path: 'rtsp://user:password@IP:554/live/ch0'
          roles:
            - record
    motion:
        mask:
          - 1280,0,1280,241,576,43,77,145,308,720,0,720,0,214,0,0
    objects:
        track:
          - person
        filters:
          person:
            mask: 1920,379,1920,108






  carport:
    mqtt:
      crop: False
    ffmpeg:
      inputs:
        - path: 'rtsp://user:password@IP:554/live/ch1'
          roles:
            - detect
            - rtmp
        - path: 'rtsp://user:password@IP:554/live/ch0'
          roles:
            - record
    objects:
        track:
          - person
          - car

Relevant log output

2022-01-12T15:32:19.343524075Z [services.d] starting services
2022-01-12T15:32:19.345932701Z [services.d] done.
2022-01-12T15:32:19.728994036Z [2022-01-12 15:32:19] frigate.app                    INFO    : Starting Frigate (0.10.0-db1255a)
2022-01-12T15:32:19.761469960Z Starting migrations
2022-01-12T15:32:19.761490208Z [2022-01-12 15:32:19] peewee_migrate                 INFO    : Starting migrations
2022-01-12T15:32:19.764413893Z There is nothing to migrate
2022-01-12T15:32:19.764421467Z [2022-01-12 15:32:19] peewee_migrate                 INFO    : There is nothing to migrate
2022-01-12T15:32:19.789072133Z [2022-01-12 15:32:19] frigate.mqtt                   INFO    : MQTT connected
2022-01-12T15:32:19.797522849Z [2022-01-12 15:32:19] detector.coral                 INFO    : Starting detection process: 225
2022-01-12T15:32:22.488929513Z [2022-01-12 15:32:19] frigate.app                    INFO    : Output process started: 226
2022-01-12T15:32:22.488962756Z [2022-01-12 15:32:19] frigate.edgetpu                INFO    : Attempting to load TPU as usb
2022-01-12T15:32:22.488989757Z [2022-01-12 15:32:19] ws4py                          INFO    : Using epoll
2022-01-12T15:32:22.489022599Z [2022-01-12 15:32:19] frigate.mqtt                   INFO    : Turning off recordings for framsidan via mqtt
2022-01-12T15:32:22.489058768Z [2022-01-12 15:32:19] frigate.mqtt                   INFO    : Turning off recordings for baksidan via mqtt
2022-01-12T15:32:22.489085249Z [2022-01-12 15:32:19] frigate.mqtt                   INFO    : Turning off recordings for frontdoor via mqtt
2022-01-12T15:32:22.489115276Z [2022-01-12 15:32:19] frigate.mqtt                   INFO    : Turning off recordings for carport via mqtt
2022-01-12T15:32:22.489143209Z [2022-01-12 15:32:19] frigate.app                    INFO    : Camera processor started for framsidan: 245
2022-01-12T15:32:22.489176993Z [2022-01-12 15:32:19] frigate.app                    INFO    : Camera processor started for baksidan: 247
2022-01-12T15:32:22.489204205Z [2022-01-12 15:32:19] frigate.app                    INFO    : Camera processor started for frontdoor: 249
2022-01-12T15:32:22.489235925Z [2022-01-12 15:32:19] frigate.app                    INFO    : Camera processor started for northside: 250
2022-01-12T15:32:22.489267865Z [2022-01-12 15:32:19] frigate.app                    INFO    : Camera processor started for carport: 251
2022-01-12T15:32:22.489299185Z [2022-01-12 15:32:19] frigate.app                    INFO    : Capture process started for framsidan: 252
2022-01-12T15:32:22.489329332Z [2022-01-12 15:32:19] frigate.app                    INFO    : Capture process started for baksidan: 254
2022-01-12T15:32:22.489363477Z [2022-01-12 15:32:19] frigate.app                    INFO    : Capture process started for frontdoor: 259
2022-01-12T15:32:22.489392943Z [2022-01-12 15:32:19] frigate.app                    INFO    : Capture process started for northside: 263
2022-01-12T15:32:22.489425926Z [2022-01-12 15:32:19] frigate.app                    INFO    : Capture process started for carport: 269
2022-01-12T15:32:22.489458798Z [2022-01-12 15:32:19] ws4py                          INFO    : Using epoll
2022-01-12T15:32:22.491043579Z [2022-01-12 15:32:22] frigate.edgetpu                INFO    : TPU found
2022-01-12T15:32:27.490316515Z [2022-01-12 15:32:27] frigate.video                  INFO    : carport: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
2022-01-12T15:32:27.490350911Z [2022-01-12 15:32:27] frigate.video                  INFO    : carport: ffmpeg process is not running. exiting capture thread...
2022-01-12T15:32:32.221590898Z [2022-01-12 15:32:32] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:43428]
2022-01-12T15:32:34.534064313Z [2022-01-12 15:32:34] frigate.mqtt                   INFO    : Turning on recordings for baksidan via mqtt
2022-01-12T15:32:35.491048301Z [2022-01-12 15:32:35] frigate.mqtt                   INFO    : Turning on recordings for carport via mqtt
2022-01-12T15:32:36.865610935Z [2022-01-12 15:32:36] frigate.mqtt                   INFO    : Turning on recordings for frontdoor via mqtt
2022-01-12T15:32:37.646589198Z [2022-01-12 15:32:37] frigate.mqtt                   INFO    : Turning on recordings for framsidan via mqtt

FFprobe output from your camera

Results from one of 5 cameras. 


ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100

Frigate stats

{"baksidan":{"camera_fps":5.0,"capture_pid":254,"detection_fps":0.2,"pid":246,"process_fps":5.0,"skipped_fps":0.0},"carport":{"camera_fps":2.5,"capture_pid":271,"detection_fps":0.0,"pid":250,"process_fps":2.5,"skipped_fps":0.0},"detection_fps":0.2,"detectors":{"coral":{"detection_start":0.0,"inference_speed":7.48,"pid":225}},"framsidan":{"camera_fps":5.1,"capture_pid":252,"detection_fps":0.0,"pid":245,"process_fps":5.1,"skipped_fps":0.0},"frontdoor":{"camera_fps":5.0,"capture_pid":259,"detection_fps":0.0,"pid":247,"process_fps":5.0,"skipped_fps":0.0},"northside":{"camera_fps":5.0,"capture_pid":263,"detection_fps":0.0,"pid":248,"process_fps":5.0,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":1065.5,"mount_type":"tmpfs","total":1073.7,"used":8.3},"/media/frigate/clips":{"free":664149.0,"mount_type":"cifs","total":965174.4,"used":301025.4},"/media/frigate/recordings":{"free":664149.0,"mount_type":"cifs","total":965174.4,"used":301025.4},"/tmp/cache":{"free":997.1,"mount_type":"tmpfs","total":1000.0,"used":2.9}},"temperatures":{},"uptime":81,"version":"0.10.0-db1255a"}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

1st Foscam and 4st SuperEye PC200

Any other information that may be helpful

Have not observed this behavior prior to Beta release of 0.10.*

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
blakeblackshearcommented, Jan 14, 2022

I think this may be a bug in the home assistant integration. I will open an issue there.

0reactions
haxneycommented, Jan 14, 2022

It makes sense that you would want the state message retained, but having the set message persisted seems to be at the heart of this problem. I don’t know MQTT well, but is there a way to “un-retain” or overwrite the set message? I would click the button on the Frigate web interface to re-enable snapshots, but it would still be lost when restarting Frigate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recording - Frigate Docs
WARNING: Recordings still must be enabled in the config. If a camera has recordings disabled in the config, enabling via the methods listed...
Read more >
Frigate and Home Assistant - YouTube
... Frigate integrates into Home Assistant. Using the Frigate HACS integration we can look at our live video streams, and recorded snapsh...
Read more >
Local Security Camera Recording with Frigate NVR - YouTube
Record your IP Security Camera footage locally with Frigate, running as a Home Assistant Add-On or on Docker. Why pay cloud companies a ......
Read more >
Frigate - Seeed Wiki
"Frigate is an open source NVR built around real-time AI object detection. ... WARNING: If recording is disabled in the config, turning it...
Read more >
Local realtime person detection for RTSP cameras
Stop frigate and delete the db file. You can also delete everything in the recordings folder. There is likely a message at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found