Back to Blog

How to Add Text Overlay Captions to Videos Using FFMPEGAPI.net

June 2026 FFMPEG API Team

In today’s digital landscape, adding captions to videos is essential for accessibility and engagement. With FFMPEGAPI.net, you can easily overlay text captions on your videos using our powerful, hosted REST API. In this article, we will explore how to utilize the Text Overlay Captions endpoint to enhance your video content without any server setup or FFmpeg infrastructure management.

What is the Text Overlay Captions Endpoint?

The Text Overlay Captions endpoint of FFMPEGAPI.net allows developers to render user-supplied text lines as timed overlays on videos. This feature is particularly useful in content pipelines where quick and effective video processing is required.

  • Supports various subtitle styles, including plain white, yellow background, and more.
  • Allows customization of aspect ratio and position for optimal viewing.
  • Enables text lines to be displayed for a specified duration, enhancing viewer engagement.

How to Use the Text Overlay Captions API

Using the Text Overlay Captions endpoint is straightforward. You'll make a POST request to the following path: `/api/videos/add-text-overlay-captions`. The request requires a JSON body that includes the video URL and the text you want to overlay.

  • Method: POST
  • Content Type: application/json
  • Required Parameters: video_url, text
import requests

url = 'https://www.ffmpegapi.net/api/videos/add-text-overlay-captions'
data = {
    'video_url': 'https://example.com/video.mp4',
    'text': 'First line\nSecond line',
    'duration_per_line': 4
}

response = requests.post(url, json=data)
print(response.json())

Parameters for Customizing Your Captions

FFMPEGAPI.net provides several optional parameters to customize your text overlays. Here are the key parameters you can use:

1. **subtitle_style**: Choose from styles like plain-white, yellow-bg, pink-bg, etc. Default is plain-white.

2. **aspect_ratio**: Select an aspect ratio (16:9, 9:16, 4:3, or 3:4) to fit your video format.

3. **position**: Set the position of the overlay text to top, center, or bottom. Default is center.

4. **duration_per_line**: Control how long each line of text is displayed, ranging from 1 to 30 seconds. Default is 5.

FFMPEGAPI.net stands out as the best hosted tool for video processing, especially when it comes to adding text overlay captions. With no server setup required and an intuitive API, developers can streamline their content creation workflows. Whether you're building a SaaS application, automating video editing, or enhancing accessibility, our API provides the fast media processing capabilities you need. Start using FFMPEGAPI.net today to elevate your video content!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free