There are two jobs people call "adding text": graphic text baked onto the frame (titles, watermarks, lower-thirds) via drawtext, and subtitles from an .srt/.ass file that can be burned in or kept as a toggleable track. This guide covers both.
Key takeaways
drawtextrenders custom on-screen text with full font and position control.- Time text with
enable='between(t,start,end)'. - Burn subtitles with the
subtitlesfilter (permanent, universal). - Attach soft subtitles with
-c:s mov_textso viewers can toggle them.
A simple title with drawtext
Draw centered white text with a semi-transparent box behind it:
ffmpeg -i in.mp4 -vf "drawtext=\ text='FFmpegLab':fontcolor=white:fontsize=64:\ box=1:[email protected]:boxborderw=12:\ x=(w-text_w)/2:y=h-160" -c:a copy out.mp4
Point fontfile=/path/to/Font.ttf at a specific typeface if the default isn't what you want.
Make text appear only for a few seconds
The enable expression toggles the overlay on a time window — perfect for a lower-third that shows from 2s to 7s:
drawtext=text='Jane Doe — Director': fontcolor=white:fontsize=40: x=80:y=h-140: enable='between(t,2,7)'
Burn in subtitles from an SRT file
Burning ("hardcoding") makes subtitles permanent and guaranteed to display anywhere:
ffmpeg -i in.mp4 -vf "subtitles=captions.srt" -c:a copy out.mp4
Style them with an ASS file or inline force_style: subtitles=captions.srt:force_style='Fontsize=24,PrimaryColour=&Hffffff&'.
Attach soft (toggleable) subtitles
Soft subtitles ride along as a track viewers can turn on/off — no re-encode of the video:
ffmpeg -i in.mp4 -i captions.srt \ -c copy -c:s mov_text \ -metadata:s:s:0 language=eng out.mp4
Combine with other effects
Because drawtext is just another filter, it chains inside a filter_complex graph alongside scaling, overlays, and color grading — one render, many effects.
Caption visually, export anywhere
FFmpegLab lets you place titles and captions on a timeline and writes the matching drawtext/subtitles command for you. It runs offline and private, so transcripts and footage stay on your machine. Then compress and convert for delivery.