Embed SRT Subtitles in MP4 as tx3g Using FFmpeg

This guide explains how to embed SubRip (SRT) subtitles into an MP4 video container as Apple-compatible timed text (tx3g) using the FFmpeg command-line tool. You will learn the exact command syntax to convert and mux subtitle streams, assign language metadata, and handle multiple subtitle tracks quickly without re-encoding your original video and audio files.

The Basic Command

To embed a single SRT subtitle file into an MP4 container as timed text (which FFmpeg refers to as mov_text), use the following command:

ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s mov_text output.mp4

Command Breakdown

Adding Language Metadata

To ensure media players correctly identify the language of your subtitle track, you should add a language metadata tag. Use the -metadata:s:s:0 option followed by the 3-letter ISO 639-2 language code (e.g., eng for English, spa for Spanish, fra for French):

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

Embedding Multiple Subtitle Tracks

If you need to embed multiple subtitle files for different languages into a single MP4 container, you must map the inputs and define the metadata for each stream:

ffmpeg -i input.mp4 -i english.srt -i spanish.srt \
-map 0 -map 1 -map 2 \
-c copy -c:s mov_text \
-metadata:s:s:0 language=eng \
-metadata:s:s:1 language=spa \
output.mp4