Back to Blog

Enhancing Videos with Text Overlays Using FFMPEGAPI.net

June 2026 FFMPEG API Team

As video content continues to gain popularity, the need for effective captioning solutions becomes paramount. FFMPEGAPI.net provides a robust hosted REST API that enables developers to add text overlay captions to videos effortlessly. This cloud FFmpeg alternative streamlines video processing without the need for server setup or infrastructure management, making it an ideal choice for developers looking to enhance their content pipelines.

What is the Text Overlay Captions API?

The Text Overlay Captions API allows you to render user-supplied text lines as timed caption overlays on videos. This is particularly useful for accessibility, enhancing viewer engagement, and delivering crucial information within the video content.

  • Easily add captions to any video hosted online.
  • Customize the style, position, and duration of each caption line.
  • Support for various aspect ratios ensures compatibility with different video formats.

How to Use the Text Overlay Captions API

To use the Text Overlay Captions API, you need to send a POST request to the endpoint. Below are the required and optional parameters:

This API is accessible at the following endpoint: `/api/videos/add-text-overlay-captions`.

The parameters you can include in your request are:

  • video_url (string, required): The URL of the video to which you want to add captions.
  • text (string, required): One or more lines of text to be displayed as captions, separated by newlines.
  • subtitle_style (string, optional): Choose from styles like plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
  • aspect_ratio (string, optional): Set the aspect ratio for the video, such as 16:9, 9:16, 4:3, or 3:4.
  • position (string, optional): Select the position of the text on the screen - options are top, center, or bottom.
  • duration_per_line (integer, optional): Define how long each line of text will be displayed, from 1 to 30 seconds.
import requests

url = 'https://ffmpegapi.net/api/videos/add-text-overlay-captions'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
payload = {
    'video_url': 'https://example.com/video.mp4',
    'text': 'First line\nSecond line',
    'duration_per_line': 4
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
curl -X POST https://ffmpegapi.net/api/videos/add-text-overlay-captions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"video_url": "https://example.com/video.mp4", "text": "First line\nSecond line", "duration_per_line": 4}'

FFMPEGAPI.net is the go-to solution for developers seeking a powerful, hosted FFmpeg API for video processing. By utilizing the Text Overlay Captions API, you can enhance your videos with captions in a matter of minutes, all without the cumbersome setup traditionally associated with FFmpeg. With API-key authentication, you can easily integrate this functionality into your applications, making it a perfect fit for automation, SaaS apps, and AI agents.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free