Search code examples
ffmpegsubtitle

How to force & by default subtitles FFmpeg


Using code : ffmpeg -i input.mp4 -i input.sub.Eng.srt -i input.sub.bn.srt -map 0 -map 1 -map 2 -c copy -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=ben -disposition:s:0 -outpur.mp4


Solution

  • Since the disposition flag has been added to FFmpeg, using the example you provided, you could set the subtitle track to display by default as follows:

    ffmpeg -i input.mp4 -i input1.srt -i input2.srt -c copy -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=ben -disposition:s:1 default output-with-two-sub.mp4
    

    You should use -disposition:s:[1,2,3] default, but You don't need to use -disposition:s:0 for the first subtitle. The format is -disposition[:stream_specifier] value.

    If you need to remove a previously set disposition from a stream (for example, a stream is set to default, but you want to disable this), use the value 0.

    You can see the list of available disposition options and additional examples in the ffmpeg documentation by searching for "disposition".