Command-line tool to remove unwanted audio language tracks from MKV files.
LangFilter helps you clean up MKV video files by removing audio tracks in unwanted languages. It provides both interactive and automated modes, with configuration file support for batch processing.
- Interactive mode: Choose which audio tracks to keep from a visual menu
- Non-interactive mode: Apply predefined rules from configuration files
- Batch processing: Process multiple MKV files at once
- Flexible configuration: Remove specific languages or keep only desired ones
- Safe operations: Replaces original files with filtered versions, creates backups with
_originalprefix - Track analysis: Uses
mkvinfoto analyze audio tracks before processing
LangFilter requires mkvtoolnix for MKV file processing:
Ubuntu/Debian:
sudo apt install mkvtoolnixmacOS (Homebrew):
brew install mkvtoolnixArch Linux:
sudo pacman -S mkvtoolnix-cliOther platforms: Download from mkvtoolnix.download
This project uses uv for dependency management.
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh -
Install the project:
uv sync
-
The
langfiltercommand will be available after installation.
langfilter movie.mkvlangfilter --non-interactive *.mkvlangfilter movie.mkvlangfilter --no-backup movie.mkvCreate a configuration file to automate track selection. LangFilter looks for config files in:
./langfilter.ini(current directory)./.langfilter.ini(current directory, hidden)~/.config/langfilter/config.ini(user config directory)~/.langfilter.ini(user home directory)
[DEFAULT]
# Remove Russian and Ukrainian tracks
remove=rus,ukr
# Or keep only English and unknown tracks
# keep=eng,unknownlangfilter [OPTIONS] FILES...
Options:
-o, --output PATH Output file path (single file only)
-n, --non-interactive Non-interactive mode using config rules
--no-backup Don't create backup (default: creates backup with _original prefix)
-c, --config PATH Path to configuration file
--version Show version
For development setup:
make install # Install dependencies
make lint # Run linting and formatting
make test # Run tests
make # Run all checks- Python 3.13+
mkvtoolnix(formkvinfoandmkvmergecommands)
See LICENSE file for details.