MCPcopy Create free account
hub / github.com/Netflix/void-model / read_video_frames

Method read_video_frames

VLM-MASK-REASONER/edit_quadmask.py:256–269  ·  view source on GitHub ↗

Read all frames from a video

(self, video_path)

Source from the content-addressed store, hash-verified

254 self.info_label.config(text=f"Loaded {len(self.mask_frames)} frames", foreground="green")
255
256 def read_video_frames(self, video_path):
257 """Read all frames from a video"""
258 cap = cv2.VideoCapture(str(video_path))
259 frames = []
260 while True:
261 ret, frame = cap.read()
262 if not ret:
263 break
264 # Convert to grayscale if needed
265 if len(frame.shape) == 3:
266 frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
267 frames.append(frame)
268 cap.release()
269 return frames
270
271 def write_video_frames(self, frames, output_path, fps=12):
272 """Write frames to a video file using lossless H.264"""

Callers 1

load_videosMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected