A powerful TUI tool to interactively select and remux audio/subtitle tracks from video files
Project description
TrackRemux
TrackRemux is a powerful Terminal User Interface (TUI) tool designed to help you clean up your video library. It allows you to interactively specify audio and subtitle tracks from your video files and remux them into clean, optimized containers without re-encoding the video stream.
This whole project was vibe coded on a Friday evening out of necessity while organizing the media library on my NAS.
[!TIP] Check out the CHANGELOG to see what's new in the latest version!
🚀 Purpose
Modern media often comes with a bloat of unnecessary tracks - commentary audio, multiple languages you don't speak, or dozens of subtitle formats. TrackRemux simplifies the process of removing this clutter.
This not only saves significant disk space but also prevents the confusion and inconvenience of managing tracks in media players (like those on Smart TVs or mobile devices) where selecting the right audio or subtitle stream can be cumbersome or even impossible.
Instead of wrestling with complex ffmpeg command-line arguments for every single file, TrackRemux provides a visual interface to:
- Scan directories for video files.
- Select exactly which tracks you want to keep.
- Remux the file efficiently (Direct Stream Copy).
✨ Features
- Interactive TUI: Built with
cursesfor a fast, keyboard-centric workflow. - Batch Processing: Automatically detects and processes TV shows/series/collections sequentially.
- Smart Detection: Recognizes series patterns (S01E01, 1x01, Ep01) and groups by season.
- Structural Fingerprinting: Groups files with identical track structure.
- Unified Editing: Edit one file, apply changes to all files in the batch.
- Rich Meta-data Explorer:
- Displays file sizes, track counts, and audio languages at a glance.
- Visual Status Indicators: Instantly spot files that have already been converted (Green size) or are currently processing (Dim Yellow).
- Folder Navigation: Browse nested directory structures (
Enterto open,Escto go back).
- Deep Track Inspection:
- Track Reordering: Move tracks up/down with
Shift+Arrowkeys to set their index in the final file. - External Tracks: Automatically detects and integrates external audio/subtitle files (even in
Audio/orSubs/subfolders). - Language Management: Guesses 30+ languages from filenames (e.g.
dut.srt) or supports manual setting via the[L]key. - Smart Matching: Automatically detects existing conversions and restores your previous track selections.
- Track Reordering: Move tracks up/down with
- Preview Capabilities: Listen to audio tracks directly from the TUI (macOS
afplayintegration) to confirm contents before keeping them. - Safe Conversion:
- Uses
ffmpegfor robust processing. - Non-destructive: Creates new files (
converted_filename) by default. - Real-time progress bar and size estimation.
- Uses
📸 Visual Walkthrough
1. Launch & Directory Scan
Scan any folder to instantly see track counts and sizes.
2. Intelligent Track Selection
Pick exactly what you need. Audio previews help distinguish between different dubs or commentaries.
3. External Tracks & Language Editing
TrackRemux finds external subtitle/audio files automatically. You can also manually correct missing language tags.
4. Fast, Lossless Conversion
Watch the progress in real-time as ffmpeg remuxes your file at disk-IO speeds.
5. Successful Completion
Final sizes and success messages are displayed directly in the TUI upon completion.
6. Efficient Storage
Remuxing is lossless and fast. You can see the significant size savings in your directory listing without any quality loss.
🛠️ Prerequisites
- Python 3.10+
- FFmpeg must be installed and accessible in your system PATH.
- macOS:
brew install ffmpeg
- macOS:
📦 Installation & Setup
Option 1: Install as a Global Tool (Recommended)
The easiest way to use TrackRemux is to install it globally using uv:
uv tool install trackremux
Once installed, you can simply run trackremux from any directory.
Option 2: Running from Source
If you prefer to run it directly from the repository:
-
Clone the repository:
git clone https://github.com/antimirov/trackremux.git cd trackremux
-
Run using the wrapper:
python3 trackremux.py /path/to/media
-
Run as a module:
python3 -m trackremux /path/to/media
-
Using
uv(for development):uv sync uv run trackremux /path/to/media
🖥️ Usage
You can point TrackRemux to a directory (Explorer Mode) or a specific video file (Editor Mode).
Explorer Mode (Directory)
Browse and process your entire library:
trackremux /path/to/your/movies
Single File Mode
Jump straight into the track editor for a specific file:
trackremux "My Movie.mkv"
⌨️ Keyboard Controls
File Explorer
| Key | Action |
|---|---|
| ↑ / ↓ | Navigate file list |
| PgUp / PgDn | Scroll pages |
| Enter | Open selected file in Editor |
| B | Open Batch Selector (when batches detected) |
| M | Toggle Mouse Support |
| Q | Quit Application |
| R | Force Re-scan current directory |
| Ctrl+C | Force Quit instantly |
| N / S / T / A | Sort by Name, Size, Tracks, Audio Size |
Track Editor
| Key | Action |
|---|---|
| Space | Toggle Track (Keep/Discard) |
| Enter | Preview Track (Audio only) |
| ← / → | Seek in preview |
| ↑ / ↓ | Navigate Tracks |
| Shift+↑ / ↓ | Move selected track UP / DOWN |
| L | Set Language (Manual edit) |
| S | Start Conversion / Save changes |
| Esc / Q | Back to Explorer |
🗺️ Roadmap
(Complexity: 🟢 Low, 🟡 Medium, 🔴 High) (Priority: 🔥 High, ⚡ Medium, 🧊 Low)
- 🟠 ⚡ Batch Processing: ✅ Completed in v0.6.0 - Automatic detection and sequential processing of TV series
- 🔴 🧊 Modern TUI: Consider migrating to
Textualfor better UI/UX and cross-terminal compatibility. - 🟡 🔥 Custom Rules: Auto-selection of tracks based on preferred languages.
- 🔴 🧊 Multi-Language Streams: Support for
mul/ dual-audio tracks (complex mapping).
📝 License
MIT License. See LICENSE for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trackremux-0.6.0.tar.gz.
File metadata
- Download URL: trackremux-0.6.0.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8459eb05855bb119213f05caa7f316e0e82b4f4ed93273145b73d697f1b5fd06
|
|
| MD5 |
97a41cd335d66c01d39758e8e8b7c03a
|
|
| BLAKE2b-256 |
389d0a4b00a06c830dcba52de66f902842bc31fcd9ea2465940f8370dbb59d17
|
File details
Details for the file trackremux-0.6.0-py3-none-any.whl.
File metadata
- Download URL: trackremux-0.6.0-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a24d698e342372c2bdf35294b4a329d157f54f899577a6df76d5d9ee0a9a0fb
|
|
| MD5 |
1c59b8eecf2497e4fb6266300a3e713f
|
|
| BLAKE2b-256 |
4dd2cae9d3da0cae0a7b35416a41bf0512323f5c9c42c6801dc2e463f76c3efb
|