blakeblackshear / frigate

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

[HW Accel Support]: hwaccel_args: preset-vaapi worked in 0.12 no longer in 0.13beta #7975

Closed rourke750 closed 11 months ago

rourke750 commented 11 months ago

Describe the problem you are having

ffmpeg: hwaccel_args: preset-vaapi

Used to work in 12 but now in 13 it no longer works.

Version

0.13.0-0858859

Frigate config file

mqtt:
  host: ####
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: ####
  password: #####

birdseye:
  enabled: True
  mode: continuous

#ffmpeg:
#  hwaccel_args: preset-vaapi
#  hwaccel_args: preset-rpi-64-h264

detectors:
  # Required: name of the detector
  coral:
    # Required: type of the detector
    # Valid values are 'edgetpu' (requires device property below) and 'cpu'.
    type: edgetpu
    # Optional: device name as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
    device: usb
    # Optional: num_threads value passed to the tflite.Interpreter (default: shown below)
    # This value is only used for CPU types
    num_threads: 3

#ffmpeg:
#  hwaccel_args: -c:v h264_v4l2m2m
go2rtc:
  streams:
    basement_camera:
      - rtsp://192.168.1.148:8554/basement
    front_door:
      - rtsp://192.168.1.148:8554/front
      - "ffmpeg:front_door#video=h264"
    garage:
      - rtsp://###:###@192.168.50.102:554/cam/realmonitor?channel=1&subtype=1
    backyard:
      - rtsp://###:###@192.168.50.104:554/cam/realmonitor?channel=1&subtype=1

cameras:
  # Required: name of the camera
  basement_camera:
    enabled: True
    # Required: ffmpeg settings for the camera
    ffmpeg:
      output_args: 
        record: preset-record-generic-audio-copy
      # Required: A list of input streams for the camera. See documentation for more information.
#      input_args:
#        - -avoid_negative_ts
#        - make_zero
#        - -fflags
#        - nobuffer
#        - -flags
#        - low_delay
#        - -strict
#        - experimental
#        - -fflags
#        - +genpts+discardcorrupt
#        - -use_wallclock_as_timestamps
#        - "1"
      inputs:
          # Required: the path to the stream
          # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}
        - path: rtsp://127.0.0.1:8554/basement_camera
          input_args: preset-rtsp-restream
          # Required: list of roles for this stream. valid values are: detect,record,rtmp
          # NOTICE: In addition to assigning the record, and rtmp roles,
          # they must also be enabled in the camera config.
          roles:
            - detect
            - record
    detect:
      # Optional: width of the frame for the input with the detect role (default: shown below)
      width: 1920
      # Optional: height of the frame for the input with the detect role (default: shown below)
      height: 1080
      # Optional: desired fps for your camera for the input with the detect role (default: shown below)
      # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
      fps: 5
      # 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: 25

    best_image_timeout: 60

    # Optional: 24/7 recording configuration
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain:
        days: 7
        mode: motion
      events:
#        enabled: True
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5
        # Optional: Objects to save events for. (default: all tracked objects)
        objects:
          - person
          - cat
        # Optional: Restrict events 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: 10
          mode: active_objects
          # Optional: Per object retention days

    objects:
      track:
        - person
        - cat
      filters:
        person:
          min_area: 5000
          max_area: 100000
          min_score: 0.5
          threshold: 0.7
  front_door:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door
          input_args: preset-rtsp-restream-low-latency
          #input_args: preset-rtsp-restream
          roles:
            - detect
            - record

    detect:
      # Optional: width of the frame for the input with the detect role (default: shown below)
      width: 1920
      # Optional: height of the frame for the input with the detect role (default: shown below)
      height: 1080
      # Optional: desired fps for your camera for the input with the detect role (default: shown below)
      # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
      fps: 5
      # 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: 25

    best_image_timeout: 60

    # Optional: 24/7 recording configuration
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain:
        days: 7
        mode: motion
      events:
#        enabled: True
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5
        # Optional: Objects to save events for. (default: all tracked objects)
        objects:
          - person
          - car
        # Optional: Restrict events 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: 10
          # Optional: Per object retention days

    objects:
      track:
        - person
        - car
        - cat
      filters:
        person:
          min_area: 5000
          max_area: 100000
          min_score: 0.5
          threshold: 0.7

  garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      # Optional: width of the frame for the input with the detect role (default: shown below)
      width: 704
      # Optional: height of the frame for the input with the detect role (default: shown below)
      height: 480
      # Optional: desired fps for your camera for the input with the detect role (default: shown below)
      # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
      fps: 5
      # 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: 25

    best_image_timeout: 60
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain:
        days: 7
        mode: motion
      events:
#        enabled: True
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5
        # Optional: Objects to save events for. (default: all tracked objects)
        objects:
          - person
          - car
        # Optional: Restrict events 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: 10
    objects:
      track:
        - person
        - car
        - cat

  backyard:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backyard
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      # Optional: width of the frame for the input with the detect role (default: shown below)
      width: 704
      # Optional: height of the frame for the input with the detect role (default: shown below)
      height: 480
      # Optional: desired fps for your camera for the input with the detect role (default: shown below)
      # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
      fps: 5
      # 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: 25

    best_image_timeout: 60
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain:
        days: 7
        mode: motion
      events:
#        enabled: True
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5
        # Optional: Objects to save events for. (default: all tracked objects)
        objects:
          - person
        # Optional: Restrict events 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: 10
    objects:
      track:
        - person
        - cat

docker-compose file or Docker CLI command

services:
  frigate:
    container_name: frigate
    restart: unless-stopped
    privileged: true
    image: ghcr.io/blakeblackshear/frigate:0.13.0-beta2
    shm_size: "100mb"
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /etc/localtime:/etc/localtime:ro
      - /home/rourke750/config:/config
      - /home/rourke750/clips:/clips
      - /home/rourke750/media:/media/frigate
      - type: tmpfs # 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 100000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "###"
      LIBVA_DRIVER_NAME: "radeonsi"
      DISPLAY: ":0.0"
      XDG_RUNTIME_DIR: "/run/user/1000"
      PLUS_API_KEY: "###"
    healthcheck:
      test: ["CMD", "wget" , "-q", "-O-", "http://localhost:5000"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 3m

Relevant log output

2023-09-27 19:00:42.100416564  [2023-09-27 19:00:42] frigate.video                  ERROR   : garage: ffmpeg process is not running. exiting capture thread...
2023-09-27 19:00:42.149366479  [2023-09-27 19:00:42] frigate.video                  ERROR   : backyard: Unable to read frames from ffmpeg process.
2023-09-27 19:00:42.149638745  [2023-09-27 19:00:42] frigate.video                  ERROR   : backyard: ffmpeg process is not running. exiting capture thread...
2023-09-27 19:00:45.811731726  [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd6c0007540] moov atom not found
2023-09-27 19:00:45.814628804  [ERROR:0@12.370] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
2023-09-27 19:00:45.814645719
2023-09-27 19:00:45.814665116  OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern'
2023-09-27 19:00:45.814670660
2023-09-27 19:00:45.814675441
2023-09-27 19:00:45.854760874  [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd6c0015b40] moov atom not found
2023-09-27 19:00:45.855135995  [ERROR:0@12.410] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
2023-09-27 19:00:45.855145766
2023-09-27 19:00:45.855156199  OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern'
2023-09-27 19:00:45.855161543
2023-09-27 19:00:45.855166421
2023-09-27 19:00:45.895336961  [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd6c0017c00] moov atom not found
2023-09-27 19:00:45.896416517  [ERROR:0@12.451] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
2023-09-27 19:00:45.896430893
2023-09-27 19:00:45.896439216  OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern'
2023-09-27 19:00:45.896443780
2023-09-27 19:00:45.896447803
2023-09-27 19:00:45.940160466  [2023-09-27 19:00:45] frigate.record.maintainer      WARNING : Failed to probe corrupt segment /tmp/cache/backyard-20230927190042.mp4
2023-09-27 19:00:45.942546487  [2023-09-27 19:00:45] frigate.record.maintainer      WARNING : Discarding a corrupt recording segment: /tmp/cache/backyard-20230927190042.mp4

FFprobe output from your camera

ffprobe rtsp://127.0.0.1:8554/garage
ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[rtsp @ 0x5617b3945140] method SETUP failed: 461 Unsupported transport

Input #0, rtsp, from 'rtsp://127.0.0.1:8554/garage':
  Metadata:
    title           : go2rtc/1.7.1
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 704x480, 5 fps, 100 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 8000 Hz, mono, fltp

Operating system

Debian

Install method

Docker Compose

Network connection

Mixed

Camera make and model

amcrest

Any other information that may be helpful

Did work in 12 no longer in 13. Removing the hw acceleration option everything works.

rourke750 commented 11 months ago

libva info: VA-API version 1.10.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so libva info: Found init function __vaDriverInit_1_10 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.10 (libva 2.10.0) vainfo: Driver version: Mesa Gallium driver 20.3.5 for AMD KABINI (DRM 2.50.0, 5.10.0-22-amd64, LLVM 11.0.1) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileNone : VAEntrypointVideoProc

NickM-27 commented 11 months ago

This doesn't look like it has anything to do with preset-vaapi, please include a full set of logs after frigate has run for longer

rourke750 commented 11 months ago

2023-09-27 19:32:07.513946479 [INFO] Preparing Frigate... 2023-09-27 19:32:07.559749235 [INFO] Starting Frigate... 2023-09-27 19:32:12.245264010 [2023-09-27 19:32:12] frigate.app INFO : Starting Frigate (0.13.0-0858859) 2023-09-27 19:32:12.507945849 [2023-09-27 19:32:12] peewee_migrate.logs INFO : Starting migrations 2023-09-27 19:32:12.529716052 [2023-09-27 19:32:12] peewee_migrate.logs INFO : There is nothing to migrate 2023-09-27 19:32:12.549671470 [2023-09-27 19:32:12] frigate.app INFO : Recording process started: 294 2023-09-27 19:32:12.558782918 [2023-09-27 19:32:12] frigate.app INFO : go2rtc process pid: 89 2023-09-27 19:32:12.626036940 [2023-09-27 19:32:12] detector.coral INFO : Starting detection process: 304 2023-09-27 19:32:12.633009872 [2023-09-27 19:32:12] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-09-27 19:32:15.367763201 [2023-09-27 19:32:12] frigate.app INFO : Output process started: 306 2023-09-27 19:32:15.367784626 [2023-09-27 19:32:12] frigate.app INFO : Camera processor started for basement_camera: 310 2023-09-27 19:32:15.367806448 [2023-09-27 19:32:12] frigate.app INFO : Camera processor started for front_door: 312 2023-09-27 19:32:15.367818091 [2023-09-27 19:32:12] frigate.app INFO : Camera processor started for garage: 316 2023-09-27 19:32:15.368592332 [2023-09-27 19:32:12] frigate.app INFO : Camera processor started for backyard: 319 2023-09-27 19:32:15.368660106 [2023-09-27 19:32:12] frigate.app INFO : Capture process started for basement_camera: 322 2023-09-27 19:32:15.371210074 [2023-09-27 19:32:12] frigate.app INFO : Capture process started for front_door: 326 2023-09-27 19:32:15.372734010 [2023-09-27 19:32:12] frigate.app INFO : Capture process started for garage: 330 2023-09-27 19:32:15.373603726 [2023-09-27 19:32:12] frigate.app INFO : Capture process started for backyard: 336 2023-09-27 19:32:15.380535243 [2023-09-27 19:32:15] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found 2023-09-27 19:32:18.875444338 [2023-09-27 19:32:18] frigate.video ERROR : garage: Unable to read frames from ffmpeg process. 2023-09-27 19:32:18.875991740 [2023-09-27 19:32:18] frigate.video ERROR : garage: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:18.885618370 [2023-09-27 19:32:18] frigate.video ERROR : front_door: Unable to read frames from ffmpeg process. 2023-09-27 19:32:18.885905131 [2023-09-27 19:32:18] frigate.video ERROR : front_door: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:19.114393454 [2023-09-27 19:32:19] frigate.video ERROR : backyard: Unable to read frames from ffmpeg process. 2023-09-27 19:32:19.114929381 [2023-09-27 19:32:19] frigate.video ERROR : backyard: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:21.783258880 [2023-09-27 19:32:21] frigate.video ERROR : basement_camera: Unable to read frames from ffmpeg process. 2023-09-27 19:32:21.783517925 [2023-09-27 19:32:21] frigate.video ERROR : basement_camera: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:22.597042457 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f962c007780] moov atom not found 2023-09-27 19:32:22.599961121 [ERROR:0@12.397] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception: 2023-09-27 19:32:22.599974340
2023-09-27 19:32:22.599985132 OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern' 2023-09-27 19:32:22.599990491
2023-09-27 19:32:22.599995359
2023-09-27 19:32:22.641104062 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f962c015d00] moov atom not found 2023-09-27 19:32:22.641560983 [ERROR:0@12.439] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception: 2023-09-27 19:32:22.641570558
2023-09-27 19:32:22.641580909 OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern' 2023-09-27 19:32:22.641586190
2023-09-27 19:32:22.641591058
2023-09-27 19:32:22.682222188 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f962c017900] moov atom not found 2023-09-27 19:32:22.682587631 [ERROR:0@12.480] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception: 2023-09-27 19:32:22.682595586
2023-09-27 19:32:22.682604248 OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern' 2023-09-27 19:32:22.682608791
2023-09-27 19:32:22.682612893
2023-09-27 19:32:22.721971275 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f962c019000] moov atom not found 2023-09-27 19:32:22.722370090 [ERROR:0@12.519] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception: 2023-09-27 19:32:22.722423347
2023-09-27 19:32:22.722431623 OpenCV(4.7.0) /io/opencv/modules/videoio/src/cap_images.cpp:267: error: (-215:Assertion failed) number < max_number in function 'icvExtractPattern' 2023-09-27 19:32:22.722436164
2023-09-27 19:32:22.722440310
2023-09-27 19:32:22.767457654 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Failed to probe corrupt segment /tmp/cache/backyard-20230927193219.mp4 2023-09-27 19:32:22.768478749 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Discarding a corrupt recording segment: /tmp/cache/backyard-20230927193219.mp4 2023-09-27 19:32:22.770157188 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Failed to probe corrupt segment /tmp/cache/basement_camera-20230927193221.mp4 2023-09-27 19:32:22.771494338 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Discarding a corrupt recording segment: /tmp/cache/basement_camera-20230927193221.mp4 2023-09-27 19:32:22.772644293 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Failed to probe corrupt segment /tmp/cache/front_door-20230927193218.mp4 2023-09-27 19:32:22.773602489 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Discarding a corrupt recording segment: /tmp/cache/front_door-20230927193218.mp4 2023-09-27 19:32:22.779300433 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Failed to probe corrupt segment /tmp/cache/garage-20230927193218.mp4 2023-09-27 19:32:22.780423589 [2023-09-27 19:32:22] frigate.record.maintainer WARNING : Discarding a corrupt recording segment: /tmp/cache/garage-20230927193218.mp4 2023-09-27 19:32:32.847740491 [2023-09-27 19:32:32] watchdog.basement_camera ERROR : Ffmpeg process crashed unexpectedly for basement_camera. 2023-09-27 19:32:32.848205909 [2023-09-27 19:32:32] watchdog.basement_camera ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-09-27 19:32:32.848648141 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : [h264 @ 0x5648d6905b00] No support for codec h264 profile 77. 2023-09-27 19:32:32.849113511 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : [h264 @ 0x5648d6905b00] Failed setup for format vaapi: hwaccel initialisation returned error. 2023-09-27 19:32:32.849501430 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : Impossible to convert between the formats supported by the filter 'Parsed_fps_0' and the filter 'auto_scale_0' 2023-09-27 19:32:32.849975222 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : Error reinitializing filters! 2023-09-27 19:32:32.850283085 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : Failed to inject frame into filter network: Function not implemented 2023-09-27 19:32:32.850839278 [2023-09-27 19:32:32] ffmpeg.basement_camera.detect ERROR : Error while processing the decoded data for stream #0:0 2023-09-27 19:32:32.875519531 [2023-09-27 19:32:32] watchdog.front_door ERROR : Ffmpeg process crashed unexpectedly for front_door. 2023-09-27 19:32:32.876375614 [2023-09-27 19:32:32] watchdog.front_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-09-27 19:32:32.877089179 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : [h264 @ 0x556d28a0ffc0] No support for codec h264 profile 100. 2023-09-27 19:32:32.877740384 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : [h264 @ 0x556d28a0ffc0] Failed setup for format vaapi: hwaccel initialisation returned error. 2023-09-27 19:32:32.878382799 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : Impossible to convert between the formats supported by the filter 'Parsed_fps_0' and the filter 'auto_scale_0' 2023-09-27 19:32:32.879002973 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : Error reinitializing filters! 2023-09-27 19:32:32.879657696 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : Failed to inject frame into filter network: Function not implemented 2023-09-27 19:32:32.880326393 [2023-09-27 19:32:32] ffmpeg.front_door.detect ERROR : Error while processing the decoded data for stream #0:0 2023-09-27 19:32:32.888432214 [2023-09-27 19:32:32] watchdog.garage ERROR : Ffmpeg process crashed unexpectedly for garage. 2023-09-27 19:32:32.912907270 [2023-09-27 19:32:32] watchdog.garage ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-09-27 19:32:32.912934101 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : [segment @ 0x5651cadd5100] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly 2023-09-27 19:32:32.912940436 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : [h264 @ 0x5651cb18de40] No support for codec h264 profile 77. 2023-09-27 19:32:32.912946531 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : [h264 @ 0x5651cb18de40] Failed setup for format vaapi: hwaccel initialisation returned error. 2023-09-27 19:32:32.912955685 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : Impossible to convert between the formats supported by the filter 'Parsed_fps_0' and the filter 'auto_scale_0' 2023-09-27 19:32:32.913029558 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : Error reinitializing filters! 2023-09-27 19:32:32.913037025 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : Failed to inject frame into filter network: Function not implemented 2023-09-27 19:32:32.913076400 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : Error while processing the decoded data for stream #0:0 2023-09-27 19:32:32.937702693 [2023-09-27 19:32:32] watchdog.backyard ERROR : Ffmpeg process crashed unexpectedly for backyard. 2023-09-27 19:32:32.937722854 [2023-09-27 19:32:32] watchdog.backyard ERROR : The following ffmpeg logs include the last 100 lines prior to exit. 2023-09-27 19:32:32.937729425 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : [segment @ 0x5583954e8600] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly 2023-09-27 19:32:32.937734874 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : [h264 @ 0x5583958a2c00] No support for codec h264 profile 77. 2023-09-27 19:32:32.937739980 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : [h264 @ 0x5583958a2c00] Failed setup for format vaapi: hwaccel initialisation returned error. 2023-09-27 19:32:32.937745410 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : Impossible to convert between the formats supported by the filter 'Parsed_fps_0' and the filter 'auto_scale_0' 2023-09-27 19:32:32.937749759 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : Error reinitializing filters! 2023-09-27 19:32:32.937754263 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : Failed to inject frame into filter network: Function not implemented 2023-09-27 19:32:32.937758468 [2023-09-27 19:32:32] ffmpeg.backyard.detect ERROR : Error while processing the decoded data for stream #0:0 2023-09-27 19:32:38.861411677 [2023-09-27 19:32:38] frigate.video ERROR : garage: Unable to read frames from ffmpeg process. 2023-09-27 19:32:38.861425931 [2023-09-27 19:32:38] frigate.video ERROR : garage: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:38.903460335 [2023-09-27 19:32:38] frigate.video ERROR : front_door: Unable to read frames from ffmpeg process. 2023-09-27 19:32:38.903780496 [2023-09-27 19:32:38] frigate.video ERROR : front_door: ffmpeg process is not running. exiting capture thread... 2023-09-27 19:32:39.033830093 [2023-09-27 19:32:39] frigate.video ERROR : backyard: Unable to read frames from ffmpeg process. 2023-09-27 19:32:39.034051035 [2023-09-27 19:32:39] frigate.video ERROR : backyard: ffmpeg process is not running. exiting capture thread...

rourke750 commented 11 months ago

And without it

2023-09-27 19:33:20.976221998 [INFO] Preparing Frigate... 2023-09-27 19:33:21.019687926 [INFO] Starting Frigate... 2023-09-27 19:33:25.654490410 [2023-09-27 19:33:25] frigate.app INFO : Starting Frigate (0.13.0-0858859) 2023-09-27 19:33:25.917919513 [2023-09-27 19:33:25] peewee_migrate.logs INFO : Starting migrations 2023-09-27 19:33:25.937635040 [2023-09-27 19:33:25] peewee_migrate.logs INFO : There is nothing to migrate 2023-09-27 19:33:25.952329703 [2023-09-27 19:33:25] frigate.app INFO : Recording process started: 295 2023-09-27 19:33:25.961597235 [2023-09-27 19:33:25] frigate.app INFO : go2rtc process pid: 89 2023-09-27 19:33:26.049173364 [2023-09-27 19:33:26] detector.coral INFO : Starting detection process: 305 2023-09-27 19:33:28.757870608 [2023-09-27 19:33:26] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb 2023-09-27 19:33:28.759148102 [2023-09-27 19:33:26] frigate.app INFO : Output process started: 307 2023-09-27 19:33:28.759540639 [2023-09-27 19:33:26] frigate.app INFO : Camera processor started for basement_camera: 312 2023-09-27 19:33:28.759813433 [2023-09-27 19:33:26] frigate.app INFO : Camera processor started for front_door: 316 2023-09-27 19:33:28.759937967 [2023-09-27 19:33:26] frigate.app INFO : Camera processor started for garage: 318 2023-09-27 19:33:28.760133875 [2023-09-27 19:33:26] frigate.app INFO : Camera processor started for backyard: 320 2023-09-27 19:33:28.760344104 [2023-09-27 19:33:26] frigate.app INFO : Capture process started for basement_camera: 323 2023-09-27 19:33:28.760553059 [2023-09-27 19:33:26] frigate.app INFO : Capture process started for front_door: 327 2023-09-27 19:33:28.760763012 [2023-09-27 19:33:26] frigate.app INFO : Capture process started for garage: 333 2023-09-27 19:33:28.760970958 [2023-09-27 19:33:26] frigate.app INFO : Capture process started for backyard: 338 2023-09-27 19:33:28.770378343 [2023-09-27 19:33:28] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found

NickM-27 commented 11 months ago

Here we go

2023-09-27 19:32:32.912940436 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : [h264 @ 0x5651cb18de40] No support for codec h264 profile 77.
2023-09-27 19:32:32.912946531 [2023-09-27 19:32:32] ffmpeg.garage.detect ERROR : [h264 @ 0x5651cb18de40] Failed setup for format vaapi: hwaccel initialisation returned error.

The necessary profiles are missing from the GPU. I'd suggest making sure the diver on the host is up to date and also choosing the most basic of profiles on the camera (h264 baseline)

rourke750 commented 11 months ago

But today before updating to .13 it worked and right after updating to 13 it stopped.

NickM-27 commented 11 months ago

That's why I suggest updating the driver version on the host, it's possible the container has a newer AMD driver than 0.12

rourke750 commented 11 months ago

What driver version do you have for your host?

NickM-27 commented 11 months ago

That's not relevant because we have different GPUs

rourke750 commented 11 months ago

Well I managed to upgrade to vainfo: Driver version: Mesa Gallium driver 22.3.6 for KABINI (, LLVM 15.0.6, DRM 2.50, 6.1.0-12-amd64) and I was following this guide https://wiki.debian.org/AtiHowTo but Im still having issues. Frigate's documentation says https://deploy-preview-6262--frigate-docs.netlify.app/configuration/hardware_acceleration/#amdati-gpus-radeon-hd-2000-and-newer-gpus-via-libva-mesa-driver that radeon-hd-2000 and newer should work and I have Radeon HD 8330E and based on another issue that I previously commented on it seems like we went from a version of frigate that worked to one that didnt.

If you could post yours it could at least help in see if Im wasting my time trying to get this to work. Ie if you have an older card and older drivers or if you have a newer card and older drivers or if you have an older card and newer drivers.

NickM-27 commented 11 months ago

I have the 5700G and I'm use the iGPU which I believe is Vega2, unfortunately I am running unRAID and it does not have the ability to install vainfo to get that info.

What version of the driver do you see inside the container?

NickM-27 commented 11 months ago

when running vainfo inside the container I get

libva info: VA-API version 1.19.0
libva info: User environment variable requested driver 'radeonsi'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_19
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 23.1.7-1 for AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.49-Unraid)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
rourke750 commented 11 months ago

Inside container I get

vainfo: VA-API version: 1.19 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 23.1.7-1 for KABINI (, LLVM 15.0.7, DRM 2.50, 6.1.0-12-amd64)
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc

which has a higher version than my host. So Let me keep trying to upgrade to a higher version and see if that helps.

NickM-27 commented 11 months ago

I have pushed up a test image to crzynik/frigate:latest which is 0.13 except that it uses the non testing version of the AMD driver. Please try that image and let me know if it fixes the issue

rourke750 commented 11 months ago

Do you pass your gpu to the docker image? I wasnt doing that before but I wonder if I should now

NickM-27 commented 11 months ago

Do you pass your gpu to the docker image? I wasnt doing that before but I wonder if I should now

you are doing it, when you have priviliged: true all /dev/ are passed to the container

rourke750 commented 11 months ago

Still is 23.1.7-1 which is the same version that was before. Latest Debian 12 drivers are 22.3.6-1.

[trixie (testing)](https://packages.debian.org/trixie/libgl1-mesa-dri) (libs): free implementation of the OpenGL API -- DRI modules
23.2.0~rc3-3: amd64 arm64 armel armhf i386 mips64el ppc64el s390x
[sid (unstable)](https://packages.debian.org/sid/libgl1-mesa-dri) (libs): free implementation of the OpenGL API -- DRI modules
23.2.0~rc4-1: alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips64el ppc64 ppc64el riscv64 s390x
23.2.0~rc3-3 [[debports](https://www.ports.debian.org/)]: x32
23.1.3-1 [[debports](https://www.ports.debian.org/)]: sh4
22.3.3-1 [[debports](https://www.ports.debian.org/)]: sparc64
rourke750 commented 11 months ago

23.1.7-1 seems really, really new. any way we can downgrade to at least debian latest?

NickM-27 commented 11 months ago

it is a testing driver, we have to use the testing drivers for the intel side of things and amd was followed as well. The image that I put up is pulling from the non testing repo so it is using the normal latest

rourke750 commented 11 months ago

looks the same

libva info: VA-API version 1.19.0
libva info: User environment variable requested driver 'radeonsi'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 23.1.7-1 for KABINI (, LLVM 15.0.7, DRM 2.50, 6.1.0-12-amd64)
vainfo: Supported profile and entrypoints

Let me try install the testing drivers. I only use this machine for frigate so...

NickM-27 commented 11 months ago

I just tried the frigate image and this is what I am seeing, definitely an older version

Driver version: Mesa Gallium driver 20.3.5 for AMD RENOIR (DRM 3.49.0, 6.1.49-Unraid, LLVM 11.0.1)
rourke750 commented 11 months ago

can you give me a more explicit tag than latest for the docker image

NickM-27 commented 11 months ago

oh that's my bad, I think my change didn't get saved, it is supposed to be crzynik/frigate:amd-test

rourke750 commented 11 months ago

it works now with hardware acceleration

NickM-27 commented 11 months ago

Okay, will need to see what version was used in 0.12 and see if we can pin to that version

rourke750 commented 11 months ago

Thanks for the help!

NickM-27 commented 11 months ago

Driver version in 0.12 is vainfo: Driver version: Mesa Gallium driver 22.3.6 for AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.49, 6.1.49-Unraid)

rourke750 commented 11 months ago

And keep in mind I believe thats only debian 12, debian 11 I think is a version lower.

NickM-27 commented 11 months ago

can you please try crzynik/frigate:latest now and see if it works?

rourke750 commented 11 months ago

latest does not work

rourke750 commented 11 months ago

I do see

vainfo: VA-API version: 1.20 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 23.2.0~rc3-3 for KABINI (, LLVM 15.0.7, DRM 2.50, 6.1.0-12-amd64)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

from latest but on amd-test

libva info: VA-API version 1.20.0
libva info: User environment variable requested driver 'radeonsi'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 20.3.5 for AMD KABINI (DRM 2.50.0, 6.1.0-12-amd64, LLVM 11.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileNone                   : VAEntrypointVideoProc
rourke750 commented 11 months ago

amd-test works latest does not.

NickM-27 commented 11 months ago

okay, unfortunately I am not sure what the right solution is, the testing versions are not archived so we can't pull from what was used in 0.12. which means we'd have to make the version inside the container go back to 20.x which is quite a bit older and likely not supporting newer AMD GPUs

NickM-27 commented 11 months ago

I'm assuming this is some sort of bug or something with the driver, it is not clear why fewer profiles are supported on newer driver version

rourke750 commented 11 months ago

Can we do two things, 1. update the documentation for the new minimum amd graphics card set. 2. If its possible can we have two versions one released as old amd, one for new. Just make the old amd a new tag or something. Im sure theres a lot of people that have these hp thin clients and would benefit from this. Especially from moving from raspberry pi to these.

NickM-27 commented 11 months ago

I don't think separate releases makes sense, that is more to maintain and will cause confusion (we already have confusion between the normal and -tensorrt tags)

will have to see what makes the most sense to do

rourke750 commented 11 months ago

Is it not a simple arg change in the dockerfile? Either way let me know if you need me to test changes.