Crate extract_frames Copy item path Source Args ๐ Command line argument parser using clap derive macro
Defines the CLI interface for the frame extraction application FRAMES_BETWEEN_EXTRACTED ๐ Number of frames to skip between extracted frames
For 30fps video, skipping 30 frames extracts 1 frame per second
Adjust this value to control extraction frequency and output size FRAME_FILES_PATTERN ๐ Glob pattern to match all PNG frame images in the frames directory
Used for cleanup operations and file enumeration SEGMENTED_FILES_PATTERN ๐ Glob pattern to match all MP4 segment files in the segments directory
Used for finding and cleaning up temporary segment files after processing SEGMENT_DURATION_SECONDS ๐ Duration in seconds for each video segment when splitting videos
for parallel processing. Default is 5 seconds per segment. SEGMENT_OUTPUT_PATTERN ๐ File naming pattern for ffmpeg segment output files using printf-style
formatting %09d creates zero-padded 9-digit numbers (e.g.,
output_000000001.mp4
) cleanup_temporary_files ๐ Cleans up the working directories by removing all PNG images in the frames
folder and all MP4 segments in the segments
folder. Logs the result. decode_frames_dropping ๐ Decodes video frames by dropping frames according to
FRAMES_BETWEEN_EXTRACTED
constant. decode_frames_seeking ๐ Decodes one frame per second by seeking to specific timestamps. get_files ๐ Finds all files matching the given glob pattern and returns their paths. main ๐ Main entry point for the frame extraction application. remove_files ๐ Attempts to remove all files in the specified slice with batch error
handling. remove_folder ๐ Removes a directory and all its contents recursively. save_rgb_to_image ๐ Saves raw RGB pixel data as a PNG image at the specified path. split_into_segments ๐ Uses ffmpeg to split the source video file into several segments.