nicetoolbox.utils.video.split_into_frames¶
- nicetoolbox.utils.video.split_into_frames(video_file: str, output_base: str, n_frames_expected: int | None, start_frame: int = 0, keep_indices: bool = True) None[source]¶
Split a video into individual frames using ffmpeg.
- Parameters:
video_file (str) – Path to the input video file.
output_base (str) – Base directory where the frames will be saved.
n_frames_expected (Optional[int]) – Expected number of frames
start_frame (int, optional) – The starting frame index. Defaults to 0.
keep_indices (bool, optional) – Whether to keep the original frame indices or convert them to sequential numbers. Defaults to True.
- Raises:
AssertionError – If splitting the video into frames fails.
Note
- This function uses ffmpeg to split the video into frames. Make sure ffmpeg
is installed and accessible in the system’s PATH.
Warning
- The skip_frames option is not properly working yet. Its output is not fully
understood yet.