Function main

Source
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

  1. Initialize logging and video processing libraries
  2. Create frames/ and segments/ directories
  3. Clean up previous files
  4. Process video based on selected mode
  5. Remove temporary segment files

§Arguments

See Args struct for detailed command line options.

§Returns

  • Ok(()) on successful completion
  • Err 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