# MKVToolNix Batch Tool [![Build](https://img.shields.io/badge/build-passing-%23bf7e45?style=for-the-badge)](https://github.com/iPzard/mkvtoolnix-batch-tool#readme) [![License](https://img.shields.io/github/license/iPzard/mkvtoolnix-batch-tool?color=bf7e45&style=for-the-badge)](https://github.com/iPzard/mkvtoolnix-batch-tool/blob/master/LICENSE) [![Github All Releases](https://img.shields.io/github/downloads/iPzard/mkvtoolnix-batch-tool/total.svg?color=bf7e45&style=for-the-badge)](https://github.com/iPzard/mkvtoolnix-batch-tool/releases) > Batch video and subtitle processing program to help you add (merge) or remove subtitles from your video library. Allows you to process a directory, and/or all of its subdirectories, in a single batch. >


## 💾 Downloads MKVToolNix Batch Tool works on Windows 32-bit (x86) and Windows 64-bit (x64) operating systems, see the project's [releases page](https://github.com/iPzard/mkvtoolnix-batch-tool/releases) for download links.

## 🔨 Merging subtitles When there's only one video file per subdirectory, all subtitle files in that same subdirectory will be merged into the video, regardless of the subtitle file's name. However, when there are multiple videos in a subdirectory, videos will only be merged with subtitle files that contain the video's full name within (or as) the subtitle file name, less the file extension and overrides (if included). The language of each subtitle file is determined automatically by parsing through text in the files as they're being merged. If set, languages matching your Default language track in the settings page will be set as the default subtitle track on your merged video(s). You also have the option to override these settings for individual subtitle files by updating in the subtitle file name(s) as shown in the override examples below.

**Example (e.g., movies):**
  
    📂Movies
    ┣ 📂Resident Evil (2002)
    ┃ ┣ 📺Resident Evil (2002) [1080p].mp4
    ┃ ┣ 📜Resident Evil (2002) [1080p].en.srt
    ┃ ┣ 📜Resident Evil (2002) [1080p].es.srt
    ┃ ┗ 📜Subtitles French.srt 👈 when only 1 video, all subtitles regardless of name, are merged
    ┣ 📂Resident Evil Afterlife (2010)
    ┃ ┣ 📺Resident Evil Afterlife (2010) [1080p].avi
    ┃ ┗ 📜Resident Evil Afterlife (2010) [1080p].pgs 👈 language is always determined automatically
    ┣ 📂Resident Evil Apocalypse (2004)
    ┃ ┣ 📺Resident Evil Apocalypse (2004) [1080p].mkv
    ┃ ┣ 📜Resident Evil Apocalypse (2004) [1080p].ass
    ┃ ┣ 📜Resident Evil Apocalypse (2004) [1080p] German.srt
    ┃ ┗ 🎨Movie poster.png 👈 extra non-video, non-subtitle files may exist
    ┣ 📂Resident Evil Extinction (2007)
    ┃ ┣ 📺Resident Evil Apocalypse (2004) [1080p].wmv
    ┃ ┗ 📜Resident Evil Apocalypse (2004) [1080p].ssa
    ┣ 📂Resident Evil Retribution (2012)
    ┃ ┣ 📺Resident Evil Retribution (2012) [1080p].ogg
    ┃ ┣ 📜Resident Evil Retribution (2012) [1080p].en.srt
    ┃ ┣ 📜Resident Evil Retribution (2012) [1080p] Italian.srt
    ┃ ┣ 📜Resident Evil Retribution (2012) [1080p] Japanese.srt
    ┃ ┗ 📜Resident Evil Retribution (2012) [1080p] Russian.srt
    ┣ 📂Resident Evil The Final Chapter (2016)
    ┃ ┣ 📺Resident Evil The Final Chapter (2016) [1080p].ogm
    ┃ ┣ 📜Resident Evil The Final Chapter (2016) [1080p] Dutch.srt
    ┃ ┣ 📜Resident Evil The Final Chapter (2016) [1080p] Swedish.srt
    ┃ ┗ 📜Resident Evil The Final Chapter (2016) [1080p] Portuguese.srt
  

**Example (e.g., TV show):**
  
    📂Some TV Show
    ┣ 📂Season 01
    ┃ ┣ 📺Some TV Show S01E01.mp4
    ┃ ┣ 📜Some TV Show S01E01.en.srt 👈 with multiple videos, subtitle file name must include video's
    ┃ ┣ 📜Some TV Show S01E01.es.srt
    ┃ ┣ 📺Some TV Show S01E02.avi
    ┃ ┣ 📜Some TV Show S01E02.en.srt
    ┃ ┣ 📜Some TV Show S01E02.es.srt
    ┃ ┣ 📺Some TV Show S01E03.ogm
    ┃ ┣ 📜Some TV Show S01E03.en.srt
    ┃ ┣ 📜Some TV Show S01E03.es.srt
    ┃ ┣ 📺Some TV Show S01E04.mp4
    ┃ ┣ 📜Some TV Show S01E04.en.srt
    ┃ ┣ 📜Some TV Show S01E04.es.srt
    ┃ ┣ 📺Some TV Show S01E05.avi
    ┃ ┣ 📜Some TV Show S01E05.en.srt
    ┃ ┣ 📜Some TV Show S01E05.es.srt
    ┃ ┗ 🎨Some TV Show Poster.png 👈 extra non-video, non-subtitle files may exist
    ┣ 📂Season 02
    ┃ ┣ 📺Some TV Show S02E01.mkv
    ┃ ┣ 📜Some TV Show S02E01.en.srt
    ┃ ┣ 📜Some TV Show S02E01.es.srt
    ┃ ┣ 📺Some TV Show S02E02.mp4
    ┃ ┣ 📜Some TV Show S02E02.en.srt
    ┃ ┣ 📜Some TV Show S02E02.es.srt
    ┃ ┣ 📺Some TV Show S02E03.avi
    ┃ ┣ 📜Some TV Show S02E03.en.srt
    ┃ ┣ 📜Some TV Show S02E03.es.srt
    ┃ ┣ 📺Some TV Show S02E04.avi
    ┃ ┣ 📜Some TV Show S02E04.en.srt
    ┃ ┣ 📜Some TV Show S02E04.es.srt
    ┃ ┣ 📺Some TV Show S02E04 Part 2.avi
    ┃ ┣ 📜Some TV Show S02E04 Part 2.en.srt 👈 This will only merge with "Part 2", as expected
    ┃ ┗ 📜Some TV Show S02E04 Part 2.es.srt
  

