Sinapsa.Video.ConvertorWrap.Net is a .NET 8 background worker that batch-converts video files with HandBrakeCLI and tracks completed conversions in SQLite.
- Scans an input folder recursively for supported video files
- Converts files with HandBrakeCLI
- Supports CPU and NVIDIA GPU encoding modes
- Supports 10-bit output selection
- Preserves relative folder structure in the output folder
- Avoids reprocessing files by logging completed work in SQLite
- Can reset logged conversions in development mode
- Includes a Dockerfile for containerized builds
- .NET 8
- C# 12
- Generic Host / BackgroundService
- Microsoft.Extensions.Configuration
- Microsoft.Extensions.DependencyInjection
- Microsoft.Data.Sqlite
- HandBrakeCLI
At startup, the application:
- Loads configuration from
appsettings.jsonandappsettings.Development.json - Registers the hosted worker and supporting services
- Scans the configured input directory for supported video files
- Builds HandBrakeCLI arguments for each file
- Writes converted files to the configured output directory
- Stores conversion history in
logs/convert.db
The current implementation scans for these extensions:
.mkv.mp4.avi.mov.wmv.flv.mpg.mpeg.webm.m4v
The application currently uses these configuration keys:
| Key | Description |
|---|---|
InputFolder |
Root folder containing source video files |
OutputFolder |
Root folder where converted files are written |
OutputProfile |
Name of the encoding profile from EncodingProfiles |
HandBrakeCLI |
Path to the HandBrakeCLI executable |
UseCPU |
Enables CPU encoding when true |
Use10Bit |
Enables 10-bit encoding when supported by the selected mode |
IsDevelopment |
Clears the conversion log on startup when true |
Recoder |
String appended to the generated output filename |
Profiles are defined under EncodingProfiles in appsettings.json. Each profile contains:
PresetQualityHeight
{
"Recoder": "COPiUmZ",
"InputFolder": "D:\\Video\\Input",
"OutputFolder": "D:\\Video\\Output",
"OutputProfile": "FCPZ_1080p_MeGusta",
"HandBrakeCLI": "Tools\\HandBrakeCLI.exe",
"UseCPU": false,
"Use10Bit": true,
"IsDevelopment": false
}- .NET 8 SDK
- HandBrakeCLI available at the configured path
- Windows environment if you use the bundled
Tools\\HandBrakeCLI.exe
dotnet restore
dotnet builddotnet run --project .\Sinapsa.Video.ConvertorWrap.Net\Sinapsa.Video.ConvertorWrap.Net.csproj- Converted files are written under the configured output directory
- Conversion history is stored in
logs/convert.db - Each log entry stores:
- relative input path
- output path
- status
- duration
- timestamp
A Dockerfile is included for building and publishing the worker as a container.
Example build:
docker build -t sinapsa-video-convertorwrap-net .appsettings.Development.jsonis currently required at startup- The project uses a bundled
HandBrakeCLI.exepath by default - NVIDIA usage detection is present in the code for GPU-related execution flow
This project is licensed under the MIT License.
Radu Slavila