How to disable subtitles decoding in ffmpeg

I’ve finally found an answer.

There is such option as -sn which disables subtitles decoding from input stream. Also there are analogous options for audio and video decoding: -an and -vn respectively.

It also turned out that there is another way to achieve this. One may use the -map option to select which streams are to be decoded. So omitting the subtitles stream among the -map options does the job.

For example, if one has a movie file with 3 streams:

  • Stream 0: video
  • Stream 1: audio
  • Stream 2: subtitles

the converting command for FFmpeg may look as follows:

ffmpeg -i <input file> -sn -vcodec <video codec> -acodec <audio codec>  <output file>

or

ffmpeg -i <input file> -vcodec <video codec> -acodec <audio codec> -map 0:0 -map 0:1  <output file>

The former command line deselects the subtitles stream (probably all of them, if there are several) while the latter one selects only the necessary streams to decode.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)