Add Multiple SRT Subtitles to MKV with FFmpeg

This article provides a quick guide on how to use FFmpeg to multiplex multiple SubRip (SRT) subtitle files into a single Matroska (MKV) video container. You will learn the exact command-line syntax required to map multiple input files, assign 3-letter ISO language codes (such as English, Spanish, or French) to each subtitle track, and save the output without re-encoding the original video or audio streams.

The FFmpeg Command

To merge a video file and multiple SRT files into one MKV file, use the following command structure:

ffmpeg -i input.mp4 -i english.srt -i spanish.srt -i french.srt \
-map 0:v -map 0:a -map 1 -map 2 -map 3 \
-c copy \
-metadata:s:s:0 language=eng -metadata:s:s:0 title="English" \
-metadata:s:s:1 language=spa -metadata:s:s:1 title="Español" \
-metadata:s:s:2 language=fre -metadata:s:s:2 title="Français" \
output.mkv

Command Breakdown

Setting a Default Subtitle Track (Optional)

By default, media players may play the first subtitle track automatically or none at all. You can explicitly define which subtitle track is enabled by default using disposition flags.

For example, to make the English track (s:s:0) the default and disable auto-play for the others, add these flags to your command:

-disposition:s:s:0 default -disposition:s:s:1 0 -disposition:s:s:2 0