diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index 01fefefcb..9de6097d4 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -169,7 +169,9 @@ record: :::tip -When using `hwaccel_args`, hardware encoding is used for time lapse generation, using the relevant camera's hwaccel configuration. The encoder determines its own behavior so the resulting file size may be undesirably large. +When using `hwaccel_args`, hardware encoding is used for timelapse generation. By default, each camera inherits its export hwaccel settings from its own `ffmpeg.hwaccel_args`, which in turn inherits from the global setting. To override for a specific camera (e.g., when camera resolution exceeds hardware encoder limits), set `record.export.hwaccel_args` at the camera level. Using an unrecognized value or empty string will fall back to software encoding (libx264). + +The encoder determines its own behavior so the resulting file size may be undesirably large. To reduce the output file size the ffmpeg parameter `-qp n` can be utilized (where `n` stands for the value of the quantisation parameter). The value can be adjusted to get an acceptable tradeoff between quality and file size for the given scenario. ::: diff --git a/docs/docs/configuration/reference.md b/docs/docs/configuration/reference.md index 05d861180..51efbf0f8 100644 --- a/docs/docs/configuration/reference.md +++ b/docs/docs/configuration/reference.md @@ -462,7 +462,11 @@ record: # The -r (framerate) dictates how smooth the output video is. # So the args would be -vf setpts=0.02*PTS -r 30 in that case. timelapse_args: "-vf setpts=0.04*PTS -r 30" - # Optional: Global override for hwaccel_args in an export context (default: camera-specific args) + # Optional: Hardware acceleration for timelapse exports. + # When set to "auto" (default), inherits from camera ffmpeg hwaccel_args, which + # in turn inherits from global ffmpeg hwaccel_args. Set to a specific preset + # to override, or use an unrecognized value (e.g., empty string) to fall back + # to software encoding (libx264). hwaccel_args: auto # Optional: Recording Preview Settings preview: diff --git a/frigate/config/config.py b/frigate/config/config.py index e8e36efcc..b64936fd1 100644 --- a/frigate/config/config.py +++ b/frigate/config/config.py @@ -545,6 +545,9 @@ class FrigateConfig(FrigateBaseModel): if camera_config.ffmpeg.hwaccel_args == "auto": camera_config.ffmpeg.hwaccel_args = self.ffmpeg.hwaccel_args + # Resolve export hwaccel_args: camera export -> camera ffmpeg -> global ffmpeg + # This allows per-camera override for exports (e.g., when camera resolution + # exceeds hardware encoder limits) if camera_config.record.export.hwaccel_args == "auto": camera_config.record.export.hwaccel_args = camera_config.ffmpeg.hwaccel_args