Last active
May 4, 2019 17:02
-
-
Save jfeilbach/a9909a8fc62a3376ff58dc683d561987 to your computer and use it in GitHub Desktop.
strip all non english audio tracks and all subtitles from mkv
This file contains hidden or 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 | |
| # keep only audio track 1 | |
| # keep no subtitle tracks | |
| # or use -map 0:m:language:eng | |
| LOGLEVEL='warn' | |
| OPTS='-hide_banner -loglevel ${LOGLEVEL}' | |
| for x in *.mkv ; do | |
| echo ${x} | |
| ffmpeg ${OPTS} -i "${x}" -map 0:v -map 0:a:0 -map -0:s -c copy "new-${x}" | |
| # ffmpeg -hide_banner -loglevel info -i "${x}" -map 0:v -map 0:m:language:eng -map -0:s -c copy "new-${x}" | |
| done | |
| rm -fv !(new-*.mkv) | |
| for n in new-*.mmkv ; do | |
| mv -v "$n" "$(echo "$n" | sed s/new-//)" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment