FFmpeg Burn Subtitles with Custom Outline Color

This guide explains how to permanently burn subtitles into a video using FFmpeg while customizing their visual style. You will learn how to use the FFmpeg subtitle filter, apply the force_style parameter to modify the subtitle outline color, and understand the specific hexadecimal color format required for successful styling.

The FFmpeg Command

To burn subtitles into a video and style the outline, you use the -vf (video filter) flag with the subtitles filter. The force_style option allows you to override the default subtitle styles.

Here is the template command:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='OutlineColour=&H0000FF&,BorderStyle=1,Outline=2'" output.mp4

Command Breakdown and Styling Options

Understanding the FFmpeg Color Format

FFmpeg subtitle styling uses the ASS color format, which is written in hexadecimal but structured differently than standard HTML hex codes.

The format is &H[Alpha][Blue][Green][Red]& (ABGR):

Color Examples:

Complete Customization Example

To burn yellow text with a thick red outline and a custom font size, use the following command:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Arial,Fontsize=20,PrimaryColour=&H00FFFF&,OutlineColour=&H0000FF&,BorderStyle=1,Outline=3'" output.mp4