[Bug]: ffmpeg_presets.py:281 — parse_preset_hardware_acceleration_encode() passes only 2 args to format() when hwaccel_args is a list #22450
Replies: 2 comments
-
|
This appears to be a valid bug report. Based on the documentation, when configuring The documentation shows that ffmpeg:
# Optional: global hwaccel args (default: auto detect)
# NOTE: See hardware acceleration docs for your specific device
hwaccel_args: "auto"Workaround until this is fixed: Use the preset string format instead of a list for your VAAPI configuration:(2) ffmpeg:
hwaccel_args: preset-vaapiThe If you need to specify a custom Your analysis of the root cause (missing 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Resolved in #22462 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checklist
Describe the problem you are having
When
birdseye.restreamistrueandhwaccel_argsis configured as a list (e.g. VAAPI),parse_preset_hardware_acceleration_encode()inffmpeg_presets.pyat line 281 calls:This passes only 2 positional arguments, but the default birdseye preset string contains 3 placeholders:
{0} = ffmpeg_path, {1} = input, {2} = output. The missing ffmpeg_path causes:
This crashes create_config.py, which runs on every go2rtc start. go2rtc enters a restart loop and ALL camera streams
go down — not just birdseye.
The fix is to include ffmpeg_path as the first argument:
The
ffmpeg_pathvariable is already available in scope at that point.Steps to reproduce
ffmpeg:
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
birdseye:
enabled: true
restream: true
Version
0.17.0-f0d69f7
In which browser(s) are you experiencing the issue with?
N/A — backend bug, not browser-related
Frigate config file
docker-compose file or Docker CLI command
will post if neededRelevant Frigate log output
IndexError: Replacement index 2 out of range for positional args tupleRelevant go2rtc log output
Operating system
Debian
Install method
Docker Compose
Network connection
Wired
Camera make and model
Dahua (multiple models)
Screenshots of the Frigate UI's System metrics pages
dont have any screenshots
Any other information that may be helpful
The bug is in the
not isinstance(arg, str)branch of parse_preset_hardware_acceleration_encode().When hwaccel_args is a string (preset name like "vaapi"), it takes a different code path that works correctly.
The bug only triggers when hwaccel_args is a list of individual arguments.
Workaround: bind-mount a patched ffmpeg_presets.py with line 281 changed to:
return arg_map["default"].format(ffmpeg_path, input, output)
Beta Was this translation helpful? Give feedback.
All reactions