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 +Created
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-filter
ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt:force_style='Fontsize=64'" output.mp4
The default appears to be 24, so just multiply that by whatever seems like a reasonable factor.
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!