[Config Support]: ffmpeg / QSV memory allocation errors. #20298
-
Describe the problem you are havingAfter running for awhile ffmpeg dies with memory allocation errors. The issue used to only occur occasionally, however, now it almost always appears within a few hours. Version0.16.0-c2f8de9 and 0.16.1-e664cb2 Frigate config filemqtt:
enabled: true
host: 192.168.1.253
port: 1883
topic_prefix: frigate
user: frigate
password: admin
#auth:
# enabled: false
database:
path: /config/frigate.db
tls:
enabled: false
ffmpeg:
hwaccel_args: preset-intel-qsv-h264
detectors:
ov:
type: openvino
device: GPU
model:
path: plus://token
go2rtc:
streams:
front_door:
- ffmpeg:http://192.168.1.87/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=*****#video=copy#audio=copy#audio=opus
- rtsp://admin:*****@192.168.1.87:554/Preview_01_sub
front_door_sub:
- ffmpeg:http://192.168.1.87/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=*****
back_door:
- ffmpeg:http://192.168.1.6/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=*****#video=copy#audio=copy#audio=opus
- rtsp://admin:*****@192.168.1.87:554/Preview_01_sub
back_door_sub:
- ffmpeg:http://192.168.1.6/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=*****
webrtc:
candidates:
- 192.168.1.254:8555
- stun:8555
snapshots:
enabled: true
retain:
default: 30
quality: 100
cameras:
front_door:
mqtt:
timestamp: false
bounding_box: false
crop: true
quality: 100
#height: 500
ffmpeg:
output_args:
record: preset-record-generic-audio-aac
inputs:
- path: rtsp://127.0.0.1:8554/front_door?video&audio
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/front_door_sub
input_args: preset-rtsp-restream
roles:
- detect
detect:
fps: 5
record:
enabled: true
retain:
days: 14
mode: all
alerts:
pre_capture: 10
post_capture: 15
retain:
days: 60
mode: motion
detections:
pre_capture: 10
post_capture: 10
retain:
days: 30
mode: motion
zones:
Nearby:
coordinates: 0.545,0.197,1,0.212,1,0.767,0.717,0.656,0.541,0.666
loitering_time: 0
inertia: 3
On_Property:
coordinates:
1,0.766,0.72,0.659,0.54,0.666,0.544,0.2,0.081,0.186,0.078,0.734,-0.001,0.784,0,1,1,1
loitering_time: 0
inertia: 3
motion:
mask: 0,0.783,0.075,0.739,0.078,0.187,1,0.213,1,0,0.001,0.003
threshold: 30
contour_area: 10
improve_contrast: true
review:
alerts:
required_zones: On_Property
objects:
track:
- person
- face
- car
- license_plate
- package
- bicycle
- dog
- cat
- skunk
#- bird
filters:
car:
mask: 0,0.396,1,0.412,1,0.739,0,0.918
back_door:
mqtt:
timestamp: false
bounding_box: false
crop: true
quality: 100
#height: 500
ffmpeg:
output_args:
record: preset-record-generic-audio-aac
inputs:
- path: rtsp://127.0.0.1:8554/back_door?video&audio
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/back_door_sub
input_args: preset-rtsp-restream
roles:
- detect
detect:
fps: 5
objects:
track:
- person
- face
- bicycle
- package
- dog
- cat
- skunk
#- bird
record:
enabled: true
retain:
days: 14
mode: all
alerts:
pre_capture: 10
post_capture: 15
retain:
days: 60
mode: motion
detections:
retain:
days: 30
mode: motion
zones:
Marcels:
coordinates:
0.295,0,0.228,0.39,0.236,0.706,0.437,0.745,0.7,0.739,0.692,0
loitering_time: 0
inertia: 3
Pathway:
coordinates:
0,0.685,0.093,0.764,0.198,0.821,0.307,0.852,0.468,0.877,0.714,0.842,0.878,0.78,0.974,0.714,1,0.669,1,1,0,1
loitering_time: 0
inertia: 3
Left_Neighbour:
coordinates: 0,0,0,0.637,0.204,0.738,0.235,0.71,0.225,0.392,0.294,0
inertia: 3
loitering_time: 0
Lawn:
coordinates:
0,0.685,0,0.635,0.204,0.739,0.239,0.705,0.437,0.744,0.697,0.736,0.697,0.601,0.966,0.708,0.878,0.778,0.709,0.839,0.476,0.874,0.315,0.851,0.197,0.815,0.094,0.766
loitering_time: 0
Right_Neighbour:
coordinates:
1,0.634,0.907,0.635,0.907,0.239,0.871,0.034,0.973,0.135,1,0.183,1,0.278
loitering_time: 0
motion:
mask: 0,0,1,0,1,0.414,0.692,0.414,0.678,0.143,0,0.17
threshold: 30
contour_area: 10
improve_contrast: true
review:
alerts:
required_zones:
- Lawn
- Pathway
semantic_search:
enabled: true
reindex: false
model_size: large
detect:
enabled: true
face_recognition:
enabled: false
min_area: 20000
model_size: large
save_attempts: 300
min_faces: 2
lpr:
enabled: false
device: GPU
model_size: large
known_plates:
Subaru:
- BJT-3093
- BJT-3O93
classification:
bird:
enabled: false
version: 0.16-0Relevant Frigate log output2025-09-30 15:36:37.734619505 [2025-09-30 15:36:37] frigate.video ERROR : front_door: Unable to read frames from ffmpeg process.
2025-09-30 15:36:37.734622508 [2025-09-30 15:36:37] frigate.video ERROR : front_door: ffmpeg process is not running. exiting capture thread...
2025-09-30 15:36:47.297342976 [2025-09-30 15:36:47] watchdog.front_door ERROR : Ffmpeg process crashed unexpectedly for front_door.
2025-09-30 15:36:47.297549395 [2025-09-30 15:36:47] watchdog.front_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-09-30 15:36:47.297692171 [2025-09-30 15:36:47] ffmpeg.front_door.detect ERROR : [AVHWFramesContext @ 0x14fecc05d3c0] Failed to sync surface 0x10: 1 (operation failed).
2025-09-30 15:36:47.297780774 [2025-09-30 15:36:47] ffmpeg.front_door.detect ERROR : [hwdownload @ 0x14fedc003980] Failed to download frame: -5.
2025-09-30 15:36:47.297871986 [2025-09-30 15:36:47] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55a7d139e380] Error while filtering: Input/output error
2025-09-30 15:36:47.297940966 [2025-09-30 15:36:47] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55a7d139e380] Task finished with error code: -5 (Input/output error)
2025-09-30 15:36:47.298038208 [2025-09-30 15:36:47] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55a7d139e380] Terminating thread with return code -5 (Input/output error)
2025-09-30 17:00:37.827128818 [2025-09-30 17:00:37] frigate.video ERROR : front_door: Unable to read frames from ffmpeg process.
2025-09-30 17:00:37.827131693 [2025-09-30 17:00:37] frigate.video ERROR : front_door: ffmpeg process is not running. exiting capture thread...
2025-09-30 17:00:42.240275598 [2025-09-30 17:00:42] watchdog.front_door ERROR : Ffmpeg process crashed unexpectedly for front_door.
2025-09-30 17:00:42.240372186 [2025-09-30 17:00:42] watchdog.front_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-09-30 17:00:42.240470660 [2025-09-30 17:00:42] ffmpeg.front_door.detect ERROR : [AVHWFramesContext @ 0x154d3405e280] Failed to sync surface 0x14: 1 (operation failed).
2025-09-30 17:00:42.240548747 [2025-09-30 17:00:42] ffmpeg.front_door.detect ERROR : [hwdownload @ 0x154d44003980] Failed to download frame: -5.
2025-09-30 17:00:42.240607726 [2025-09-30 17:00:42] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55bd3daa69c0] Error while filtering: Input/output error
2025-09-30 17:00:42.240659871 [2025-09-30 17:00:42] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55bd3daa69c0] Task finished with error code: -5 (Input/output error)
2025-09-30 17:00:42.240706190 [2025-09-30 17:00:42] ffmpeg.front_door.detect ERROR : [vf#0:0 @ 0x55bd3daa69c0] Terminating thread with return code -5 (Input/output error)
2025-09-30 17:13:17.986974698 [2025-09-30 17:13:17] frigate.video ERROR : back_door: Unable to read frames from ffmpeg process.
2025-09-30 17:13:17.987064133 [2025-09-30 17:13:17] frigate.video ERROR : back_door: ffmpeg process is not running. exiting capture thread...
2025-09-30 17:13:22.428554900 [2025-09-30 17:13:22] watchdog.back_door ERROR : Ffmpeg process crashed unexpectedly for back_door.
2025-09-30 17:13:22.428691997 [2025-09-30 17:13:22] watchdog.back_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-09-30 17:13:22.428807955 [2025-09-30 17:13:22] ffmpeg.back_door.detect ERROR : [AVHWFramesContext @ 0x1465bc06c340] Failed to sync surface 0x14: 1 (operation failed).
2025-09-30 17:13:22.428894431 [2025-09-30 17:13:22] ffmpeg.back_door.detect ERROR : [hwdownload @ 0x1465c0003980] Failed to download frame: -5.
2025-09-30 17:13:22.428960953 [2025-09-30 17:13:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55da0d37fd80] Error while filtering: Input/output error
2025-09-30 17:13:22.429030664 [2025-09-30 17:13:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55da0d37fd80] Task finished with error code: -5 (Input/output error)
2025-09-30 17:13:22.429122900 [2025-09-30 17:13:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55da0d37fd80] Terminating thread with return code -5 (Input/output error)
2025-09-30 18:37:43.752897715 [2025-09-30 18:37:43] frigate.video ERROR : back_door: Unable to read frames from ffmpeg process.
2025-09-30 18:37:43.753046935 [2025-09-30 18:37:43] frigate.video ERROR : back_door: ffmpeg process is not running. exiting capture thread...
2025-09-30 18:37:52.563942626 [2025-09-30 18:37:52] watchdog.back_door ERROR : Ffmpeg process crashed unexpectedly for back_door.
2025-09-30 18:37:52.564106501 [2025-09-30 18:37:52] watchdog.back_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-09-30 18:37:52.564221763 [2025-09-30 18:37:52] ffmpeg.back_door.detect ERROR : [AVHWFramesContext @ 0x149518074f00] Failed to sync surface 0x14: 1 (operation failed).
2025-09-30 18:37:52.564371191 [2025-09-30 18:37:52] ffmpeg.back_door.detect ERROR : [hwdownload @ 0x14952c003980] Failed to download frame: -5.
2025-09-30 18:37:52.564450359 [2025-09-30 18:37:52] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e701782d80] Error while filtering: Input/output error
2025-09-30 18:37:52.564522870 [2025-09-30 18:37:52] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e701782d80] Task finished with error code: -5 (Input/output error)
2025-09-30 18:37:52.564630274 [2025-09-30 18:37:52] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e701782d80] Terminating thread with return code -5 (Input/output error)
2025-09-30 19:03:22.583818285 [2025-09-30 19:03:22] frigate.video ERROR : back_door: Unable to read frames from ffmpeg process.
2025-09-30 19:03:22.583928393 [2025-09-30 19:03:22] frigate.video ERROR : back_door: ffmpeg process is not running. exiting capture thread...
2025-09-30 19:03:22.606848023 [2025-09-30 19:03:22] watchdog.back_door ERROR : Ffmpeg process crashed unexpectedly for back_door.
2025-09-30 19:03:22.606940146 [2025-09-30 19:03:22] watchdog.back_door ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2025-09-30 19:03:22.607005968 [2025-09-30 19:03:22] ffmpeg.back_door.detect ERROR : [AVHWFramesContext @ 0x15447406c980] Failed to sync surface 0x12: 1 (operation failed).
2025-09-30 19:03:22.607055504 [2025-09-30 19:03:22] ffmpeg.back_door.detect ERROR : [hwdownload @ 0x154480003980] Failed to download frame: -5.
2025-09-30 19:03:22.607100227 [2025-09-30 19:03:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e8b05019c0] Error while filtering: Input/output error
2025-09-30 19:03:22.607172324 [2025-09-30 19:03:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e8b05019c0] Task finished with error code: -5 (Input/output error)
2025-09-30 19:03:22.607247234 [2025-09-30 19:03:22] ffmpeg.back_door.detect ERROR : [vf#0:0 @ 0x55e8b05019c0] Terminating thread with return code -5 (Input/output error)Relevant go2rtc log output**Logs missing from last crash - below is from recent boot**
2025-09-30 20:33:10.536173854 [INFO] Preparing new go2rtc config...
2025-09-30 20:33:10.794939732 [INFO] Starting go2rtc...
2025-09-30 20:33:10.874609243 20:33:10.873 INF go2rtc platform=linux/amd64 revision=fa580c5 version=1.9.9
2025-09-30 20:33:10.874613519 20:33:10.873 INF config path=/dev/shm/go2rtc.yaml
2025-09-30 20:33:10.874615528 20:33:10.873 INF [rtsp] listen addr=:8554
2025-09-30 20:33:10.874617336 20:33:10.874 INF [webrtc] listen addr=:8555
2025-09-30 20:33:10.874618892 20:33:10.874 INF [api] listen addr=:1984
2025-09-30 20:33:19.223348948 [INFO] Starting go2rtc healthcheck service...Frigate statsNo response Operating systemUNRAID Install methodDocker Compose docker-compose file or Docker CLI commandExtra Parameters: --shm-size=512m --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 --restart on-failure:5
iGPU: /dev/dri/renderD128Object DetectorOpenVino Screenshots of the Frigate UI's System metrics pagesNo response Any other information that may be helpfulThings I've tried:
Intel® Core i3-14100 @ 4455 MHz {"return_code":0,"stderr":"","stdout":"vainfo: VA-API version: 1.22 (libva 2.12.0) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
For Intel-based CPUs, Frigate recommends using the You should calculate the minimum required $ python -c 'print("{:.2f}MB".format((<width> * <height> * 1.5 * 20 + 270480) / 1048576))'For eight cameras at 1280x720, the example is: $ python -c 'print("{:.2f}MB".format(((1280 * 720 * 1.5 * 20 + 270480) / 1048576) * 8 + 40))'
253MBMake sure your Docker Compose or Docker run command includes a Example for Docker Compose: services:
frigate:
...
shm_size: 512mOr for Docker CLI: docker run -d \
--name frigate \
--shm-size=512m \
...
ghcr.io/blakeblackshear/frigate:stableIf you are using the Home Assistant add-on, If the issue persists with Links for reference: 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
You might want to try using ffmpeg 5: |
Beta Was this translation helpful? Give feedback.
Startup issue with ffmpeg 5.0 is resolved with the following:
ffmpeg: hwaccel_args: preset-vaapi path: "5.0"Will see if the memory issue returns.