cvml.video¶
-
cvml.video.
stitch_frames
(frame_dir: pathlib.Path, output_file: pathlib.Path, start_idx: int, stop_idx: int, step=1, fps=59.94, overwrite=False, frame_pattern=re.compile('.*jpg', re.IGNORECASE))[source]¶ Stitch a directory containing sequentially numbered frames into a video using FFMpeg
Parameters: - frame_dir – directory whose children are all frames
- output_file – path to video file composed from stitching all the frames in
frame_dir
- start_idx – index of the first frame to stitch after listing and sorting all frames with
list.sort()
- stop_idx – index of the last frame to stitch after listing and sorting all frames with
list.sort()
, use -1 to calculate the last frame based on thestart_idx
andstep
- step – step size between adjacent frames (use 1 for stitching all frames, 2 for skipping every other frame, -1 for reversing the video)
- fps – frames per second for the resulting video
- overwrite – overwrite the
output_file
if it already exists? - frame_pattern – python regex pattern for selecting a subset of files, defaults to selecting everything
Returns: None