How to Use FFmpeg force_style to Override SRT Subtitles

This article explains how to use the force_style parameter within FFmpeg’s subtitles filter to customize and override the appearance of SRT subtitle files. You will learn the exact command-line syntax and key style properties required to change subtitle fonts, colors, sizes, borders, and positions when burning subtitles directly into your video.

Understanding the force_style Parameter

When burning SubRip (.srt) subtitles into a video using FFmpeg, the subtitles are converted internally to the Advanced SubStation Alpha (ASS) format. Because SRT files do not natively support rich styling, you must use the force_style option in FFmpeg’s subtitles filter to inject ASS styling rules.

The basic syntax for the command is:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Key=Value,Key=Value'" output.mp4

Common Style Properties

The force_style parameter accepts various ASS style properties. Here are the most commonly used options:

Understanding the ABGR Color Format

Unlike standard HTML hex colors (RGB), ASS styles use ABGR (Alpha, Blue, Green, Red) format preceded by &H and followed by &.

Practical Examples

Example 1: Yellow Text with Black Outline

To burn subtitles using Arial font, size 16, yellow text, and a distinct black outline, use the following command:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Arial,Fontsize=16,PrimaryColour=&H0000FFFF&,OutlineColour=&H00000000&,Outline=2'" output.mp4

Example 2: Text inside a Semi-Transparent Black Box

To make text highly readable by placing it inside a translucent black bounding box (commonly used in captions), set BorderStyle=3 and define a custom BackColour:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Helvetica,Fontsize=18,PrimaryColour=&H00FFFFFF&,BackColour=&H80000000&,BorderStyle=3'" output.mp4

Example 3: Adjusting Position and Margins

If you want to raise the bottom-centered subtitles higher up on the screen to avoid overlapping other elements, increase the MarginV value:

ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Arial,Fontsize=14,Alignment=2,MarginV=50'" output.mp4

Troubleshooting Platform-Specific Escaping

Depending on your operating system’s command-line interface, you may need to escape the quotation marks differently: