fix: pass ffmpeg_path to birdseye encode preset format string

When hwaccel_args is a list (not a preset string), the fallback in
parse_preset_hardware_acceleration_encode() calls
arg_map["default"].format(input, output) with only 2 positional args.
But PRESETS_HW_ACCEL_ENCODE_BIRDSEYE["default"] contains {0}, {1}, {2}
expecting ffmpeg_path as the first arg.

This causes IndexError: Replacement index 2 out of range for size 2
which crashes create_config.py on every go2rtc start, taking down
all camera streams.

Pass ffmpeg_path as the first argument to match the preset template.
This commit is contained in:
ryzendigo 2026-03-16 14:22:52 +08:00
parent 5a214eb0d1
commit e68c7f3ca9

View File

@ -278,7 +278,7 @@ def parse_preset_hardware_acceleration_encode(
arg_map = PRESETS_HW_ACCEL_ENCODE_TIMELAPSE arg_map = PRESETS_HW_ACCEL_ENCODE_TIMELAPSE
if not isinstance(arg, str): if not isinstance(arg, str):
return arg_map["default"].format(input, output) return arg_map["default"].format(ffmpeg_path, input, output)
# Not all jetsons have HW encoders, so fall back to default SW encoder if not # Not all jetsons have HW encoders, so fall back to default SW encoder if not
if arg.startswith("preset-jetson-") and not os.path.exists("/dev/nvhost-msenc"): if arg.startswith("preset-jetson-") and not os.path.exists("/dev/nvhost-msenc"):