Skip to content

Instantly share code, notes, and snippets.

@tonioriol
Created June 30, 2021 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonioriol/82fa621d6200ce7bb716013e47d1392b to your computer and use it in GitHub Desktop.
Save tonioriol/82fa621d6200ce7bb716013e47d1392b to your computer and use it in GitHub Desktop.
Convert avi to mkv and set audio lang tags with MKVToolNix
# convert avi to mkv and set audio lang tags
# brew install mkvtoolnix
# loop all avi files in current folder
for file in *.avi; do
# replace original avi ext by mkv ext
mkv="${file%.*}.mkv"
# convert avi to mkv
mkvmerge -o "${mkv}" "${file}"
# edit converted mkv and set audio channel 1 to "es", 2 to "ca" and 3 to "en"
mkvpropedit "${mkv}" --edit track:a1 --set language=es --edit track:a2 --set language=ca --edit track:a3 --set language=en
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment