Add simple ffmpeg subtitle extract (no ocr)

2026-02-21 17:05:38 -03:00
parent 337a81d8b9
commit 9a14fe98d7

@@ -0,0 +1,15 @@
```
EXT=mkv;
for F in *${EXT}; do
while read L FI SI LN SF; do
[[ -z $LN ]] && continue;
L=$(( L - 1 ));
FN=${F%.$EXT}.$LN.srt;
ffmpeg -i "$F" -map $FI:s:$L -c:s srt tmp.srt;
sed -e 's/<[^>]*>//g' -e 's/{[^}]*}//g' tmp.srt > "$FN";
rm tmp.srt;
read FI SI LN SF <<< '';
done < <(ffprobe "$F" 2>&1 | sed -nr '/Subtitle:/s/^.*Stream #([0-9]):([0-9])\(([a-z-]+)\).*Subtitle: ([a-z]+) .*$/\1 \2 \3 \4/p' | cat -n);
done;
```