**Example (e.g., overrides):**
  
    📂Movies
    ┣ 📂Resident Evil (2002)
    ┃ ┣ 📺Resident Evil (2002) [1080p].mp4
    ┃ ┣ 📜Resident Evil (2002) [1080p].sdh.srt 👈 Set hearing impaired
    ┃ ┣ 📜Resident Evil (2002) [1080p].hearing-impaired.srt 👈 Set hearing impaired (alt option)
    ┃ ┣ 📜Resident Evil (2002) [1080p].forced.srt 👈 Set forced track
    ┃ ┣ 📜Resident Evil (2002) [1080p].default.srt 👈 Set default track
    ┃ ┗ 📜Subtitles Evil (2002) [1080p].nl.srt 👈 Override language using a supported language code
    ┃ ┗ 📜Subtitles Evil (2002) [1080p].default.forced.sdh.es.srt 👈 Set multiple overrides
  

## 🪓 Removing subtitles When removing subtitles, each directory and/or subdirectory contain at least one video file will be processed, others will be skipped. Other non-video files may be included and will be ignored.

**Example (e.g., movies):**
  
    📂Movies
    ┣ 📂Resident Evil (2002)
    ┃ ┗ 📺Resident Evil (2002) [1080p].mp4
    ┣ 📂Resident Evil Afterlife (2010)
    ┃ ┣ 📺Resident Evil Afterlife (2010) [1080p].avi
    ┃ ┗ 🎨Movie poster.png 👈 extra non-video files may exist
    ┣ 📂Resident Evil Apocalypse (2004)
    ┃ ┣ 📺Resident Evil Apocalypse (2004) [1080p].mkv
    ┃ ┗ 📜Resident Evil Apocalypse (2004) [1080p].srt 👈 extra non-video files may exist
    ┣ 📂Resident Evil Extinction (2007)
    ┃ ┗ 📺Resident Evil Apocalypse (2004) [1080p].wmv
    ┣ 📂Resident Evil Retribution (2012)
    ┃ ┗ 📺Resident Evil Retribution (2012) [1080p].ogg
    ┣ 📂Resident Evil The Final Chapter (2016)
    ┃ ┗ 📺Resident Evil The Final Chapter (2016) [1080p].ogm
  

**Example (e.g., TV show):**
  
    📂Some TV Show
    ┣ 📂Season 01
    ┃ ┣ 📺Some TV Show S01E01.mp4
    ┃ ┣ 📺Some TV Show S01E02.avi
    ┃ ┣ 📺Some TV Show S01E03.ogm
    ┃ ┣ 📺Some TV Show S01E04.mp4
    ┃ ┣ 📺Some TV Show S01E05.avi
    ┃ ┗ 🎨Some TV Show Poster.png 👈 extra non-video, non-subtitle files may exist
    ┣ 📂Season 02
    ┃ ┣ 📺Some TV Show S02E01.mkv
    ┃ ┣ 📺Some TV Show S02E02.mp4
    ┃ ┣ 📺Some TV Show S02E03.avi
    ┃ ┣ 📺Some TV Show S02E04.avi
    ┃ ┗ 📺Some TV Show S02E04 Part 2.avi
  

## 🗃️ Supported files The following file types are supported. **Video**: - _AVI_, _M4V_, _MKV_, _MOV_, _MP4_, _MPG_, _MPEG_, _OGG_, _OGM_, _WEBM_, _WMV_ **Subtitle**: - _ASS_, _IDX_, _PGS_, _SMI_, _SRT_, _SSA_, _SUB_, _SUP_, _VTT_

## 🙏 Attribution - MKV batch processing is powered by [MKVToolNix](https://gitlab.com/mbunkus/mkvtoolnix) - SVG icons used are from [Font Awesome](https://fontawesome.com)

## 🐱‍👤 Develop Code documentation for this project, created with [JSDoc](https://github.com/jsdoc/jsdoc), can be found here:
[MKVToolNix Batch Tool](https://ipzard.github.io/mkvtoolnix-batch-tool)

For documentation on how this project uses Electron, React, and Python together, see:
[Electron, React & Python](https://github.com/iPzard/electron-react-python-template#readme)

## 🦟 Software bugs Bugs reported on the project's [issues page](https://github.com/iPzard/mkvtoolnix-batch-tool/issues) will be exterminated as quickly as possible, be sure to include steps to reproduce and your `error.log` file in `%APPDATA%/MKVToolNix Batch Tool/`. You can also see the developer console data by enabling debug mode on the settings page.

## 🐱‍💻 Contribute Contributions are welcomed! If you see an [open issue](https://github.com/iPzard/mkvtoolnix-batch-tool/issues) with the preserved 💾 tag (which indicates it's a desired change) you want to fix, here's how to contribute:
1. Fork the repo. 2. Create a feature branch. 3. Make your changes locally. 3. Create a pull request.

## 🏷️ License GPLv2 © [iPzard](https://github.com/iPzard/mkvtoolnix-batch-tool/blob/master/LICENSE)