Skip to content

Instantly share code, notes, and snippets.

@andrearota
Created September 22, 2016 22:11
Show Gist options
  • Save andrearota/82873d2d6e5ae21a03fd79fc7ebaf170 to your computer and use it in GitHub Desktop.
Save andrearota/82873d2d6e5ae21a03fd79fc7ebaf170 to your computer and use it in GitHub Desktop.
How to extract srt subtitles from an mkv file
# Find all the .mkv file in the current folder and for each one extract the srt with ffmpeg
# We assume that the srt is the stream 0:2, change it according to your file
find . -name "*.mkv" -exec ffmpeg -i {} -map 0:2 {}.srt \;
# Now rename the .mkv.srt to .srt, in order to have them automatically loaded by VLC and other players
for j in *.mkv.srt; do mv -v -- "$j" "${j%.mkv.srt}.srt"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment