Skip to content
m4bwav edited this page Oct 1, 2026 · 2 revisions

TrailerClipper cuts a fixed length off the start (the intro) and the end (the trailer) of video and audio files, one file or a whole folder at a time, and writes the clipped copies beside the originals. It does the cutting by running the ffmpeg and ffprobe programs installed on your machine. It is not a video editor and not a general ffmpeg wrapper: it cuts by length only, and ffmpeg re-encodes each copy with its defaults for the file's extension.

There are two packages, both at 2.0.0 (published 2026-09-27):

dotnet add package TrailerClipper
dotnet tool install -g TrailerClipper.Tool

The smallest example

A folder Episodes holds four 10-second files (MP4, MP3, WAV, M4B), a Matroska file and a text file. This removes the first 1.5 seconds and the last 2 seconds of each media file:

using TrailerClipperLib;

var clipper = new TrailerClipper();
clipper.RemoveIntrosAndTrailers("Episodes", 1500m, 2000m);

It prints (on Windows; <cwd> stands for the full path of the current folder):

Starting on file: Episodes\ep1.mp4
Finished on trimming file, output: <cwd>\Episodes\clipped\ep1.mp4
Starting on file: Episodes\ep2.mp3
Finished on trimming file, output: <cwd>\Episodes\clipped\ep2.mp3
Starting on file: Episodes\ep3.wav
Finished on trimming file, output: <cwd>\Episodes\clipped\ep3.wav
Starting on file: Episodes\ep4.m4b
Finished on trimming file, output: <cwd>\Episodes\clipped\ep4.m4b

The folder afterwards, each file with the duration and streams ffprobe reports:

Episodes/clipped/ep1.mp4: 6.500 s; video h264, audio aac
Episodes/clipped/ep2.mp3: 6.500 s; audio mp3
Episodes/clipped/ep3.wav: 6.500 s; audio pcm_s16le
Episodes/clipped/ep4.m4b: 6.509 s; audio aac
Episodes/ep1.mp4: 10.000 s; video h264, audio aac
Episodes/ep2.mp3: 10.000 s; audio mp3
Episodes/ep3.wav: 10.000 s; audio pcm_s16le
Episodes/ep4.m4b: 10.000 s; audio aac
Episodes/extra.mkv: 10.003 s; video h264, audio vorbis
Episodes/notes.txt: 10 bytes, not media

The .mkv and .txt files were left alone: only eight extensions are clipped unless you ask for every file (How files are clipped). The same call through the command line is tclipper -i 1500 Episodes 2000 (Commands).

Every output on these pages was printed by a program run against the packages published on nuget.org. It ran with ffmpeg 9.0.1 on Windows 11, and with ffmpeg n9.0.2 on Ubuntu 26.04 in WSL where a page says Linux. The input files were made with ffmpeg's test sources, and every example ran on a fresh copy of them.

Pages

Page Read it when
Getting started installing the library or the tool, getting ffmpeg, and the first call on .NET 10, .NET 8, .NET Framework 4.8 or F#
Commands using tclipper: every option, exit codes, which messages go to stderr, --install-ffmpeg
Configuration saving settings to a JSON file, reading them back, and telling TrailerClipper where ffmpeg is
How files are clipped you need to know which files are clipped, where the copies go, how long they come out and what ffmpeg does to them
Errors and edge cases something threw or printed a message, or a file was skipped
API reference you want every public type and member, with what it throws
Recipes clipping several folders at once, collecting failures, capturing the progress lines
Versions and upgrading moving from 1.x, or checking what changed in 2.0.0
FAQ short answers with links to the detail
Development building, testing and releasing the two packages

Elsewhere: the README, the CHANGELOG and the issues.

Clone this wiki locally