ssapy_toolkit.Plots.write_videos
Functions
|
Write frames to an MP4 video file, with natural sorting and uniform size. |
- ssapy_toolkit.Plots.write_videos.write_video(video_name, frames, fps: int = 30, *, sort_frames: bool = True, warn_on_ambiguous: bool = True, target_size: tuple = None, freeze_last_seconds: float = 0.0)[source]
Write frames to an MP4 video file, with natural sorting and uniform size.
- Parameters:
video_name (str) – Output path ending with .mp4
frames (iterable of str, str, or Path) –
Iterable of image file paths, OR
Path to a folder (all files in it are used), OR
Wildcard pattern string (e.g. ‘frames_*.png’, ‘root/**/frame_*.png’).
fps (int) – Frame rate.
sort_frames (bool) – If True, apply natural sort to the input paths.
warn_on_ambiguous (bool) – Emit warnings when sorting is ambiguous.
target_size ((W, H) or None) – Output frame size in pixels. If None, use the size of the first frame.
freeze_last_seconds (float) – Extra number of seconds to “freeze” the last frame by repeating it.