A Rust-based command-line application for extracting frames from video files using FFmpeg, supporting both sequential and parallel processing modes.
- Features
- Usage
- Command Line Arguments
- Requirements
- Development
- Building and Testing
- Known Limitations
- Contributing
- Troubleshooting
- Extract frames at specified intervals or one frame per second
- Support for parallel processing using multiple CPU cores
- Experimental seek-based extraction method for consistent temporal sampling
- Robust error handling for file operations and FFmpeg interactions
- Comprehensive test suite for core functionality
The application provides several command-line options to control frame extraction.
To extract frames from a video file using default settings (every 30th frame):
cargo run -- --file input.mp4
The extracted frames will be saved as PNG files in the frames
directory.
To extract one frame per second using the experimental seek-based method:
cargo run -- --file input.mp4 --use-seek
To enable parallel processing by splitting the video into segments and processing them concurrently:
cargo run -- --file input.mp4 --multicore
--file <PATH>
: Specify input video file (default: "video.mp4")--use-seek
: Enable experimental seek-based frame extraction (one frame per second)--multicore
: Enable parallel processing using multiple CPU cores
- FFmpeg installed and available in system PATH
- Rust toolchain (including cargo)
To contribute to this project, you'll need:
- Rust toolchain (nightly version recommended)
cargo install action-validator dircat just
carcargo install --git https://github.com/RustedBytes/invoke-llm
cargo install --git https://github.com/ytmimi/markdown-fmt markdown-fmt --features="build-binary"
- lefthook (for pre-commit hooks)
- yamlfmt (for YAML formatting)
- Clone the repository
- Run
cargo build
to compile the application - Run
cargo test
to execute the test suite - Run
cargo run -- --help
to see command-line options
- The seek-based method is experimental and may not produce accurate results due to keyframe spacing issues
- Parallel processing requires FFmpeg to be installed and available in PATH
Contributions are welcome! Please submit pull requests with clear descriptions of changes and ensure that all tests pass before submitting.
- If you encounter issues with FFmpeg, ensure it's installed and available in your system's PATH.
- If you experience errors during parallel processing, verify that your system has sufficient resources (CPU cores and memory).
- For other issues, please check the issues page or submit a new issue with detailed information about your problem.