VideoCutter is a .NET console application that splits a video into segments and processes them in parallel through an FFmpeg pipeline.
The project is primarily an exercise in asynchronous programming, external process execution, dependency injection, event-driven UI updates, and layered application architecture.
- splits a source video into fixed-duration segments;
- applies a configurable processing pipeline to every segment;
- supports the
Resizefilter; - reads processing settings from JSON;
- supports cancellation with
Ctrl+CandCancellationToken; - includes a fake command executor for testing the processing flow without writing output videos.
- C# and .NET 9
- FFmpeg and FFMpegCore
- Microsoft.Extensions.DependencyInjection
- System.Text.Json
- System.Threading.Channels
The solution is divided into five projects:
VideoCutter/
├── Domain/ # processing definitions, filters, commands, and value objects
├── Application/ # configuration contracts, use cases, engine, and processing events
├── Infrastructure/ # JSON, FFmpeg, file-system, and console implementations
├── Presentation/ # UI components, event dispatcher, and rendering contracts
├── VideoCutter/ # composition root, DI registrations, and coordinator
└── VideoCutter.sln
- .NET 9 SDK
ffmpegandffprobeavailable throughPATH, or the FFmpeg binaries placed underVideoCutter/Toolsin the directory layout expected byProgram.cs
The current composition root uses FakeCommandExecutor, so FFmpeg commands are built and the input metadata is read, but output video segments are not written. To enable real processing, replace services.AddFakeProcessing() with services.AddFFmpegProcessing() in VideoCutter/Program.cs.
Edit VideoCutter/config.json before running the application:
{
"info": {
"inputFilePath": "C:\\Videos\\input.mp4",
"outputFolderPath": "C:\\Videos\\Output"
},
"segmentation": {
"chunkDuration": "00:00:20",
"offset": "00:00:00"
},
"pipelineDefinition": {
"steps": [
{
"type": "Resize",
"parameters": {
"width": "1080",
"height": "1920"
}
}
]
}
}Configuration fields:
| Field | Description |
|---|---|
info.inputFilePath |
Path to the source video. |
info.outputFolderPath |
Directory for processed segments. |
segmentation.chunkDuration |
Target duration of each segment. |
segmentation.offset |
Position in the source video where processing starts. |
pipelineDefinition.steps |
Ordered list of filters applied to every segment. |
The Resize filter requires positive integer width and height parameters.
git clone https://github.com/BISCUITIC/VideoCutter.git
cd VideoCutter
dotnet restore
dotnet run --project VideoCutter/VideoCutter.csprojPress Ctrl+C to cancel processing gracefully.
Before processing |
After processing |
- only the
Resizepipeline step is implemented; - switching between the fake and real command executors requires changing the DI registration in
Program.cs;
This project is licensed under the MIT License.


