Last active
January 5, 2017 17:49
-
-
Save Dreyer/24335128294f10a1d23ce64960a25abf to your computer and use it in GitHub Desktop.
Batch edit the properties of Matroska files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Iterate through every .MKV file in the current directory and use the | |
# filename base as the title while assigning the second subtitle track | |
# as the default and the second audio track as the default. | |
# | |
# Requires mkvpropedit from MKVToolNix: | |
# https://github.com/mbunkus/mkvtoolnix | |
# | |
for file in *.mkv; do base=${file%.*}; mkvpropedit "${file}" --edit info --set "title=${base}" --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1 --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment