How to hardcode subtitle into a video with FFmpeg?
ID: how-to-hardcode-subtitle-into-a-video-with-ffmpeg
How to hardcode subtitle into a video with FFmpeg? by Ciro Santilli 35 Updated 2025-01-29 +Created 1970-01-01
On Ubuntu 20.10, just:
ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt" output.mp4
To change font size: stackoverflow.com/questions/21363334/how-to-add-font-size-in-subtitles-in-ffmpeg-video-filterThe default appears to be 24, so just multiply that by whatever seems like a reasonable factor.
ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt:force_style='Fontsize=64'" output.mp4
Note howver that .ass subtitle files can contain style information, which ffmpeg respects. Aegisub can produce and preview such styles, making .ass one of the best options.
New to topics? Read the docs here!