From 2889cb9b44737a382ed3daa887b44dc7c5500381 Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Wed, 24 Dec 2025 18:29:12 +0530 Subject: [PATCH 1/4] fix: Fit Enum --- videodb/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/videodb/editor.py b/videodb/editor.py index 9efc793..4c3ae25 100644 --- a/videodb/editor.py +++ b/videodb/editor.py @@ -16,8 +16,8 @@ class AssetType(str, Enum): class Fit(str, Enum): """Set how the asset should be scaled to fit the viewport using one of the following options: - crop (default) - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport. + crop (default) - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport. cover - stretch the asset to fill the viewport without maintaining the aspect ratio. contain - fit the entire asset within the viewport while maintaining the original aspect ratio. none - preserves the original asset dimensions and does not apply any scaling.""" @@ -25,6 +25,7 @@ class Fit(str, Enum): crop = "crop" cover = "cover" contain = "contain" + none = None class Position(str, Enum): From 1f325b15965464abecbd67a4f828fd82e7998d69 Mon Sep 17 00:00:00 2001 From: ashish-spext Date: Thu, 25 Dec 2025 13:41:08 +0530 Subject: [PATCH 2/4] Add reframe, smart vertical reframe and download functionality for video objects --- videodb/_constants.py | 6 ++++ videodb/video.py | 75 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/videodb/_constants.py b/videodb/_constants.py index e62a70d..0654846 100644 --- a/videodb/_constants.py +++ b/videodb/_constants.py @@ -33,6 +33,11 @@ class Workflows: add_subtitles = "add_subtitles" +class ReframeMode: + simple = "simple" + smart = "smart" + + class SemanticSearchDefaultValues: result_threshold = 5 score_threshold = 0.2 @@ -85,6 +90,7 @@ class ApiPath: meeting = "meeting" record = "record" editor = "editor" + reframe = "reframe" class Status: diff --git a/videodb/video.py b/videodb/video.py index 430e297..b4ddda2 100644 --- a/videodb/video.py +++ b/videodb/video.py @@ -3,6 +3,7 @@ from videodb._constants import ( ApiPath, IndexType, + ReframeMode, SceneExtractionType, SearchType, Segmenter, @@ -654,3 +655,77 @@ def get_meeting(self): **meeting_data, ) return None + + def reframe( + self, + start: Optional[float] = None, + end: Optional[float] = None, + target: Union[str, Dict[str, int]] = "vertical", + mode: str = ReframeMode.smart, + callback_url: Optional[str] = None, + ) -> Optional["Video"]: + """Reframe video to a new aspect ratio with optional object tracking. + + :param float start: Start time in seconds (optional) + :param float end: End time in seconds (optional) + :param Union[str, dict] target: Target format - preset string (e.g., "vertical", "square", "landscape") or {"width": int, "height": int} + :param str mode: Reframing mode - "simple" or "smart" (default: "smart") + :param str callback_url: URL to receive callback when processing completes (optional) + :raises InvalidRequestError: If the reframe request fails + :return: :class:`Video