mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-04 04:27:42 +03:00
Add option to not trim clip
This commit is contained in:
parent
1fa7ce5486
commit
0997b471b8
@ -551,6 +551,7 @@ def recording_clip(
|
|||||||
camera_name: str,
|
camera_name: str,
|
||||||
start_ts: float,
|
start_ts: float,
|
||||||
end_ts: float,
|
end_ts: float,
|
||||||
|
trim: bool = True,
|
||||||
):
|
):
|
||||||
def run_download(ffmpeg_cmd: list[str], file_path: str):
|
def run_download(ffmpeg_cmd: list[str], file_path: str):
|
||||||
with sp.Popen(
|
with sp.Popen(
|
||||||
@ -593,10 +594,13 @@ def recording_clip(
|
|||||||
clip: Recordings
|
clip: Recordings
|
||||||
for clip in recordings:
|
for clip in recordings:
|
||||||
file.write(f"file '{clip.path}'\n")
|
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")
|
file.write(f"inpoint {int(start_ts - clip.start_time)}\n")
|
||||||
|
|
||||||
# if this is the ending clip, add an outpoint
|
# 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:
|
if clip.end_time > end_ts:
|
||||||
file.write(f"outpoint {int(end_ts - clip.start_time)}\n")
|
file.write(f"outpoint {int(end_ts - clip.start_time)}\n")
|
||||||
|
|
||||||
|
|||||||
@ -1270,7 +1270,7 @@ export function VideoTab({ search }: VideoTabProps) {
|
|||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<a
|
<a
|
||||||
download
|
download
|
||||||
href={`${baseUrl}api/${search.camera}/start/${search.start_time}/end/${endTime}/clip.mp4`}
|
href={`${baseUrl}api/${search.camera}/start/${search.start_time}/end/${endTime}/clip.mp4?trim=False`}
|
||||||
>
|
>
|
||||||
<Chip className="cursor-pointer rounded-md bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500">
|
<Chip className="cursor-pointer rounded-md bg-gray-500 bg-gradient-to-br from-gray-400 to-gray-500">
|
||||||
<FaDownload className="size-4 text-white" />
|
<FaDownload className="size-4 text-white" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user