Skip to content

About

Tool for batch processing MKV files to remove specified audio track languages and set the desired language as default.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

MKV Audio Track Processor

This repository provides a Python-based command-line tool to batch process .mkv files within a specified directory. It allows you to remove specific language audio tracks and set a desired language as the default.

Features

  • Traverse a specified directory to identify .mkv files.
  • Remove unwanted language audio tracks (e.g., Russian, Spanish).
  • Set a specific language audio track (e.g., English) as the default.
  • Supports both overwrite mode and duplicate mode to maintain original files.
  • Generates detailed logs for each operation.

Prerequisites

  • Python 3.6 or newer.
  • The following utilities must be installed:
    • mkvmerge and mkvpropedit from MKVToolNix suite.
    • For users on Ubuntu:
      sudo apt-get install mkvtoolnix
    • For users with Chocolatey on Windows:
      choco install mkvtoolnix
    • For manual installation, visit the MKVToolNix download page.

Installation

  1. Install Python (if not already installed).
  2. Install MKVToolNix.
  3. Clone this repository:
    git clone https://github.com/FREQ-EE/mkv-audio-track-processor.git
    cd mkv-audio-track-processor

Usage

  1. Run the script to process .mkv files within a specified directory:
    python mkv_audio_track_processor.py
  2. During runtime, the script will prompt for the following inputs:
    • Directory Path: Specify the path to the directory containing .mkv files to be processed.
    • Languages to Remove: Provide the languages you wish to remove, separated by commas (e.g., ru, es, it).
    • Default Language: Specify which language should be set as the default (e.g., en).

The script will then proceed to process each .mkv file in the directory. A summary log will be saved in the logs folder, including information about the files examined, updated, and those that had no track for the specified default language.

Note: If multiple tracks for the desired default language are found, the first occurrence will be set as the default.

Modes of Operation

  • Overwrite Mode (Default): The original .mkv file is modified directly.
  • Duplicate Mode: Creates a new file with a _processed suffix, retaining the original file.
    • To enable this mode, change mode in the script to 1:
      mode = 1

Logs

Logs are created for each session under the logs/ directory, providing summaries such as:

  • Root directory traversed.
  • Number of .mkv files examined.
  • Number of files updated with the default language.
  • Files without the specified default language.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Tool for batch processing MKV files to remove specified audio track languages and set the desired language as default.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages