Extract stuff from .mkv with ffmpeg
Full documentation: https://ffmpeg.org/ffmpeg.html
ffmpeg -i file.mkv
v - video
a - audio
s - subtitles
t - attachments
d - data
m - metadata
syntax
ffmpeg -i file.mkv -map 0:type -map 0:type -c copy newfile.mkv
ffmpeg -i file.mkv -map 0:type:index -map 0:type:index -c copy newfile.mkv
example
ffmpeg -i file.mkv -map 0:v -map 0:a:1 -map 0:s:1 -c copy newfile.mkv
syntax
ffmpeg -i file.mkv -map 0 -map -0:type:index -c newfile.mkv
example
ffmpeg -i file.mkv -map 0 -map -0:a:0 -map -0:s:0 -c newfile.mkv
syntax
ffmpeg -i file.mkv -map 0:m:key:value -c:s copy|format file.srt
examples
ffmpeg -i file.mkv -map 0:m:language:eng -c:s copy file.srt
ffmpeg -i file.mkv -map 0:m:title:SDH -c:s copy file.srt
ffmpeg -i file.mkv -map 0:m:key:value -c:s srt file.srt
extract subtitles
for i in *.mkv; do ffmpeg -i "$i" -map 0:m:key:value -c:s copy "${i%.*}.srt"; done
pick tracks
for i in *.mkv; do ffmpeg -i "$i" -map 0:v -map 0:a:0 -map 0:s:0 -c copy "_${i}"; done
omit tracks
for i in *.mkv; do ffmpeg -i "$i" -map 0 -map -0:a:0 -c copy "_${i}"; done
ffmpeg -v 24 -stats ...