pub(crate) fn main() -> Result<(), Error>
Expand description
Main entry point for the frame extraction application.
Parses command line arguments, initializes dependencies, and executes the frame extraction process based on user selections. Supports sequential processing, seek-based extraction, and parallel segment processing.
§Processing Modes
- Standard (default) - Sequential frame dropping with
FRAMES_BETWEEN_EXTRACTED
interval - Seek-based (–use-seek) - Extract one frame per second using seeking
- Parallel (–multicore) - Process video segments in parallel
§Workflow
- Initialize logging and video processing libraries
- Create frames/ and segments/ directories
- Clean up previous files
- Process video based on selected mode
- Remove temporary segment files
§Arguments
See Args struct for detailed command line options.
§Returns
Ok(())
on successful completionErr
with error details if processing fails
§Example Usage
# Basic frame extraction (every 30th frame)
cargo run -- --file input.mp4
# Extract one frame per second
cargo run -- --file input.mp4 --use-seek
# Parallel processing for large videos
cargo run -- --file input.mp4 --multicore