How to Add SRT to Video Without Encoding Using FFmpeg

This article explains how to use FFmpeg to insert localized SRT subtitle tracks into a video container like MP4 or MKV without re-encoding the video or audio streams. By utilizing stream copying, you can preserve the original video quality and complete the process in just a few seconds. Below, you will find step-by-step instructions for basic remuxing, adding language metadata for localization, handling MP4 containers, and merging multiple subtitle tracks into a single file.

The Basic Command (MKV Container)

The Matroska (MKV) container natively supports SubRip (SRT) subtitles. To merge an external SRT file with a video without re-encoding, use the -c copy flag. This tells FFmpeg to copy the video, audio, and subtitle streams directly without modifying them.

ffmpeg -i input.mp4 -i subtitle.srt -c copy output.mkv

Adding Localized Language Metadata

To ensure media players recognize the language of the subtitle track, you must assign a three-letter ISO 639-2 language code (such as eng for English, spa for Spanish, or fra for French) using metadata tags.

ffmpeg -i input.mp4 -i subtitle_es.srt -c copy -metadata:s:s:0 language=spa output.mkv

Adding Multiple Localized Subtitle Tracks

You can add multiple localized subtitle tracks to a single video container. To do this, you must explicitly map each input file to the output file using the -map option, then define the metadata for each subtitle stream.

ffmpeg -i input.mp4 -i sub_en.srt -i sub_es.srt \
-map 0 -map 1 -map 2 \
-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" \
output.mkv

Adding Subtitles to an MP4 Container

Unlike MKV, the MP4 container does not natively support raw SRT text format. To add subtitles to an MP4 container without re-encoding the video or audio, you must convert the SRT subtitle stream to the MP4-compatible Timed Text format (mov_text).

ffmpeg -i input.mp4 -i subtitle.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng output.mp4