From 0997b471b85a984b19873e7b29aa680e36e71ee0 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 14 May 2025 07:34:44 -0600 Subject: [PATCH] Add option to not trim clip --- frigate/api/media.py | 8 ++++++-- web/src/components/overlay/detail/SearchDetailDialog.tsx | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frigate/api/media.py b/frigate/api/media.py index 9c56e363d..b6ac4a28e 100644 --- a/frigate/api/media.py +++ b/frigate/api/media.py @@ -551,6 +551,7 @@ def recording_clip( camera_name: str, start_ts: float, end_ts: float, + trim: bool = True, ): def run_download(ffmpeg_cmd: list[str], file_path: str): with sp.Popen( @@ -593,10 +594,13 @@ def recording_clip( clip: Recordings for clip in recordings: file.write(f"file '{clip.path}'\n") - # if this is the starting clip, add an inpoint - if clip.start_time < start_ts: + + # if this is the starting clip and trim is enabled, add an inpoint + if trim and clip.start_time < start_ts: file.write(f"inpoint {int(start_ts - clip.start_time)}\n") + # if this is the ending clip, add an outpoint + # we don't trim the output because the VOD also removes outpoint if clip.end_time > end_ts: file.write(f"outpoint {int(end_ts - clip.start_time)}\n") diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx index 7a144b53a..d4eed8592 100644 --- a/web/src/components/overlay/detail/SearchDetailDialog.tsx +++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx @@ -1270,7 +1270,7 @@ export function VideoTab({ search }: VideoTabProps) {