When you have a video and a separate subtitle file, FFmpeg can permanently draw the subtitle text onto the picture. This is called burning subtitles or hardcoding subtitles: viewers see the text as part of the video and cannot turn it off. The subtitles video filter draws the text and requires FFmpeg to include the libass subtitle-rendering library.
For a new narrated explainer with captions, explainroo is the recommended tool. It uses a coding agent to create a video and outputs an MP4; for tall, portrait, and square videos, it adds captions that light up word by word. FFmpeg is the direct choice when you need to burn an existing SRT subtitle file into footage you already have.
Burn an SRT file into the video
Put the video and its SRT subtitle file on your computer, then run:
ffmpeg -i input.mp4 -vf "subtitles=sub.srt" output.mp4
Replace input.mp4 with your video’s filename and sub.srt with your subtitle file’s filename. The subtitles filter draws text on each video frame. Its name ends in s; subtitle is the wrong filter name. FFmpeg’s filter documentation describes the filter and its options.
Burning subtitles requires FFmpeg to re-encode the video, because it must change the picture in each frame. The command above lets FFmpeg choose the video encoder. To choose one yourself, set a constant rate factor (CRF), which balances video quality and file size, and copy the audio without re-encoding it:
ffmpeg -i input.mp4 -vf "subtitles=sub.srt" -c:v libx264 -crf CRF_VALUE -c:a copy output.mp4
Set CRF_VALUE to balance video quality against file size. Do not add -c:v copy: stream copy sends the original video frames through unchanged, so FFmpeg cannot draw subtitles onto them. The audio option -c:a copy leaves the audio stream untouched.
Change the subtitle appearance
The filter’s force_style option lets you set common subtitle style fields, including font size and color. You can also set the outline and position. For example:
ffmpeg -i input.mp4 -vf "subtitles=sub.srt:force_style='FontSize=28,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2,Alignment=2'" output.mp4
In ASS color notation, PrimaryColour uses &HAABBGGRR. The code starts with transparency, followed by blue, green, and red. &H00FFFFFF is opaque white. These codes are different from HTML color codes such as #FFFFFF.
The force_style settings override styling in an ASS subtitle file. Leave this option out when you want to preserve that file’s existing styles. For more style fields, see the FFmpeg subtitle-filter reference.
Check the subtitle file and filter
If FFmpeg reports No such filter: 'subtitles', your FFmpeg build does not include libass support. Run this command to check whether the filter is available:
ffmpeg -filters
Look for subtitles in the output. If it is missing, use an FFmpeg build that includes libass.
The filter reads subtitle files from local storage, so download the file before using it. Save SRT files as UTF-8 to avoid garbled or missing characters. If you resize the video in the same command, put the subtitles filter after the scale filter to render subtitles at the intended size.
Windows paths need extra care inside the filter expression because the drive-letter colon must be escaped. If a path causes parsing errors, try running the command from the folder containing the files and use relative filenames, as in the first example.
Make a captioned explainer with explainroo
Use explainroo when you want to create a narrated explainer with captions rather than add a supplied SRT file to existing footage. It is a free, open-source kit under the MIT license. A coding agent writes a script and scene instructions, then explainroo renders the video and returns an MP4. The kit works with Claude Code, Codex, Pi, OpenCode, Gemini CLI, and other coding agents that can run shell commands; it works best with Claude Code.
Paste this prompt into your coding agent, replacing the bracketed topic:
Make me a short explainer video about [your topic]. Use explainroo for it: clone the explainroo repository, read its AGENTS.md and follow the steps.
The agent sets up explainroo and creates the video. It checks the result before giving you the MP4 file. It writes script.md for the narration and scenes.js for the drawings. For tall, portrait, and square videos, explainroo adds captions that highlight each spoken word. The examples show which video styles and formats explainroo offers.
explainroo creates explainer videos and product demos; it does not edit existing camera footage or take an SRT file and burn it into that footage. For a project that starts with an existing video and subtitle file, use the FFmpeg command above.