mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-06 19:25:22 +03:00
Add timelapse args to config
This commit is contained in:
parent
70d77dd289
commit
ec504a1aae
@ -51,6 +51,7 @@ DEFAULT_TRACKED_OBJECTS = ["person"]
|
|||||||
DEFAULT_LISTEN_AUDIO = ["bark", "fire_alarm", "scream", "speech", "yell"]
|
DEFAULT_LISTEN_AUDIO = ["bark", "fire_alarm", "scream", "speech", "yell"]
|
||||||
DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}}
|
DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}}
|
||||||
DEFAULT_DETECT_DIMENSIONS = {"width": 1280, "height": 720}
|
DEFAULT_DETECT_DIMENSIONS = {"width": 1280, "height": 720}
|
||||||
|
DEFAULT_TIME_LAPSE_FFMPEG_ARGS = "-vf setpts=0.04*PTS -r 30"
|
||||||
|
|
||||||
|
|
||||||
class FrigateBaseModel(BaseModel):
|
class FrigateBaseModel(BaseModel):
|
||||||
@ -198,6 +199,10 @@ class RecordRetainConfig(FrigateBaseModel):
|
|||||||
mode: RetainModeEnum = Field(default=RetainModeEnum.all, title="Retain mode.")
|
mode: RetainModeEnum = Field(default=RetainModeEnum.all, title="Retain mode.")
|
||||||
|
|
||||||
|
|
||||||
|
class RecordExportConfig(FrigateBaseModel):
|
||||||
|
timelapse_args: str = Field(default=DEFAULT_TIME_LAPSE_FFMPEG_ARGS, title="Timelapse Args")
|
||||||
|
|
||||||
|
|
||||||
class RecordConfig(FrigateBaseModel):
|
class RecordConfig(FrigateBaseModel):
|
||||||
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
||||||
sync_on_startup: bool = Field(
|
sync_on_startup: bool = Field(
|
||||||
@ -213,6 +218,9 @@ class RecordConfig(FrigateBaseModel):
|
|||||||
events: EventsConfig = Field(
|
events: EventsConfig = Field(
|
||||||
default_factory=EventsConfig, title="Event specific settings."
|
default_factory=EventsConfig, title="Event specific settings."
|
||||||
)
|
)
|
||||||
|
export: RecordExportConfig = Field(
|
||||||
|
default_factory=RecordExportConfig, title="Recording Export Config"
|
||||||
|
)
|
||||||
enabled_in_config: Optional[bool] = Field(
|
enabled_in_config: Optional[bool] = Field(
|
||||||
title="Keep track of original state of recording."
|
title="Keep track of original state of recording."
|
||||||
)
|
)
|
||||||
|
|||||||
@ -18,6 +18,9 @@ from frigate.models import Recordings
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
TIMELAPSE_DATA_INPUT_ARGS = "-an -skip_frame nokey"
|
||||||
|
|
||||||
|
|
||||||
def lower_priority():
|
def lower_priority():
|
||||||
os.nice(10)
|
os.nice(10)
|
||||||
|
|
||||||
@ -99,8 +102,8 @@ class RecordingExporter(threading.Thread):
|
|||||||
ffmpeg_cmd = (
|
ffmpeg_cmd = (
|
||||||
parse_preset_hardware_acceleration_encode(
|
parse_preset_hardware_acceleration_encode(
|
||||||
self.config.ffmpeg.hwaccel_args,
|
self.config.ffmpeg.hwaccel_args,
|
||||||
"-an -skip_frame nokey" + ffmpeg_input, # make sure only keyframes and no audio is not processed for time-lapse
|
TIMELAPSE_DATA_INPUT_ARGS + ffmpeg_input,
|
||||||
f"-vf setpts=0.04*PTS -r 30 -an {file_name}",
|
f"{self.config.cameras[self.camera].record.export.timelapse_args} {file_name}",
|
||||||
EncodeTypeEnum.timelapse,
|
EncodeTypeEnum.timelapse,
|
||||||
)
|
)
|
||||||
).split(" ")
|
).split(" ")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user