How to Burn WebVTT Subtitles into Video with FFmpeg

This guide explains how to permanently burn WebVTT (.vtt) subtitle files into a video using the FFmpeg subtitles filter. Hardcoding subtitles—also known as burning them in—merges the subtitle text directly into the video frames, ensuring they render correctly on any media player or device without requiring external subtitle files. You will learn the basic command syntax, how to handle file path escaping, and how to customize the subtitle appearance.

The Basic Command

To burn WebVTT subtitles into a video, you use the video filter (-vf) option followed by the subtitles filter and the path to your WebVTT file.

Here is the standard command:

ffmpeg -i input.mp4 -vf "subtitles=subtitles.vtt" output.mp4

Command Breakdown:

Handling Special Characters and Windows File Paths

The FFmpeg filter engine requires special escaping for backslashes, colons, and spaces in file paths. If your subtitle file path contains these characters, you must wrap the path in single quotes and escape the colons and backslashes.

For Windows Paths:

If your subtitle file is located at C:\Folder\subtitles.vtt, format the command like this:

ffmpeg -i input.mp4 -vf "subtitles='C\:\\Folder\\subtitles.vtt'" output.mp4

Note the double backslashes (\\) and the escaped colon (\:).

For Paths with Spaces:

If your filename has spaces, wrap the path in single quotes inside the double-quoted filter string:

ffmpeg -i input.mp4 -vf "subtitles='my subtitles.vtt'" output.mp4

Customizing Subtitle Appearance

You can customize the font style, size, and colors of the burned-in subtitles using the force_style parameter. This parameter uses ASS (Advanced SubStation Alpha) style properties.

For example, to change the font size to 20, set the primary color to yellow, and add a black outline:

ffmpeg -i input.mp4 -vf "subtitles=subtitles.vtt:force_style='Fontname=Arial,Fontsize=20,PrimaryColour=&H0000FFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=2'" output.mp4

Common force_style Properties: