Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use subtitles from an external file while converting a video with FFmpeg? The file extension of the subtitles is .stl or .vob.

share|improve this question

migrated from Nov 27 '09 at 16:37

This question came from our site for professional and enthusiast programmers.


ffmpeg -i input1.mp4 -i -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mkv

This will take subtitles in from the srt, and every stream from the MP4. It should work with most subtitle formats. This particular command line will copy all audio and subtitle streams, while converting the video to x264 at reasonable quality settings.

ffmpeg can also automatically choose a matching subtitle format for the output, e.g. it will convert the .srt subtitles to ASS for the following command:

ffmpeg -i input1.mp4 -i -map 0 -map 1 -c:a copy -c:v libx264 -crf 23 -preset veryfast output.mkv

As of version 1.2, it will decode the following subtitle formats:

  • HDMV Presentation Graphic Stream subtitles
  • JACOsub subtitle
  • MicroDVD subtitle
  • MPL2 subtitle
  • PJS (Phoenix Japanimation Society) subtitle
  • RealText subtitle
  • SAMI subtitle
  • SubViewer subtitle
  • SubViewer v1 subtitle
  • raw UTF-8 text
  • VPlayer subtitle
  • WebVTT subtitle
  • DVB subtitles
  • DVD subtitles
  • MOV text
  • SubRip subtitle with embedded timing
  • SSA (SubStation Alpha) / ASS (Advanced SSA) subtitle
  • SubRip subtitle
  • XSUB
share|improve this answer
I got mixed results with the auto-conversion, but trying to copy subtitles with MKV (which supports virtually anything) should work fine. – slhck Apr 19 '13 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .