From 5f013c891f37885588b14f633d791d0568c99b3c Mon Sep 17 00:00:00 2001 From: Dillon Laird Date: Sun, 22 Sep 2024 12:39:12 -0700 Subject: [PATCH] standardize fps to 1 --- vision_agent/utils/video.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vision_agent/utils/video.py b/vision_agent/utils/video.py index ba6b0c76..0bb6fb18 100644 --- a/vision_agent/utils/video.py +++ b/vision_agent/utils/video.py @@ -61,6 +61,7 @@ def video_writer( stream.height = height - (height % 2) stream.width = width - (width % 2) stream.pix_fmt = "yuv420p" + stream.options = {"crf": "10"} for frame in frames: # Remove the alpha channel (convert RGBA to RGB) frame_rgb = frame[:, :, :3] @@ -77,7 +78,7 @@ def video_writer( def frames_to_bytes( - frames: List[np.ndarray], fps: float = 10, file_ext: str = ".mp4" + frames: List[np.ndarray], fps: float = 1.0, file_ext: str = ".mp4" ) -> bytes: r"""Convert a list of frames to a video file encoded into a byte string.