extract subtitle file from mkv usage: ⎗ ✓ 1mkvsub filename.mkv script: ⎗ ✓ 1 2 3 4 5 6 7function mkvsub(){ t=$(f=$(mkvinfo $1); n=$(echo "$f" | grep -n subtitle | grep -oP "\d+"); echo "$f" | head -n $(($n - 2)) | tail -n 1 | grep -oP "\d+" | tail -n 1) mkvextract tracks $1 $t:sub.srt # strip sdh subtitle lines cat sub.srt | perl -pe "s/,,\[.+/,,/" >> sub2.srt }
Warning LINK You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue? Continue Cancel