forked from Github/frigate
Automatically detect hwaccel args (#9142)
* Automatically detect nvidia / vaapi hwaccel args * Update docs * Use auto for hwaccel args * Formatting
This commit is contained in:
committed by
Blake Blackshear
parent
a946a8f099
commit
0ee81c7526
@@ -39,7 +39,7 @@ from frigate.util.builtin import (
|
||||
load_config_with_no_duplicates,
|
||||
)
|
||||
from frigate.util.image import create_mask
|
||||
from frigate.util.services import get_video_properties
|
||||
from frigate.util.services import auto_detect_hwaccel, get_video_properties
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -600,7 +600,7 @@ class FfmpegConfig(FrigateBaseModel):
|
||||
default=FFMPEG_GLOBAL_ARGS_DEFAULT, title="Global FFmpeg arguments."
|
||||
)
|
||||
hwaccel_args: Union[str, List[str]] = Field(
|
||||
default_factory=list, title="FFmpeg hardware acceleration arguments."
|
||||
default="auto", title="FFmpeg hardware acceleration arguments."
|
||||
)
|
||||
input_args: Union[str, List[str]] = Field(
|
||||
default=FFMPEG_INPUT_ARGS_DEFAULT, title="FFmpeg input arguments."
|
||||
@@ -1097,6 +1097,10 @@ class FrigateConfig(FrigateBaseModel):
|
||||
elif config.objects.filters[attribute].min_score == 0.5:
|
||||
config.objects.filters[attribute].min_score = 0.7
|
||||
|
||||
# auto detect hwaccel args
|
||||
if config.ffmpeg.hwaccel_args == "auto":
|
||||
config.ffmpeg.hwaccel_args = auto_detect_hwaccel()
|
||||
|
||||
# Global config to propagate down to camera level
|
||||
global_config = config.dict(
|
||||
include={
|
||||
|
||||
Reference in New Issue
Block a user