Unable to Change Subtitle Font Size in FFmpeg

Abstract: Burn subtitles into video with a custom font size using FFmpeg's subtitles filter and fontsize option.

Created: 2026-08-05 by

You can change the subtitle font size in FFmpeg by using the subtitles filter with the fontsize option. This method allows you to adjust the text scale directly during video encoding, ensuring subtitles are readable without modifying the original subtitle file. The process involves specifying the input file, applying the filter chain, and defining the desired pixel size for the text.

Understanding the Subtitles Filter

FFmpeg provides a powerful set of filters for manipulating video and audio streams. When dealing with subtitles, the subtitles filter is the primary tool for rendering external subtitle files onto the video stream. This filter supports various options that control how the subtitles appear, including their position, color, and importantly, their size. The basic syntax for using this filter involves adding it to your command line arguments. It is crucial to understand that this filter does not edit the subtitle file itself; instead, it burns the subtitles into the video frames during the encoding process. This means the output file will have hardcoded subtitles that cannot be turned off or modified by the player. If you need to keep subtitles separate, you should mux them as a stream rather than filtering them. However, for cases where you require specific visual adjustments like font size changes, hardcoding via the filter is the correct approach. For more information on handling multiple subtitle tracks, see How to Add Multiple Audio and Subtitle Tracks to Video. This resource explains how to manage different subtitle streams before they are processed by filters.

Constructing the Command Line

To modify the font size, you must include the -vf (video filter) or -filter_complex argument in your FFmpeg command. The structure of the filter string typically looks like this: subtitles=input.srt:fontsize=24. Here, input.srt is the path to your subtitle file, and fontsize=24 sets the height of the characters in pixels. You can also specify other properties within the same filter string to achieve the desired look. For instance, you might want to adjust the font family or the box background color if the default rendering causes readability issues. The complete command would look something like this:
ffmpeg -i input.mp4 -vf "subtitles=input.srt:fontsize=30" output.mp4
In this example, the font size is set to 30 pixels. You can increase or decrease this value depending on the resolution of your video and your personal preference. Higher resolutions may require larger font sizes to maintain legibility. It is advisable to test different values to find the sweet spot for your specific use case. If you are working with complex subtitle formats or languages that display incorrectly, such as Arabic, refer to Fix Arabic Words Showing Square Boxes and Burnt Subtitles with FFmpeg. This guide addresses common rendering errors that can occur when burning subtitles, which might affect how the font size appears.

Advanced Options and Customization

Beyond just changing the size, the subtitles filter offers several other parameters. You can define the font name using the font option, although FFmpeg relies on system-installed fonts. If the specified font is not available, FFmpeg will fall back to a default font, which may vary between operating systems. On Linux, this is often a generic sans-serif font. You can also control the margin around the subtitles using the marginv and marginh options. These settings ensure that the text does not touch the edges of the video frame, improving aesthetics. Additionally, the force_style option allows for deeper customization, including boldness, italic style, and outline thickness. Here is an example of a more complex filter string:
ffmpeg -i input.mp4 -vf "subtitles=input.srt:fontsize=25:font=Arial:marginv=10:marginh=10" output.mp4
This command sets the font to Arial, increases the size to 25 pixels, and adds 10 pixels of vertical and horizontal margin. Adjust these values based on your video's aspect ratio and content. For videos with dense action, smaller margins might be preferred to avoid obscuring important details.

Troubleshooting Common Issues

Sometimes, the subtitles may not render correctly, or the font size may appear inconsistent. One common issue is that the subtitle file uses a different encoding than expected. Ensure that your subtitle file is encoded in UTF-8 to support special characters and diverse languages. If the subtitles appear garbled, convert the file using a tool like iconv before processing it with FFmpeg. Another issue arises when the video codec does not support the quality required for clear text rendering. Using a high-quality video codec like H.264 or H.265 helps maintain the sharpness of the burned-in subtitles. Avoid lossy codecs with low bitrates if clarity is a priority. For preventing data loss during video repair operations, check How to Prevent Lost Embedded Subtitles when Repairing Video with FFmpeg. While this focuses on embedded subs, the principles of preserving data integrity apply to all subtitle handling tasks.

Verifying the Output

After running the command, always verify the output file. Play the video and check if the subtitles are visible and correctly sized. Use media players that allow you to inspect stream information to confirm that the subtitles are indeed hardcoded. If the subtitles are missing, double-check the path to the subtitle file and ensure it is accessible from the directory where you ran the FFmpeg command. Testing with a short clip first can save time and resources. Create a small segment of your video and apply the filter to it. This allows you to quickly iterate on the font size and other settings without waiting for a full-length video to encode. Once satisfied with the result, apply the same parameters to the entire video.

Frequently Asked Questions

Can I change the font size for only certain parts of the video?

No, the subtitles filter applies globally to the entire duration of the subtitle track. To change sizes for specific segments, you would need to split the video, apply different filters, and then concatenate the results. This workflow is more complex but allows for granular control over subtitle appearance.

Does changing the font size affect the video bitrate?

Burning subtitles into the video increases the complexity of the video frames, which can slightly increase the bitrate requirement for a given quality level. However, the impact is usually minimal unless you are using very large fonts or high-contrast colors. Monitor your output file size to ensure it meets your storage constraints.

What if my subtitle file is in a format other than SRT?

FFmpeg supports many subtitle formats, including ASS, SSA, and VTT. You can specify the input file with its appropriate extension, and FFmpeg will attempt to parse it automatically. If you encounter issues, consider converting the subtitle file to SRT format using a dedicated converter tool before processing.

Why do my subtitles look blurry after changing the size?

Blurry subtitles often result from scaling artifacts or low-quality source files. Ensure that your input video is high resolution and that you are using a modern video codec. Additionally, increasing the fontsize value gradually rather than jumping to extreme sizes can help maintain clarity.

Is there a way to preview the subtitle changes before encoding?

While FFmpeg does not have a built-in preview mode, you can use tools like VLC Media Player to burn subtitles temporarily for testing. Alternatively, encode a short segment of the video with your desired filter settings and review the output. This iterative approach helps fine-tune parameters efficiently.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More