How to extract subtitle from video using ffmpeg


I am trying to extract subtitle from video as .srt file, I used the following command:

FFMPEG -i mytestmovie.mkv -vn -an -codec:s:0.1 srt

But, I got an error as Unrecognized option codec:s:0:1
So, can you tell me the exact command and how to extract a subtitle as .srt file in video?

Best Answer


ffmpeg -i Movie.mkv -map 0:s:0
  • -i: Input file URL/path.
  • -map: Designate one or more input streams as a source for the output file.
  • s:0: Select the subtitle stream.