diff --git a/README.md b/README.md index 7b6e849..bf166d0 100644 --- a/README.md +++ b/README.md @@ -1 +1,188 @@ -# Splitter \ No newline at end of file +# Splitter + +Splitter is a command line tool for cutting video files into equal length or fixed length segments using FFmpeg. +It supports multi threaded splitting, ETA and speed reporting, flexible duration formats, and a simple terminal user interface. + +This tool is intended for creators, archivists, and automation workflows that need fast and predictable video segmentation. + +--- + +## Features + +- Multi threaded splitting for high performance +- Equal length segments (default) +- Fixed length segments with the `--force` option +- Flexible duration formats (`Ns`, `NmMs`, or plain seconds) +- Estimate only mode (`--estimate`) +- Terminal progress display with ETA and speed +- Custom output filename masks +- FFmpeg passthrough for advanced users +- Cross platform (.NET 10) + +--- + +## Requirements + +- FFmpeg and FFprobe installed and available in the system PATH +- .NET 10 SDK or newer + +--- + +## Usage + +``` +splitter [options] [--] +``` + +--- + +## Options + +### --duration= + +Overrides the default 60 second target chunk size. + +Accepted formats: + +| Format | Meaning | +|--------|---------| +| Ns | N seconds | +| NmMs | N minutes and M seconds | +| N | N seconds (plain number) | + +Examples: + +``` +--duration=90s +--duration=2m30s +--duration=45 +``` + +Without `--force`, the program adjusts the segment length so that all segments are equal. + +--- + +### --force + +Uses the duration exactly as provided. +The last segment may be shorter. + +Example: + +``` +--duration=45 --force +``` + +--- + +### --estimate + +Prints calculated segment information and exits. +No splitting is performed. + +Example: + +``` +splitter video.mp4 out/ --duration=2m30s --estimate +``` + +--- + +### --mask= + +Custom output filename pattern. + +Default: + +``` +_Seg%03d.mp4 +``` + +Supports: + +- `%03d` for zero padded index +- `%d` for plain index + +Example: + +``` +--mask="Part_%03d.mp4" +``` + +--- + +### FFmpeg passthrough + +Anything after `--` is passed directly to FFmpeg. + +Example: + +``` +splitter video.mp4 out/ -- -an -sn +``` + +--- + +## How It Works + +1. Reads total duration using ffprobe +2. Parses the target duration (default 60 seconds or from `--duration=`) +3. Computes the number of segments +4. If not forced, adjusts segment length so all segments are equal +5. Runs multiple FFmpeg processes in parallel +6. Displays progress, ETA, and speed in the terminal + +--- + +## Examples + +Split into equal 60 second segments: + +``` +splitter video.mp4 out/ +``` + +Split into equal 90 second segments: + +``` +splitter video.mp4 out/ --duration=90s +``` + +Split into fixed 45 second segments: + +``` +splitter video.mp4 out/ --duration=45 --force +``` + +Estimate only: + +``` +splitter video.mp4 out/ --duration=2m30s --estimate +``` + +Custom output names: + +``` +splitter video.mp4 out/ --mask="Clip_%03d.mp4" +``` + +Pass extra flags to FFmpeg: + +``` +splitter video.mp4 out/ -- -an -sn +``` + +--- + +## Building + +``` +dotnet build +``` + +Or run directly: + +``` +dotnet run -- video.mp4 out/ +``` +