Changing subtitle format with ffmpeg

8,576

Solution 1

FFmpeg has a SubRip encoder, so

ffmpeg -i input.mkv -c copy -c:s srt out.mkv

Solution 2

Assuming 'z' is a supported format, something as simple as this should work:

ffmpeg -i input.z output.srt

List your codecs with ffmpeg -codecs to make sure your 'z' type is supported.

Solution 3

You can try to convert the subtitles using a simple tool called Avidemux. I've used it before and it works fine. Find more about it here.

Share:
8,576

Related videos on Youtube

user2765654
Author by

user2765654

Updated on September 18, 2022

Comments

  • user2765654
    user2765654 almost 2 years

    How can I change the subtitle format of a movie to .srt for example?

    I have any movie (sound, video and an embedded subtitle). I just want to change the subtitles to .srt while leaving everything else the same. If there is a better way to do that than with ffmpeg, then I'd be fine with that too.

    Current state

    audio codec: x, video codec: y, subtitle format: z

    Desired state

    audio codec: x, video codec: y, subtitle format: .srt

  • user2765654
    user2765654 almost 8 years
    Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height. Any idea why this is happening?
  • Gyan
    Gyan almost 8 years
    Share the full console output.
  • user2765654
    user2765654 almost 8 years
    Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Stream #0:3 -> #0:2 (dvd_subtitle (dvdsub) -> subrip (srt)) Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height
  • Gyan
    Gyan almost 8 years
    See here.
  • ccpizza
    ccpizza almost 3 years
    Full list of subtitle formats supported by ffmpeg: ffmpeg.org/ffmpeg-all.html#Subtitle-Formats