Extract subtitles from a video
subtitles
// what it does
Extracts an embedded subtitle stream to a standalone file. The -map 0:s:0 selector picks the first subtitle stream (s:0) from the first input, and ffmpeg infers SRT output from the .srt extension, converting the internal format (e.g. mov_text) to SRT text. Use it to pull captions out of an MKV/MP4 for editing or reuse.
// shell
$ ffmpeg -i input.mp4 -map 0:s:0 subtitles.srt// gotcha
This only works for text-based subtitle streams. If the embedded track is bitmap-based (VobSub/PGS), the write fails with "Subtitle encoding currently only possible from text to text or bitmap to bitmap" because there's no built-in OCR.