Video EditingAdvanced

How to Burn an SRT into a Video with FFmpeg

Use FFmpeg to hardcode a subtitle file into a video from the command line, with styling control.

9 minAdvanced

Once you have a corrected SRT from Submagic or VEED, you do not always need to re-render inside those tools. FFmpeg can burn the subtitles into any video from the command line, which is ideal for automation and precise control. This guide covers the real commands.

  • FFmpeg installed (verify with ffmpeg -version)
  • A video file and a matching .srt in the same folder
  • Comfort with a terminal

Step 1: Confirm FFmpeg is installed

Check the version first. On macOS you can install it with Homebrew if it is missing.

zsh - ffmpeg
$ffmpeg -version
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
If not found, install it:
$brew install ffmpeg
$

Step 2: Burn the SRT with one command

The subtitles filter draws the SRT onto each frame. This re-encodes the video, so it permanently bakes the captions in. The audio is copied through untouched.

burn-basic.sh
ffmpeg -i input.mp4 -vf "subtitles=captions.srt" -c:a copy output.mp4

Step 3: Control the look with force_style

You can override font, size, color, outline, and position using force_style, which takes ASS style keys. Colors are in &HBBGGRR hex order, which is reversed from normal RGB, so white is &HFFFFFF and yellow is &H00FFFF.

burn-styled.sh
ffmpeg -i input.mp4 -vf "subtitles=captions.srt:force_style='FontName=Arial,Fontsize=24,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2,Alignment=2,MarginV=60'" -c:a copy output.mp4
Terminal - Encoding Progress
frame= 1480 fps= 92 q=24.0 size= 10240kB time=00:00:49.33
bitrate=1700.2kbits/s speed=3.06x
video:9800kB audio:430kB muxing overhead 0.1%
done.
FFmpeg reports frame count and speed while it renders.
BGR color order
force_style colors are &HAABBGGRR, not RGB. If your red comes out blue, you have the byte order reversed. PrimaryColour=&H000000FF is red, not blue.

Step 4: Keep a soft subtitle track instead

If you want toggleable captions inside an MP4 rather than burned-in pixels, mux the SRT as a soft track with mov_text. Players that support it can switch captions on and off.

soft-subs.sh
ffmpeg -i input.mp4 -i captions.srt -c copy -c:s mov_text -metadata:s:s:0 language=eng output.mp4

Step 5: Batch a whole folder

For many clips, loop over files that share a base name with their SRT. This is where the command line beats clicking through a GUI.

batch-burn.sh
for f in *.mp4; do
  base="${f%.mp4}"
  if [ -f "${base}.srt" ]; then
    ffmpeg -i "$f" -vf "subtitles=${base}.srt" -c:a copy "out_${base}.mp4"
  fi
done

Result: a folder of clips with matching SRTs is burned with consistent styling in a single scripted run, no editor required.

Watch related tutorials

Tags
#ffmpeg#srt#captions#command-line