Skip to content

A command-line utility for extracting attachments (subtitles, fonts and chapters) of MKV files.

License

Notifications You must be signed in to change notification settings

ToshY/mkvexport

Repository files navigation

📺 MKVexport

Current bundle version Black Ruff Mypy Security check

📝 Quickstart

A command-line utility for extracting attachments (subtitles, fonts and chapters) of MKV files.

🧰 Requirements

🎬 Usage

MKVexport requires 1 volume to be mounted: /app/input.

🐋 Docker

docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v ${PWD}/input:/app/input \
  ghcr.io/toshy/mkvexport:latest -h

🐳 Compose

Create a compose.yaml file.

services:
  mkvexport:
    image: ghcr.io/toshy/mkvexport:latest
    volumes:
      - ./input:/input

Then run it.

docker compose run -u $(id -u):$(id -g) --rm mkvexport -h

📚 Examples

Extracted file attachments will always be put into a newly created directory based on the filename of the input file.

|-- never-gonna-give-you-up.mkv
|-- never-gonna-give-you-up
    |-- attachments
        |-- Arial.ttf
        |-- ...
        |-- COMIC.TTF  
    |-- chapters.xml
    |-- tags.xml
    |-- track4_eng.ass
    |-- ...
    |-- track8_jpn.ass

In the above example, our file never-gonna-give-you-up.mkv, will yield a directory named never-gonna-give-you-up. This directory will contain a chapters file chapters.xml, a tags file tags.xml, subtitles (which are named in the format track{id}_{iso639-3}.{extension}) and a subdirectory attachments containing the fonts.

Arguments

Default

When no arguments are provided, MKVexport will automatically export attachments for all files mounted to the /app/input directory.

Subdirectory

Let's say you have some files in a subdirectory called latest-hits (./rick-astley/latest-hits) and you want to extract attachments for just those files.

docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v ${PWD}/rick-astley:/app/input \
  ghcr.io/toshy/mkvexport:latest \
  -i "latest-hits"

File

Let's say you have a file called never-gonna-give-you-up.mkv (./rick-astley/never-gonna-give-you-up.mkv) and you want to extract attachments for just that file

docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v ${PWD}/rick-astley:/app/input \
  ghcr.io/toshy/mkvexport:latest \
  -i "never-gonna-give-you-up.mkv"

🛠️ Contribute

Requirements

Pre-commit

Setting up pre-commit code style & quality checks for local development.

pre-commit install

❕ License

This repository comes with a MIT license.