mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
make height optional
This commit is contained in:
parent
ccee0d9e2b
commit
1437ccedea
@ -275,7 +275,7 @@ def submit_recording_snapshot_to_plus(camera_name: str, frame_time: str):
|
||||
try:
|
||||
recording: Recordings = recording_query.get()
|
||||
time_in_segment = frame_time - recording.start_time
|
||||
image_data = get_image_from_recording(recording.path, time_in_segment, "png", 0)
|
||||
image_data = get_image_from_recording(recording.path, time_in_segment, "png")
|
||||
|
||||
if not image_data:
|
||||
return make_response(
|
||||
|
||||
@ -765,7 +765,7 @@ def add_mask(mask: str, mask_img: np.ndarray):
|
||||
|
||||
|
||||
def get_image_from_recording(
|
||||
file_path: str, relative_frame_time: float, codec: str, height: int
|
||||
file_path: str, relative_frame_time: float, codec: str, height: Optional[int] = None
|
||||
) -> Optional[any]:
|
||||
"""retrieve a frame from given time in recording file."""
|
||||
|
||||
@ -787,7 +787,7 @@ def get_image_from_recording(
|
||||
"-",
|
||||
]
|
||||
|
||||
if height:
|
||||
if height is not None:
|
||||
ffmpeg_cmd.insert(-3, "-vf")
|
||||
ffmpeg_cmd.insert(-3, f"scale=-1:{height}")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user