FFmpeg recipe
FFmpeg: Burn Subtitles into a Video (Hard-Subs)
subtitles filter renders the SRT directly into the video pixels. The result has subtitles baked in, regardless of player settings.
Command
ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Fontsize=28,PrimaryColour=&Hffffff&,OutlineColour=&H000000&'" -c:v libx264 -crf 23 -c:a copy -y output.mp4Prefer no terminal?
Use the Subtitle Burner in your browser
What each flag does
| -i | Input file. Can be a video, audio, or image. Repeat for multiple inputs. |
|---|---|
| -vf | Video filter chain. e.g. scale=1280:720, crop=, fps=30. |
| -c:v | Video codec for output. e.g. libx264, libx265, libvpx-vp9. |
| -crf | Constant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264. |
| -c:a | Audio codec for output. e.g. aac, libmp3lame, copy. |
| subtitles=subs.srt | Path to the SRT file. Also accepts ASS/SSA for advanced styling. |
| force_style | Inline ASS-style overrides: Fontsize, PrimaryColour, OutlineColour, Bold, Italic, etc. |
Notes & gotchas
- For ASS subtitles with embedded styling, you don't need force_style — the file controls appearance.
- On Windows, escape the colon in paths: subtitles=subs.srt → subtitles=subs.srt:fontsdir=...
Check it worked
ffplay -i output.mp4Subtitles visible in the picture, which means they are burned in rather than carried as a separate track.
What to change
| force_style overrides the file | Fontsize, PrimaryColour and OutlineColour are applied on top of whatever the SRT or ASS specifies. Colours are &HBBGGRR, not RGB. |
|---|---|
| Escape the path on Windows | The subtitles filter treats colons and backslashes as syntax. A path like C:\\subs.srt needs escaping or the filter fails to parse. |
| Size it for the smallest screen | Fontsize=28 suits 1080p on a laptop. For a phone, 32-40 is the readable range. |
If it fails
No such filter: subtitles, or Unable to open subtitles file.
Why: The build lacks libass, or the path contains characters the filter parser treats specially.
Fix: Install a build with libass, and escape colons and backslashes in the path, which matters most on Windows.
Subtitles appear but the text is boxes or blank.
Why: The font in the subtitle file is missing, or the script is one the default font cannot render.
Fix: Point at a font directory with fontsdir, and set a font that covers the script with force_style.