From f11e26ec6b3a39ebaff553b43bd33e0949ede8e1 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 25 Mar 2026 17:01:59 -0600 Subject: [PATCH] Fix ffmpeg presets --- frigate/ffmpeg_presets.py | 14 +++++++------- frigate/mypy.ini | 3 --- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/frigate/ffmpeg_presets.py b/frigate/ffmpeg_presets.py index 0652ec645..03cd3c414 100644 --- a/frigate/ffmpeg_presets.py +++ b/frigate/ffmpeg_presets.py @@ -3,7 +3,7 @@ import logging import os from enum import Enum -from typing import Any +from typing import Any, Optional from frigate.const import ( FFMPEG_HVC1_ARGS, @@ -215,7 +215,7 @@ def parse_preset_hardware_acceleration_decode( width: int, height: int, gpu: int, -) -> list[str]: +) -> Optional[list[str]]: """Return the correct preset if in preset format otherwise return None.""" if not isinstance(arg, str): return None @@ -242,9 +242,9 @@ def parse_preset_hardware_acceleration_scale( else: scale = PRESETS_HW_ACCEL_SCALE.get(arg, PRESETS_HW_ACCEL_SCALE["default"]) - scale = scale.format(fps, width, height).split(" ") - scale.extend(detect_args) - return scale + scale_args = scale.format(fps, width, height).split(" ") + scale_args.extend(detect_args) + return scale_args class EncodeTypeEnum(str, Enum): @@ -420,7 +420,7 @@ PRESETS_INPUT = { } -def parse_preset_input(arg: Any, detect_fps: int) -> list[str]: +def parse_preset_input(arg: Any, detect_fps: int) -> Optional[list[str]]: """Return the correct preset if in preset format otherwise return None.""" if not isinstance(arg, str): return None @@ -530,7 +530,7 @@ PRESETS_RECORD_OUTPUT = { } -def parse_preset_output_record(arg: Any, force_record_hvc1: bool) -> list[str]: +def parse_preset_output_record(arg: Any, force_record_hvc1: bool) -> Optional[list[str]]: """Return the correct preset if in preset format otherwise return None.""" if not isinstance(arg, str): return None diff --git a/frigate/mypy.ini b/frigate/mypy.ini index 47360ab4c..441b5080d 100644 --- a/frigate/mypy.ini +++ b/frigate/mypy.ini @@ -60,9 +60,6 @@ ignore_errors = true [mypy-frigate.events.*] ignore_errors = true -[mypy-frigate.ffmpeg_presets] -ignore_errors = true - [mypy-frigate.http] ignore_errors = true