frigate: [HW Accel Support]: Cant get Hardware excelration to work
Describe the problem you are having
Im running frigate in docker but I cant get the hwaccel_args: preset-vaapi to work. When I add this to my config files my cameras will not show. I get error in the log that says : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi – you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Im using Dell Inc. OptiPlex 9020M Mesa Intel® HD Graphics 4600 (HSW GT2) Debian bookworm with docker
Version
0.12.1-367d724
Frigate config file
mqtt:
host: 192.168.0.183
port: 1883 # <---- same mqtt broker that home assistant uses
user: dakotasoukup
password:
ffmpeg:
hwaccel_args: preset-vaapi
detectors:
ov:
type: openvino
device: AUTO
model:
path: /openvino-model/ssdlite_mobilenet_v2.xml
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 30
mode: motion
snapshots:
enabled: True
retain:
default: 30
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
birdseye:
enabled: True
mode: continuous
cameras:
Backyard: # <--- this will be changed to your actual camera later
enabled: True
ffmpeg:
inputs:
- path: rtsp://admin:123456@192.168.0.14/media/video1
roles:
- detect
front: # <--- this will be changed to your actual camera later
enabled: True
ffmpeg:
inputs:
- path: rtsp://Admin:123456@192.168.0.44/stream0?username=admin&password=E10ADC3949BA59ABBE56E057F20F883E
roles:
- detect
front2: # <--- this will be changed to your actual camera later
enabled: True
ffmpeg:
inputs:
- path: rtsp://admin:Foster47290@192.168.0.233:554
roles:
- detect
driveway: # <--- this will be changed to your actual camera later
enabled: True
ffmpeg:
inputs:
- path: rtsp://admin:123456@192.168.0.22/media/video1
roles:
- detect
garage: # <--- this will be changed to your actual camera later
enabled: True
ffmpeg:
inputs:
- path: rtsp://admin:123456@192.168.0.23/media/video1
roles:
- detect
go2rtc:
streams:
front2:
- rtsp://admin:Foster47290@192.168.0.233:554
front:
- rtsp://Admin:123456@192.168.0.44/stream0?username=admin&password=E10ADC3949BA59ABBE56E057F20F883E
Backyard:
- rtsp://admin:123456@192.168.0.14/media/video1
driveway:
- rtsp://admin:123456@192.168.0.22/media/video1
garage:
- rtsp://admin:123456@192.168.0.23/media/video1
docker-compose file or Docker CLI command
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "100mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /config/config.yml:/config/config.yml:ro
- /media/dakota/storage/media:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
Relevant log output
2024-02-08 23:24:08.743351712 [2024-02-08 23:24:08] frigate.video ERROR : front: Unable to read frames from ffmpeg process.
2024-02-08 23:24:08.744067333 [2024-02-08 23:24:08] frigate.video ERROR : front: ffmpeg process is not running. exiting capture thread...
2024-02-08 23:24:12.415198244 172.18.0.1 - - [08/Feb/2024:23:24:12 +0000] "GET /api/stats HTTP/1.1" 200 3188 "-" "HomeAssistant/2024.1.0 aiohttp/3.9.1 Python/3.11" "-"
2024-02-08 23:24:16.938563698 [2024-02-08 23:24:16] watchdog.Backyard ERROR : Ffmpeg process crashed unexpectedly for Backyard.
2024-02-08 23:24:16.939224573 [2024-02-08 23:24:16] watchdog.Backyard ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-08 23:24:16.939958263 [2024-02-08 23:24:16] ffmpeg.Backyard.detect ERROR : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2024-02-08 23:24:16.940412378 [2024-02-08 23:24:16] ffmpeg.Backyard.detect ERROR : Error parsing options for output file vaapi.
2024-02-08 23:24:16.940885316 [2024-02-08 23:24:16] ffmpeg.Backyard.detect ERROR : Error opening output files: Invalid argument
2024-02-08 23:24:16.999517735 [2024-02-08 23:24:16] watchdog.garage ERROR : Ffmpeg process crashed unexpectedly for garage.
2024-02-08 23:24:17.000574785 [2024-02-08 23:24:16] watchdog.garage ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-08 23:24:17.000699599 [2024-02-08 23:24:16] ffmpeg.garage.detect ERROR : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2024-02-08 23:24:17.001139355 [2024-02-08 23:24:16] ffmpeg.garage.detect ERROR : Error parsing options for output file vaapi.
2024-02-08 23:24:17.001486458 [2024-02-08 23:24:16] ffmpeg.garage.detect ERROR : Error opening output files: Invalid argument
2024-02-08 23:24:17.001743649 [2024-02-08 23:24:16] watchdog.front ERROR : Ffmpeg process crashed unexpectedly for front.
2024-02-08 23:24:17.002037989 [2024-02-08 23:24:16] watchdog.front ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-08 23:24:17.002247736 [2024-02-08 23:24:16] ffmpeg.front.detect ERROR : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2024-02-08 23:24:17.002555634 [2024-02-08 23:24:16] ffmpeg.front.detect ERROR : Error parsing options for output file vaapi.
2024-02-08 23:24:17.002873815 [2024-02-08 23:24:16] ffmpeg.front.detect ERROR : Error opening output files: Invalid argument
2024-02-08 23:24:17.011273500 [2024-02-08 23:24:16] watchdog.driveway ERROR : Ffmpeg process crashed unexpectedly for driveway.
2024-02-08 23:24:17.012566160 [2024-02-08 23:24:16] watchdog.driveway ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-08 23:24:17.012578869 [2024-02-08 23:24:16] ffmpeg.driveway.detect ERROR : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2024-02-08 23:24:17.012899258 [2024-02-08 23:24:16] ffmpeg.driveway.detect ERROR : Error parsing options for output file vaapi.
2024-02-08 23:24:17.013212238 [2024-02-08 23:24:16] ffmpeg.driveway.detect ERROR : Error opening output files: Invalid argument
2024-02-08 23:24:17.025148581 [2024-02-08 23:24:17] watchdog.front2 ERROR : Ffmpeg process crashed unexpectedly for front2.
2024-02-08 23:24:17.026912540 [2024-02-08 23:24:17] watchdog.front2 ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2024-02-08 23:24:17.026920564 [2024-02-08 23:24:17] ffmpeg.front2.detect ERROR : Option hwaccel (use HW accelerated decoding) cannot be applied to output url vaapi -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2024-02-08 23:24:17.026923726 [2024-02-08 23:24:17] ffmpeg.front2.detect ERROR : Error parsing options for output file vaapi.
2024-02-08 23:24:17.026926157 [2024-02-08 23:24:17] ffmpeg.front2.detect ERROR : Error opening output files: Invalid argument
2024-02-08 23:24:17.974619140 [2024-02-08 23:24:17] frigate.video ERROR : front2: Unable to read frames from ffmpeg process.
2024-02-08 23:24:17.975453828 [2024-02-08 23:24:17] frigate.video ERROR : front2: ffmpeg process is not running. exiting capture thread...
2024-02-08 23:24:18.320499688 [2024-02-08 23:24:18] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
2024-02-08 23:24:18.321228746 [2024-02-08 23:24:18] frigate.video ERROR : Backyard: ffmpeg process is not running. exiting capture thread...
2024-02-08 23:24:18.340354632 [2024-02-08 23:24:18] frigate.video ERROR : garage: Unable to read frames from ffmpeg process.
2024-02-08 23:24:18.340742441 [2024-02-08 23:24:18] frigate.video ERROR : garage: ffmpeg process is not running. exiting capture thread...
2024-02-08 23:24:18.393685777 [2024-02-08 23:24:18] frigate.video ERROR : driveway: Unable to read frames from ffmpeg process.
2024-02-08 23:24:18.395244706 [2024-02-08 23:24:18] frigate.video ERROR : driveway: ffmpeg process is not running. exiting capture thread...
2024-02-08 23:24:18.797436242 [2024-02-08 23:24:18] frigate.video ERROR : front: Unable to read frames from ffmpeg process.
2024-02-08 23:24:18.797444531 [2024-02-08 23:24:18] frigate.video ERROR : front: ffmpeg process is not running. exiting capture thread...
FFprobe output from your camera
ffprobe rtsp://admin:123456@192.168.0.14/media/video1
ffprobe version 5.1.4-0+deb12u1 Copyright (c) 2007-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
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 @ 0x55fc7e1b9700] max delay reached. need to consume packet
[rtsp @ 0x55fc7e1b9700] RTP: missed 1 packets
[rtsp @ 0x55fc7e1b9700] max delay reached. need to consume packet
[rtsp @ 0x55fc7e1b9700] RTP: missed 1 packets
[rtsp @ 0x55fc7e1b9700] max delay reached. need to consume packet
[rtsp @ 0x55fc7e1b9700] RTP: missed 1 packets
[rtsp @ 0x55fc7e1b9700] max delay reached. need to consume packet
[rtsp @ 0x55fc7e1b9700] RTP: missed 1 packets
[rtsp @ 0x55fc7e1b9700] max delay reached. need to consume packet
[rtsp @ 0x55fc7e1b9700] RTP: missed 1 packets
[h264 @ 0x55fc7e1be400] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x55fc7e1be400] error while decoding MB 0 61, bytestream 176658
[h264 @ 0x55fc7e1be400] concealing 5557 DC, 5557 AC, 5557 MV errors in I frame
Input #0, rtsp, from 'rtsp://admin:123456@192.168.0.14/media/video1':
Metadata:
title : VCP IPC Realtime stream
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, progressive), 2592x1520, 20 fps, 20 tbr, 90k tbn
Stream #0:1: Data: none
Unsupported codec with id 0 for input stream 1
Operating system
Debian
Install method
Docker Compose
Network connection
Wired
Camera make and model
unknown
Any other information that may be helpful
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
@NickM-27
I also have problems with OpenVINO - I was trying the below
I get the following error which keeps restarting Frigate
Any ideas what I am doing wrong?