blakeblackshear / frigate

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

[HW Accel Support]: Minisforum GK41 & crop stream #7447

Closed mr-manuel closed 1 year ago

mr-manuel commented 1 year ago

Describe the problem you are having

Since it was recommended in the documentation I ordered this PC because I had problems with the TPU in a VM. The TPU now works great, but the hardware accelleration does not.

I did everything like the Hardware Accelleration docs said, but then I have only a freezed image. There are no errors in the logs.

Version

0.12.1-367d724

Frigate config file

mqtt:
  host: 192.168.1.203
  port: 1883
  stats_interval: 15

detectors:
  coral:
    type: edgetpu
    device: usb

database:
  path: /database/frigate.db

logger:
  default: info
  logs:
    frigate.mqtt: error

birdseye:
  enabled: true
  width: 2250
  height: 1150
  quality: 8
  mode: objects

#ffmpeg:
  ## Optional: global ffmpeg args (default: shown below)
  #global_args: -hide_banner -loglevel warning
  # Optional: global hwaccel args (default: shown below)
  # NOTE: See hardware acceleration docs for your specific device
#  hwaccel_args: preset-vaapi  # tried with and without
#  hwaccel_args: preset-intel-qsv-h264  # tried with and without

detect:
  fps: 10
  enabled: true
  max_disappeared: 25
  stationary:
    interval: 0
    threshold: 50
    max_frames:
      default: 3000
      objects:
        person: 1000

objects:
  filters:
    person:
      min_area: 0
      max_area: 24000000
      min_score: 0.5
      threshold: 0.7

motion:
  threshold: 25
  contour_area: 30
  delta_alpha: 0.2
  frame_alpha: 0.2
  frame_height: 50
  improve_contrast: false
  mqtt_off_delay: 30

record:
  enabled: true
  expire_interval: 60
  retain:
    days: 2
    mode: all
  events:
    pre_capture: 5
    post_capture: 5
    retain:
      default: 7
      mode: motion
      objects:
        person: 14

snapshots:
  enabled: true
  timestamp: false
  bounding_box: false
  crop: true
  retain:
    default: 7
    objects:
      person: 14

rtmp:
  enabled: false

live:
  height: 1120
  quality: 8

cameras:

  Driveway:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.80:554/11
          roles:
            - detect
            - record
    detect:
      width: 2560
      height: 1920
    best_image_timeout: 60
    zones:
      Klingel:
        coordinates: 1835,841,2431,340,1956,75
        objects:
          - person
    motion:
      mask:
        - 0,0,1521,0,1519,218,1540,526,1580,811,1475,1237,245,1778,627,2011,999,2144,0,2144
        - 3840,0,3840,674,3116,0
        - 3840,2144,3840,1643,3622,1824,3322,1997,2990,2144
    record:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      quality: 70
    objects:
      track:
        - person
        - bird
        - cat
        - dog
    ui:
      order: 0
      dashboard: true

  Porch:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.81:554/stream0
          roles:
            - detect
            - record
    detect:
      width: 3840
      height: 2144
    best_image_timeout: 60
    zones:
      Parkplatz:
        coordinates: 2270,683,1579,814,1499,1076,1442,1349,1340,1793,1492,1766,1500,2144,2854,2144,2832,2004,3138,1621,3310,1556,3108,984,2757,393,2355,409
      Strasse_Ortnerweg:
        coordinates: 3150,0,3840,696,3840,1647,3741,1749,3620,1342,3452,979,3263,671,2955,341,2834,223,2811,315,2694,283,2447,281,2459,95,2401,0
        objects:
          - bicycle
          - car
          - motorcycle
      Treppe:
        coordinates: 951,1966,1124,2016,1146,2144,1504,2144,1500,1785,1316,1827,1308,1546,1027,1643
      Tuer:
        coordinates: 3310,1556,3341,1642,3442,1950,3295,2037,3058,2144,2863,2144,2832,2004,3138,1621
    motion:
      mask:
        - 0,0,1521,0,1519,218,1540,526,1580,811,1475,1237,245,1778,627,2011,999,2144,0,2144
        - 3840,0,3840,674,3116,0
        - 3840,2144,3840,1643,3622,1824,3322,1997,2990,2144
    record:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      quality: 70
    objects:
      track:
        - person
        - bicycle
        - car
        - motorcycle
        - bird
        - cat
        - dog
      filters:
        person:
          mask: 3334,1191,3471,1503,3581,1862,3840,1655,3840,0,0,0,0,2144,889,2144,1046,1579,1408,1410,1584,818,2266,675,2271,433,2794,380,3153,858
    ui:
      order: 1
      dashboard: true

docker-compose file or Docker CLI command

version: '3.9'
services:
  frigate:
    container_name: frigate
    shm_size: '1024m'
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:0.12.1
    devices:
      - /dev/bus/usb:/dev/bus/usb   # Coral USB
      - /dev/dri/renderD128         # for Intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${FRIGATE_ROOT_PATH}/config/config.yml:/config/config.yml
      - ${FRIGATE_ROOT_PATH}/database:/database
      - ${FRIGATE_ROOT_PATH}/media/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 2G
    ports:
      - '80:5000'
      - '5000:5000'
      - '8554:8554' # RTSP feeds
      - '8555:8555' # WebRTC
    environment:
      - 'FRIGATE_RTSP_USER=${FRIGATE_RTSP_USER}'
      - 'FRIGATE_RTSP_PASSWORD=${FRIGATE_RTSP_PASSWORD}'
      # needed for Intel J4125 CPU hardware acceleration
      - 'LIBVA_DRIVER_NAME_JELLYFIN=i965' # tried with and without

Relevant log output

2023-08-11 11:22:36.134282754  [INFO] Starting Frigate...
2023-08-11 11:22:37.666687808  [2023-08-11 11:22:37] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-11 11:22:37.763619449  [2023-08-11 11:22:37] peewee_migrate                 INFO    : Starting migrations
2023-08-11 11:22:37.769969824  [2023-08-11 11:22:37] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-11 11:22:37.798062766  [2023-08-11 11:22:37] detector.coral                 INFO    : Starting detection process: 290
2023-08-11 11:22:40.454845379  [2023-08-11 11:22:37] frigate.app                    INFO    : Output process started: 292
2023-08-11 11:22:40.455106147  [2023-08-11 11:22:37] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-11 11:22:40.455246792  [2023-08-11 11:22:37] frigate.app                    INFO    : Camera processor started for Driveway: 298
2023-08-11 11:22:40.455338079  [2023-08-11 11:22:37] frigate.app                    INFO    : Camera processor started for Porch: 299
2023-08-11 11:22:40.455600146  [2023-08-11 11:22:37] frigate.app                    INFO    : Capture process started for Driveway: 301
2023-08-11 11:22:40.455693781  [2023-08-11 11:22:37] frigate.app                    INFO    : Capture process started for Porch: 304
2023-08-11 11:22:40.462334084  [2023-08-11 11:22:40] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found

FFprobe output from your camera

# Driveway
# root@2770b2541206:/opt/frigate# ffprobe rtsp://192.168.1.80/11
# 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
# Input #0, rtsp, from 'rtsp://192.168.1.80/11':
#   Metadata:
#     title           : 10
#   Duration: N/A, start: 0.160000, bitrate: N/A
#   Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 2560x1920, 12.50 tbr, 90k tbn

# Porch
# root@2770b2541206:/opt/frigate# ffprobe rtsp://192.168.1.81/stream0
# 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
# Input #0, rtsp, from 'rtsp://192.168.1.81/stream0':
#   Metadata:
#     title           : RTSP/RTP stream from anjvision ipcamera
#   Duration: N/A, start: 0.100000, bitrate: N/A
#   Stream #0:0: Video: h264 (Main), yuv420p(progressive), 3840x2144, 20 fps, 10 tbr, 90k tbn

