← Back to list

Editing MKV language tags from the command line

Let’s say you have MKV files with embedded subtitle files, but the creator of the MKV file didn’t label the audio and subtitle tracks with…

applehq · 2017-07-17 18:31 · 0 claps · 0.9 min read
#programming #linux #command-line #bash #matroska
Open on Medium ↗
Wiki topics: 💻 · Programming 🔓 · Open Source 🎵 · Music & Audio 🥊 · Combat Sports

Editing MKV language tags from the command line

Let’s say you have MKV files with embedded subtitle files, but the creator of the MKV file didn’t label the audio and subtitle tracks with the languages contained within them.

Let’s also say that you have software to play back the files that can select if you need a subtitle track based on the language of the audio tracks, rather than selecting them each time.

Let’s also also say that these files live on a headless NAS box, or that there are so many of them that you don’t want to change each file manually.

You’ll need mkvpropedit from MKVToolNix.

find . -type f -print0 | xargs -0 -n1 -I{} mkvpropedit '{}' --edit track:a1 --set language=jpn --edit track:s1 --set language=eng

These are the important parts:

--edit track:a1 --set language=jpn
--edit track:s1 --set language=eng

The argument after “--edit” selects the track you want to work on. Each video, audio and subtitle track is treated separately. Select the track, and set the language to the ISO639–2 country code.


메타데이터
post_id
49e92ca60f4e
slug
editing-mkv-language-tags-from-the-command-line-49e92ca60f4e
url
https://medium.com/@applehq/editing-mkv-language-tags-from-the-command-line-49e92ca60f4e
canonical_url
https://medium.com/@applehq/editing-mkv-language-tags-from-the-command-line-49e92ca60f4e
author_url
https://medium.com/@applehq
status
ok
fetched_at
2026-08-23 11:09:23