wiki:

ExtractSubtitles


Version 1 (modified by rogerdpack, 3 years ago) (diff)

happy birthday, though this deserved its own page

FFmpeg can "read" or "extract" subtitles from embedded subtitle tracks.

For instance, if you run ffmpeg -i <my_file> and you see something like:

    Stream #0:2: Subtitle: ssa (default)

or

    Stream #0:2[0x909](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250

You can extract or convert those subtitles. To convert to srt from dvb_teletext.

ffmpeg -txt_format text -i input_file out.srt

Your FFmpeg needs to be configured with --enable-libzvbi for this to work, and results in something like this:

  Stream #0:17 -> #3:0 (dvb_teletext (libzvbi_teletextdec) -> subrip (srt))

libzvbi_teletextdec can output in two formats, either "an image" output or "text" output. Default is image. Text output must be selected in order for it to be converted to other text formats, like, in this instance, srt.