Operating system

Other Linux

Install method

Docker Compose

Network connection

Wired

Camera make and model

Aliexpress

Any other information that may be helpful

Without hardware acceleration all is working fine, but I bought this mini pc because it should work with it :-)

VA Info

Return Code: 0

Process Output:

vainfo: VA-API version: 1.17 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
NickM-27 commented 1 year ago

you need to include the logs or something that actually shows the problem, otherwise there is nothing to go off of

NickM-27 commented 1 year ago

also you're using the wrong env variable, it should be LIBVA_DRIVER_NAME=i965

mr-manuel commented 1 year ago

also you're using the wrong env variable, it should be LIBVA_DRIVER_NAME=i965

Damn. I was searching for so long and trying so much that I missed that. Thanks!

Now HW accel works, but my cropped streams not more. Maybe you also have a small hint for that?

The normal cameras Driveway and Porch are running fine.

Relevant config

cameras:

  X-Driveway-Zoom:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.80:554/11
          roles:
            - detect
      output_args:
        detect: -f rawvideo -vf crop=510:610:2000:130
    detect:
      width: 510
      height: 610
      enabled: false
    snapshots:
      enabled: false
    record:
      enabled: false
    mqtt:
      enabled: false
    ui:
      order: 10
      dashboard: true

  X-Porch-Zoom:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.81:554/stream0
          roles:
            - detect
      output_args:
        detect: -f rawvideo -vf crop=850:750:2970:1294
    detect:
      width: 850
      height: 750
      enabled: false
    snapshots:
      enabled: false
    record:
      enabled: false
    rtmp:
      enabled: false
    mqtt:
      enabled: false
    ui:
      order: 11
      dashboard: true

Processes

# without acceleration

root@frigate01:~# ps -aux | grep ffmpeg
root       74070  0.0  0.1 126812 15760 ?        Ss   13:19   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 2560x1920 -i pipe: -f mpegts -s 1493x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       74073  0.0  0.1 126812 15764 ?        Ss   13:19   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 3840x2144 -i pipe: -f mpegts -s 2005x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       74081  0.0  0.1 126812 15612 ?        Ss   13:19   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 510x610 -i pipe: -f mpegts -s 936x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       74091  0.0  0.1 126812 15724 ?        Ss   13:19   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 850x750 -i pipe: -f mpegts -s 1269x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       74094  0.0  0.1 126812 15604 ?        Ss   13:19   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 2250x1150 -i pipe: -f mpegts -s 2250x1150 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       74211 46.0  1.1 459316 90336 ?        Rsl  13:20   0:09 ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Driveway -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Driveway-%Y%m%d%H%M%S.mp4 -r 10 -s 2560x1920 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:
root       74212 57.6  1.8 439688 148872 ?       Ssl  13:20   0:11 ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Porch -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Porch-%Y%m%d%H%M%S.mp4 -r 10 -s 3840x2144 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:
root       74214 46.6  1.1 611580 90860 ?        Ssl  13:20   0:09 ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Porch -r 10 -s 850x750 -f rawvideo -vf crop=850:750:2970:1294 pipe:
root       74215 14.7  0.7 607848 60824 ?        Ssl  13:20   0:02 ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Driveway -r 10 -s 510x610 -f rawvideo -vf crop=510:610:2000:130 pipe:
root       74271  0.0  0.0   6432   724 pts/0    S+   13:20   0:00 grep --color=auto ffmpeg

# with acceleration

root@frigate01:~# ps -aux | grep ffmpeg
root       75229  0.0  0.1 126812 15684 ?        Ss   13:22   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 2560x1920 -i pipe: -f mpegts -s 1493x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       75232  0.0  0.1 126812 15716 ?        Ss   13:22   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 3840x2144 -i pipe: -f mpegts -s 2005x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       75237  0.0  0.1 126812 15600 ?        Ss   13:22   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 510x610 -i pipe: -f mpegts -s 936x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       75245  0.0  0.1 126812 15676 ?        Ss   13:22   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 850x750 -i pipe: -f mpegts -s 1269x1120 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       75252  0.0  0.1 126812 15592 ?        Ss   13:22   0:00 ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 2250x1150 -i pipe: -f mpegts -s 2250x1150 -codec:v mpeg1video -q 8 -bf 0 pipe:
root       75408 11.0  0.9 489720 76544 ?        Rsl  13:23   0:00 ffmpeg -hide_banner -loglevel warning -threads 2 -hwaccel_flags allow_profile_mismatch -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Driveway -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Driveway-%Y%m%d%H%M%S.mp4 -r 10 -vf fps=10,scale_vaapi=w=2560:h=1920,hwdownload,format=yuv420p -threads 2 -f rawvideo -pix_fmt yuv420p pipe:
root       75409 22.0  1.5 516412 125232 ?       Rsl  13:23   0:00 ffmpeg -hide_banner -loglevel warning -threads 2 -hwaccel_flags allow_profile_mismatch -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://127.0.0.1:8554/Porch -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Porch-%Y%m%d%H%M%S.mp4 -r 10 -vf fps=10,scale_vaapi=w=3840:h=2144,hwdownload,format=yuv420p -threads 2 -f rawvideo -pix_fmt yuv420p pipe:
root       75453  0.0  0.0   6432   720 pts/0    R+   13:23   0:00 grep --color=auto ffmpeg

Logs

2023-08-11 13:57:42.551434908  [INFO] Starting Frigate...
2023-08-11 13:57:43.979692550  [2023-08-11 13:57:43] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-11 13:57:44.101920604  [2023-08-11 13:57:44] peewee_migrate                 INFO    : Starting migrations
2023-08-11 13:57:44.108199015  [2023-08-11 13:57:44] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-11 13:57:44.134164523  [2023-08-11 13:57:44] detector.coral                 INFO    : Starting detection process: 290
2023-08-11 13:57:44.136479898  [2023-08-11 13:57:44] frigate.app                    INFO    : Output process started: 292
2023-08-11 13:57:44.139910141  [2023-08-11 13:57:44] frigate.app                    INFO    : Camera processor not started for disabled camera Driveway
2023-08-11 13:57:44.159031575  [2023-08-11 13:57:44] frigate.app                    INFO    : Camera processor started for Porch: 298
2023-08-11 13:57:44.159038977  [2023-08-11 13:57:44] frigate.app                    INFO    : Camera processor started for X-Driveway-Zoom: 299
2023-08-11 13:57:44.159045355  [2023-08-11 13:57:44] frigate.app                    INFO    : Camera processor started for X-Porch-Zoom: 300
2023-08-11 13:57:44.159048150  [2023-08-11 13:57:44] frigate.app                    INFO    : Capture process not started for disabled camera Driveway
2023-08-11 13:57:44.165981189  [2023-08-11 13:57:44] frigate.app                    INFO    : Capture process started for Porch: 301
2023-08-11 13:57:44.172982793  [2023-08-11 13:57:44] frigate.app                    INFO    : Capture process started for X-Driveway-Zoom: 305
2023-08-11 13:57:44.195343439  [2023-08-11 13:57:44] frigate.app                    INFO    : Capture process started for X-Porch-Zoom: 311
2023-08-11 13:57:46.781462715  [2023-08-11 13:57:44] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-11 13:57:46.788311436  [2023-08-11 13:57:46] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-08-11 13:57:46.827064526  [2023-08-11 13:57:46] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:57:46.827408632  [2023-08-11 13:57:46] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:57:47.029420337  [2023-08-11 13:57:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:57:47.029539316  [2023-08-11 13:57:47] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:04.220157206  [2023-08-11 13:58:04] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:04.220442640  [2023-08-11 13:58:04] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:04.220452681  [2023-08-11 13:58:04] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:04.220561257  [2023-08-11 13:58:04] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:04.230412174  [2023-08-11 13:58:04] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:04.230778824  [2023-08-11 13:58:04] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:04.230786037  [2023-08-11 13:58:04] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:04.230977197  [2023-08-11 13:58:04] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:06.820059489  [2023-08-11 13:58:06] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:06.820299701  [2023-08-11 13:58:06] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:07.002963375  [2023-08-11 13:58:07] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:07.003224281  [2023-08-11 13:58:07] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:14.237416736  [2023-08-11 13:58:14] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:14.237823453  [2023-08-11 13:58:14] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:14.237829467  [2023-08-11 13:58:14] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:14.237832448  [2023-08-11 13:58:14] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:14.248083641  [2023-08-11 13:58:14] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:14.248394167  [2023-08-11 13:58:14] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:14.248846002  [2023-08-11 13:58:14] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:14.248851639  [2023-08-11 13:58:14] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:16.797101956  [2023-08-11 13:58:16] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:16.797163721  [2023-08-11 13:58:16] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:17.102464553  [2023-08-11 13:58:17] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:17.102692789  [2023-08-11 13:58:17] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:24.259725347  [2023-08-11 13:58:24] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:24.259842008  [2023-08-11 13:58:24] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:24.259962070  [2023-08-11 13:58:24] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:24.260118422  [2023-08-11 13:58:24] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:24.266723157  [2023-08-11 13:58:24] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:24.267123024  [2023-08-11 13:58:24] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:24.267130802  [2023-08-11 13:58:24] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:24.267377843  [2023-08-11 13:58:24] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:26.795386966  [2023-08-11 13:58:26] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:26.795394346  [2023-08-11 13:58:26] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:27.090868613  [2023-08-11 13:58:27] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:27.091054159  [2023-08-11 13:58:27] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:34.276904720  [2023-08-11 13:58:34] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:34.277463650  [2023-08-11 13:58:34] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:34.277469786  [2023-08-11 13:58:34] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:34.277472029  [2023-08-11 13:58:34] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:34.291929003  [2023-08-11 13:58:34] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:34.291936234  [2023-08-11 13:58:34] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:34.291939168  [2023-08-11 13:58:34] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:34.291941215  [2023-08-11 13:58:34] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:36.797417182  [2023-08-11 13:58:36] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:36.797557086  [2023-08-11 13:58:36] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:37.097515850  [2023-08-11 13:58:37] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:37.097628818  [2023-08-11 13:58:37] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:44.294582222  [2023-08-11 13:58:44] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:44.294591765  [2023-08-11 13:58:44] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:44.295052398  [2023-08-11 13:58:44] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:44.295060554  [2023-08-11 13:58:44] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:44.309288088  [2023-08-11 13:58:44] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:44.309295434  [2023-08-11 13:58:44] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:44.309298449  [2023-08-11 13:58:44] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:44.309300514  [2023-08-11 13:58:44] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:46.912421995  [2023-08-11 13:58:46] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:46.912709200  [2023-08-11 13:58:46] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:47.179807331  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:47.180980069  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:47.180986096  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:47.181118200  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:47.189151228  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:47.189388901  [2023-08-11 13:58:47] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:54.317102443  [2023-08-11 13:58:54] watchdog.X-Driveway-Zoom       ERROR   : Ffmpeg process crashed unexpectedly for X-Driveway-Zoom.
2023-08-11 13:58:54.317109228  [2023-08-11 13:58:54] watchdog.X-Driveway-Zoom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:54.317112097  [2023-08-11 13:58:54] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=510:610:2000:130' will be used.
2023-08-11 13:58:54.317114193  [2023-08-11 13:58:54] ffmpeg.X-Driveway-Zoom.detect  ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:54.331433023  [2023-08-11 13:58:54] watchdog.X-Porch-Zoom          ERROR   : Ffmpeg process crashed unexpectedly for X-Porch-Zoom.
2023-08-11 13:58:54.331439485  [2023-08-11 13:58:54] watchdog.X-Porch-Zoom          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-08-11 13:58:54.331442396  [2023-08-11 13:58:54] ffmpeg.X-Porch-Zoom.detect     ERROR   : Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=850:750:2970:1294' will be used.
2023-08-11 13:58:54.331444428  [2023-08-11 13:58:54] ffmpeg.X-Porch-Zoom.detect     ERROR   : Error submitting video frame to the encoder
2023-08-11 13:58:56.917189499  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917497907  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917501591  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917503859  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917648939  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917651910  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917752946  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917887311  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.917890261  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.918037832  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.918040996  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:56.918180550  [2023-08-11 13:58:56] frigate.video                  ERROR   : X-Porch-Zoom: ffmpeg process is not running. exiting capture thread...
2023-08-11 13:58:57.163281117  [2023-08-11 13:58:57] frigate.video                  ERROR   : X-Driveway-Zoom: Unable to read frames from ffmpeg process.
2023-08-11 13:58:57.163457382  [2023-08-11 13:58:57] frigate.video                  ERROR   : X-Driveway-Zoom: ffmpeg process is not running. exiting capture thread...
NickM-27 commented 1 year ago

You can't combine the hwaccel preset preset-vaapi with manual v filters because frigate has its own vfilters. You will need to use entirely manual args for those cameras

mr-manuel commented 1 year ago

Thanks. Now I managed it to get it working.

One thing that I noticed is that when using preset-vaapi then -s 2560x1920 gets replaced by -vf fps=10,scale_vaapi=w=2560:h=1920,hwdownload,format=yuv420p but -pix_fmt yuv420p is not removed and therefore repeated. Maybe this can be optimized in the code.

# default
ffmpeg -hide_banner -loglevel warning -threads 2                                                                                                                       -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://192.168.1.80:554/11 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Porch-%Y%m%d%H%M%S.mp4 -r 10 -s 2560x1920 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:
# preset-vaapi
ffmpeg -hide_banner -loglevel warning -threads 2 -hwaccel_flags allow_profile_mismatch -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -user_agent FFmpeg Frigate/0.12.1-367d724 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://192.168.1.80:554/11 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/Porch-%Y%m%d%H%M%S.mp4 -r 10 -vf fps=10,scale_vaapi=w=2560:h=1920,hwdownload,format=yuv420p -threads 2 -f rawvideo -pix_fmt yuv420p pipe:

Here the complete config file, if someone else want to crop the video stream with hardware acceleration:

Config YML ```yml mqtt: host: 192.168.1.203 port: 1883 stats_interval: 15 detectors: coral: type: edgetpu device: usb database: path: /database/frigate.db logger: default: info logs: frigate.mqtt: error birdseye: enabled: true width: 2250 height: 1150 quality: 8 mode: objects detect: fps: 10 enabled: true max_disappeared: 25 stationary: interval: 0 threshold: 50 max_frames: default: 3000 objects: person: 1000 objects: filters: person: min_area: 0 max_area: 24000000 min_score: 0.5 threshold: 0.7 motion: threshold: 25 contour_area: 30 delta_alpha: 0.2 frame_alpha: 0.2 frame_height: 50 improve_contrast: false mqtt_off_delay: 30 record: enabled: true expire_interval: 60 retain: days: 2 mode: all events: pre_capture: 5 post_capture: 5 retain: default: 7 mode: motion objects: person: 14 snapshots: enabled: true timestamp: false bounding_box: false crop: true retain: default: 7 objects: person: 14 rtmp: enabled: false live: height: 1120 quality: 8 cameras: Driveway: enabled: true ffmpeg: inputs: - path: rtsp://192.168.1.80:554/11 roles: - detect - record hwaccel_args: preset-vaapi detect: width: 2560 height: 1920 best_image_timeout: 60 zones: Klingel: coordinates: 1835,841,2431,340,1956,75 objects: - person motion: mask: - 0,0,1521,0,1519,218,1540,526,1580,811,1475,1237,245,1778,627,2011,999,2144,0,2144 - 3840,0,3840,674,3116,0 - 3840,2144,3840,1643,3622,1824,3322,1997,2990,2144 record: enabled: true mqtt: enabled: true timestamp: true bounding_box: true crop: true quality: 70 objects: track: - person - bird - cat - dog ui: order: 0 dashboard: true Porch: enabled: true ffmpeg: inputs: - path: rtsp://192.168.1.81:554/stream0 roles: - detect - record hwaccel_args: preset-vaapi detect: width: 3840 height: 2144 best_image_timeout: 60 zones: Parkplatz: coordinates: 2270,683,1579,814,1499,1076,1442,1349,1340,1793,1492,1766,1500,2144,2854,2144,2832,2004,3138,1621,3310,1556,3108,984,2757,393,2355,409 Strasse_Ortnerweg: coordinates: 3150,0,3840,696,3840,1647,3741,1749,3620,1342,3452,979,3263,671,2955,341,2834,223,2811,315,2694,283,2447,281,2459,95,2401,0 objects: - bicycle - car - motorcycle Treppe: coordinates: 951,1966,1124,2016,1146,2144,1504,2144,1500,1785,1316,1827,1308,1546,1027,1643 Tuer: coordinates: 3310,1556,3341,1642,3442,1950,3295,2037,3058,2144,2863,2144,2832,2004,3138,1621 motion: mask: - 0,0,1521,0,1519,218,1540,526,1580,811,1475,1237,245,1778,627,2011,999,2144,0,2144 - 3840,0,3840,674,3116,0 - 3840,2144,3840,1643,3622,1824,3322,1997,2990,2144 record: enabled: true mqtt: enabled: true timestamp: true bounding_box: true crop: true quality: 70 objects: track: - person - bicycle - car - motorcycle - bird - cat - dog filters: person: mask: 3334,1191,3471,1503,3581,1862,3840,1655,3840,0,0,0,0,2144,889,2144,1046,1579,1408,1410,1584,818,2266,675,2271,433,2794,380,3153,858 ui: order: 1 dashboard: true X-Driveway-Zoom: enabled: true ffmpeg: inputs: - path: rtsp://192.168.1.80:554/11 roles: - detect hwaccel_args: -hwaccel_flags allow_profile_mismatch -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi output_args: detect: -vf fps=10,hwdownload,format=yuv420p,crop=510:610:1900:130 -threads 2 -f rawvideo -pix_fmt yuv420p detect: width: 510 height: 610 enabled: false snapshots: enabled: false record: enabled: false mqtt: enabled: false ui: order: 10 dashboard: true X-Porch-Zoom: enabled: true ffmpeg: inputs: - path: rtsp://192.168.1.81:554/stream0 roles: - detect hwaccel_args: -hwaccel_flags allow_profile_mismatch -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi output_args: detect: -vf fps=10,hwdownload,format=yuv420p,crop=850:750:2970:1294 -threads 2 -f rawvideo -pix_fmt yuv420p detect: width: 850 height: 750 enabled: false snapshots: enabled: false record: enabled: false rtmp: enabled: false mqtt: enabled: false ui: order: 11 dashboard: true ```
NickM-27 commented 1 year ago

They are both needed and this is not doing extra work. The first is telling the video filter muxer that after the GPU is finished scaling the stream, move the data to the CPU and set the pixel format to yuv420p. The second is telling the raw video muxer that we want the raw video in yuv420p format.

mr-manuel commented 1 year ago

Thank you very much!