blakeblackshear / frigate

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

[Support]: 0.11.0 Beta-2 FFMpeg problem #3231

Closed jcastro closed 2 years ago

jcastro commented 2 years ago

Describe the problem you are having

Frigate is loading but I don't get any stream from my camera

Version

0.11.0-beta2

Frigate config file

mqtt:
  host: 10.0.1.30
  user: mosquitto
  password: XXXXX

cameras:
  entrance_cam:
    ffmpeg:
      inputs:
        - path: rtsp://10.0.1.116/11
          roles:
            - detect
    motion:
      threshold: 1
#      mask:
#        - 399,170,450,181,481,0,415,0
    detect:
      width: 640
      height: 360
      fps: 10
      # Optional: enables detection for the camera (default: True)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
      max_disappeared: 350
      stationary:
        interval: 90
        #threshold: 50
    objects:
      track:
        - person
      mask: 399,170,450,181,481,0,415,0
      filters:
        person:
          # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 5000
          # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 100000
          # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.75
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.70
    record:
      enabled: True
      retain_days: 1
      events:
        retain:
          default: 1
    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: True
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
      #height: 480
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 1
        # Optional: Per object retention days
        objects:
          person: 1

detectors:
  coral:
    type: edgetpu
    device: usb

Relevant log output

[2022-05-18 20:31:13] frigate.app                    INFO    : Starting Frigate (0.11.0-d2c3cdc)
[2022-05-18 20:31:13] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
Starting migrations
[2022-05-18 20:31:13] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-05-18 20:31:13] peewee_migrate                 INFO    : There is nothing to migrate
[2022-05-18 20:31:13] detector.coral                 INFO    : Starting detection process: 224
[2022-05-18 20:31:13] frigate.app                    INFO    : Output process started: 226
[2022-05-18 20:31:13] ws4py                          INFO    : Using epoll
[2022-05-18 20:31:13] frigate.app                    INFO    : Camera processor started for entrance_cam: 231
Process output_processor:
[2022-05-18 20:31:13] frigate.app                    INFO    : Capture process started for entrance_cam: 235
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/frigate/frigate/output.py", line 372, in output_frames
    converters[camera] = FFMpegConverter(
  File "/opt/frigate/frigate/output.py", line 36, in __init__
    self.process = sp.Popen(
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/frigate/frigate/video.py", line 215, in run
    self.start_ffmpeg_detect()
  File "/opt/frigate/frigate/video.py", line 276, in start_ffmpeg_detect
    self.ffmpeg_detect_process = start_or_restart_ffmpeg(
  File "/opt/frigate/frigate/video.py", line 133, in start_or_restart_ffmpeg
    process = sp.Popen(
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
[2022-05-18 20:31:14] ws4py                          INFO    : Using epoll
[2022-05-18 20:31:13] frigate.edgetpu                INFO    : Attempting to load TPU as usb

FFprobe output from your camera

root@fc1cf738322a:/opt/frigate# ffprobe rtsp://10.0.1.116/11
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
Input #0, rtsp, from 'rtsp://10.0.1.116/11':
  Metadata:
    title           : ww live test
  Duration: N/A, start: 0.050000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, progressive), 1280x720, 20 fps, 20 tbr, 90k tbn, 180k tbc

Frigate stats

{"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":10.0,"pid":224}},"entrance_cam":{"camera_fps":0.0,"capture_pid":235,"detection_fps":0.0,"pid":231,"process_fps":0.0,"skipped_fps":0.0},"service":{"latest_version":"0.10.1","storage":{"/dev/shm":{"free":66.8,"mount_type":"tmpfs","total":67.1,"used":0.3},"/media/frigate/clips":{"free":9579.8,"mount_type":"ext4","total":33501.8,"used":22187.2},"/media/frigate/recordings":{"free":9579.8,"mount_type":"ext4","total":33501.8,"used":22187.2},"/tmp/cache":{"free":1000.0,"mount_type":"tmpfs","total":1000.0,"used":0.0}},"temperatures":{},"uptime":284,"version":"0.11.0-d2c3cdc"}}

Operating system

Proxmox

Install method

Docker Compose

Coral version

USB

Network connection

Wireless

Camera make and model

Aqara G2H

Any other information that may be helpful

I had stable-amd64 docker image working flawlessly before tried to upgrade to 0.11 beta-2. Hope it helps and thanks a lot

NickM-27 commented 2 years ago

this is a duplicate of https://github.com/blakeblackshear/frigate/issues/3223

jcastro commented 2 years ago

I installed back stable-amd64 and also tried with 0.10.1-amd64 and while now the camera is working, I'm getting a weird behavior where each person identification never disappears and it just piles up. The picture below shows 2 times where I entered the room and now I exited it for more than an hour and it's still showing that. Is this a known bug? Did the 0.11 installation mess somehow with something in the migration part? Or is it just me doing something wrong? Thanks!

Screenshot 2022-05-18 at 22 50 59
NickM-27 commented 2 years ago

There's nothing about detection that is stored so it isn't having to do with 0.11. What do your logs say?

jcastro commented 2 years ago

@NickM-27 I don't have logger enabled on my config file (if that's what you mean?) but I'm seeing this logs on my docker

There is nothing to migrate
[2022-05-18 22:34:33] peewee_migrate                 INFO    : There is nothing to migrate
[2022-05-18 22:34:33] detector.coral                 INFO    : Starting detection process: 225
[2022-05-18 22:34:33] frigate.app                    INFO    : Output process started: 227
[2022-05-18 22:34:33] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-05-18 22:34:33] ws4py                          INFO    : Using epoll
[2022-05-18 22:34:33] frigate.app                    INFO    : Camera processor started for entrance_cam: 233
[2022-05-18 22:34:33] frigate.app                    INFO    : Capture process started for entrance_cam: 236
[2022-05-18 22:34:33] ws4py                          INFO    : Using epoll
[2022-05-18 22:34:35] frigate.edgetpu                INFO    : TPU found
Exception in thread event_processor:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3129, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: event.retain_indefinitely
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/opt/frigate/frigate/events.py", line 67, in run
    Event.replace(
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 1898, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 1969, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 2730, in _execute
    return super(Insert, self)._execute(database)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 2466, in _execute
    return self.handle_result(database, cursor)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 2739, in handle_result
    return database.last_insert_id(cursor, self._query_type)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3218, in last_insert_id
    return cursor.lastrowid
  File "/usr/local/lib/python3.8/dist-packages/playhouse/sqliteq.py", line 88, in lastrowid
    self._wait()
  File "/usr/local/lib/python3.8/dist-packages/playhouse/sqliteq.py", line 63, in _wait
    raise self._exc
  File "/usr/local/lib/python3.8/dist-packages/playhouse/sqliteq.py", line 178, in execute
    cursor = self.database._execute(obj.sql, obj.params, obj.commit)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3136, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 2902, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 185, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3129, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: event.retain_indefinitely

Thanks!

NickM-27 commented 2 years ago

Okay, so it isn't detection itself that is the issue but you downgraded without restoring the DB. In this case it is failing due to expected fields that are not being inserted in the older version.

jcastro commented 2 years ago

Oh I see, I will remove the db file then. Thanks a lot!

NickM-27 commented 2 years ago

In case you didn't see the resolution to the linked ticket: https://github.com/blakeblackshear/frigate/issues/3223#issuecomment-1130630138

This should be closable now 👍

stale[bot] commented 2 years ago

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.