Last active
April 29, 2022 07:07
-
-
Save alimbada/98505cfdd8a55f1e05ce066f82f37265 to your computer and use it in GitHub Desktop.
Use mkvextract to extract subtitles from a directory of MKV files into SRT 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
# Subtitle track number is usually the same for a whole series and usually for all encodes from a specific place | |
# Use this first to ascertain the track number | |
# find . -iname '*.mkv' -maxdepth 1 -exec sh -c "ffprobe -hide_banner -i '{}' 2>&1 | grep Subtitle | cut -d':' -f2 | cut -d'(' -f1 " \; | |
find . -iname '*.mkv' -maxdepth 1 -exec basename {} .mkv \; | xargs -I {} mkvextract tracks '{}.mkv' ${SUBTITLE_TRACK_NUMBER}:'{}.srt' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment