A cross-platform desktop toolkit for trimming and editing audiobooks, video files, and ebooks. TrimShelf bundles seven focused tools into a single lightweight app.
Select individual chapters from an M4B audiobook and export them as a new M4B file. Chapter metadata is preserved in the output.
- Opens
.m4b/.m4afiles - Displays all chapters with checkboxes for individual selection
- Select All / Deselect All shortcuts
- Exports selected chapters as a single
.m4bwith rebuilt chapter metadata - Cancellable with progress feedback
Remove unwanted sections from an M4B audiobook using an interactive timeline. Cut regions are marked visually and the chapter map is remapped to the trimmed timeline.
- Opens
.m4b/.m4afiles - Real-time playback via FFplay with a live playhead
- Timeline visualization — cut regions shown in red
- Mark cut start/end points; add, review, and delete cut regions
- Skip controls: ±1 s and ±10 s
- Exports a trimmed
.m4bwith chapter timestamps adjusted to the new timeline - Cancellable with progress feedback
Remove unwanted sections from a video file with frame-accurate cutting and hardware-accelerated re-encoding options. Powered by an embedded MPV video player.
Requires a build with MPV support. See Building.
- Supports
.mp4,.mkv,.avi,.mov,.wmv,.flv,.webm,.m4v,.mpeg,.mpg - Full in-app video preview with scrubbing
- Frame stepping and time-skip controls
- Mark IN / Mark OUT to define cut regions; manage the cut list before exporting
- Three encoding modes:
- Stream copy — fast, keyframe-aligned (no re-encode)
- GPU re-encode — frame-accurate, hardware accelerated (Apple VideoToolbox, NVIDIA NVENC, AMD AMF, Intel QuickSync detected automatically)
- CPU re-encode — frame-accurate, software encoder
- Output saved alongside the source file with a
_trimmedsuffix
Edit the metadata tags and cover art of an M4B audiobook without re-encoding the audio.
- Opens
.m4b/.m4afiles - Displays and edits Title and Artist tags
- Shows the embedded cover art; replace it with any
.jpgor.pngimage - Preserves all existing chapter metadata in the output
- Exports a new
_tagged.m4bwith updated tags and cover via stream copy (no quality loss)
Merge multiple video files into a single output with drag-and-drop ordering.
- Supports
.mp4,.mkv,.avi,.mov,.wmv,.flv,.webm,.m4v,.mpeg,.mpg - Add multiple files at once via multi-file selection dialog
- Reorder files with Move Up / Move Down buttons or Grab + Drop Here for arbitrary repositioning
- Three encoding modes:
- Stream copy — fast concatenation (requires all files share the same codec and parameters)
- GPU re-encode — re-encodes to a common format using hardware acceleration
- CPU re-encode — universal software re-encode for mixed-format inputs
- Output saved alongside the first file with a
_mergedsuffix - Cancellable with progress feedback
Remove selected chapters from an EPUB ebook while keeping the rest of the document intact.
- Opens
.epubfiles - Lists all spine items (chapters) with checkboxes
- Select All / Deselect All shortcuts
- Exports a new
.epubwith selected chapters removed from the spine - Confirmation prompt before export
Edit the plain text content of individual chapters within an EPUB ebook.
- Opens
.epubfiles - Navigate chapters with Previous / Next buttons or a slider
- Edit chapter text in a multi-line editor
- Revert individual chapters to their original content
- Only modified chapters are rewritten in the output
- Exports a new
_edited.epub; warns about unsaved changes before opening a new file
| Dependency | Required for | Notes |
|---|---|---|
| FFmpeg | M4B Chapter Extractor, M4B Audio Trimmer, Video Trimmer, Video Merger | ffmpeg and ffprobe must be on PATH or placed next to the TrimShelf binary |
| FFplay | M4B Audio Trimmer (playback) | Included with most FFmpeg distributions |
| libmpv | Video Trimmer | Required only for MPV builds |
The EPUB tools have no external dependencies.
- Download
TrimShelf.dmgfrom the latest release. - Open the DMG and drag TrimShelf to your Applications folder.
- Launch TrimShelf from Applications or Spotlight.
- Download
TrimShelf-Setup.exefrom the latest release. - Run the installer (administrator privileges required).
- Launch TrimShelf from the Start Menu or the optional desktop shortcut.
- Download
TrimShelf-Linux-amd64.zipfrom the latest release. - Extract the archive.
- Make the binary executable and run it:
chmod +x trimshelf ./trimshelf
TrimShelf checks for updates automatically at launch. If a newer version is available a dialog will appear with the release notes and an Update Now button.
You can also check manually at any time using the Check for Updates button at the bottom of the main window.
- macOS — downloads the new DMG and opens it; drag TrimShelf to Applications to complete the update.
- Windows — downloads and launches the new installer; TrimShelf closes automatically so the installer can replace it.
- Linux — downloads the new binary, replaces the current one, and relaunches.
- Go 1.25+
- A C compiler (
gccon Linux/Windows, Xcode CLT on macOS) — required for CGO libmpvdevelopment headers (only for the MPV / Video Trimmer build)
make buildmacOS (Homebrew)
brew install mpv
make build-mpvLinux (apt)
sudo apt install libmpv-dev
make build-mpvWindows
Download mpv-dev from shinchiro/mpv-winbuild-cmake and set CGO_CFLAGS / CGO_LDFLAGS accordingly, then:
make build-mpvmake run # standard
make run-mpv # with Video Trimmermake build-windows # produces trimshelf.exe
make build-linux # produces trimshelf (Linux amd64)make cleantrimshelf/
├── main.go # App entry point and tool picker window
├── version.go # Version variable (set at build time via -ldflags)
├── updater.go # GitHub release check and in-app update logic
├── chapter_extractor.go # M4B Chapter Extractor tool
├── audio_trimmer.go # M4B Audio Trimmer tool
├── video_trimmer.go # Video Trimmer tool (MPV build only)
├── video_merger.go # Video Merger tool
├── mpv.go # MPV C bindings (MPV build only)
├── mpv_stub.go # MPV stub for non-MPV builds
├── tag_editor.go # M4B Tag Editor tool
├── epub_cutter.go # EPUB Chapter Cutter tool
├── epub_editor.go # EPUB Text Editor tool
├── epub_util.go # EPUB ZIP/XML read-write utilities
├── util.go # Shared utilities (FFmpeg helpers, path handling)
├── assets/
│ ├── trimshelf.png # App icon (source)
│ └── icon.icns # macOS icon bundle
├── packaging/
│ ├── Info.plist # macOS bundle metadata
│ ├── entitlements.plist # macOS code signing entitlements
│ ├── installer.iss # Windows Inno Setup script
│ └── dmg_ds_store # macOS DMG layout
└── .github/workflows/
└── build.yml # CI/CD: build, sign, notarize, release
go test ./...
go test -v -tags mpv ./... # include MPV buildVersions are injected at build time:
go build -ldflags "-X main.version=v1.2.3" .Untagged builds default to dev. The CI pipeline sets the version from the Git tag (v*) or falls back to dev-<short SHA>.
To publish a release, push a tag:
git tag v1.2.3
git push origin v1.2.3The CI workflow will build signed/notarized artifacts for macOS, Windows, and Linux and publish them as a GitHub Release automatically.
Builds run on GitHub-hosted runners via .github/workflows/build.yml:
| Platform | Runner | Artifact |
|---|---|---|
| macOS (ARM64) | macos-latest |
TrimShelf.dmg (signed + notarized) |
| Windows (amd64) | windows-latest |
TrimShelf-Setup.exe |
| Linux (amd64) | ubuntu-latest |
TrimShelf-Linux-amd64.zip |
Releases are created automatically when a v* tag is pushed. The release notes are generated from commits since the previous release tag.
See LICENSE.