Every command I reach for when a video needs subtitles: burn them in, add a track viewers can turn off, convert, shift and pull them out.
Burn subtitles into the picture
For TikTok, Reels and Shorts, which don't use uploaded subtitle files:
ffmpeg -i video.mp4 -vf "subtitles=subs.srt" -c:a copy out.mp4
Change the look while burning (font, size, outline, distance from the bottom):
ffmpeg -i video.mp4 -vf "subtitles=subs.srt:force_style='FontName=Montserrat,FontSize=22,Outline=2,MarginV=60'" -c:a copy out.mp4
An ASS file keeps its own styles and karaoke timing, so use the ass filter:
ffmpeg -i video.mp4 -vf "ass=subs.ass" -c:a copy out.mp4
On Windows, a path with a drive letter needs the colon escaped inside the filter: subtitles='C\:/clips/subs.srt'.
Add a subtitle track viewers can switch off
MP4 takes the mov_text codec, MKV takes SRT as it is:
ffmpeg -i video.mp4 -i subs.srt -c copy -c:s mov_text -metadata:s:s:0 language=eng out.mp4
ffmpeg -i video.mp4 -i subs.srt -c copy -c:s srt out.mkv
Convert, shift and extract
ffmpeg -i subs.vtt subs.srt # VTT to SRT
ffmpeg -itsoffset 1.5 -i subs.srt shifted.srt # every subtitle 1.5 s later (a negative number moves them earlier)
ffmpeg -i movie.mkv -map 0:s:0 subs.srt # the first subtitle track out of a video
Without a terminal
The same jobs run in the browser, with nothing uploaded: SRT to VTT, VTT to SRT, shift subtitles and clean up a broken SRT.
For animated word-by-word captions, where each word lights up as it's spoken, Cuecaps transcribes the video on your own computer and exports the MP4, a transparent overlay or an ASS file with word timing for the ass filter above.
Top comments (0)