Back to Blog

Automate Video Editing with FFMPEGAPI.net's Text Overlay Captions

June 2026 FFMPEG API Team

As video content continues to dominate the digital landscape, adding captions and overlays has become essential for enhancing viewer engagement. FFMPEGAPI.net offers a robust hosted REST API that enables developers to automate video editing tasks, including the addition of text overlay captions. In this article, we will walk you through how to utilize the Text Overlay Captions endpoint to seamlessly integrate captions into your video content.

What is the Text Overlay Captions API?

The Text Overlay Captions API provided by FFMPEGAPI.net allows you to render user-supplied text lines as timed overlays on your videos. This feature is particularly useful for content creators and developers looking to improve accessibility and engagement by providing clear textual representation of audio content.

  • Supports multiple caption lines.
  • Customizable subtitle styles.
  • Flexible position and duration options.

How to Use the Text Overlay Captions API

To get started with adding text overlays to your videos, you need to send a POST request to the API endpoint. Below is a detailed overview of the required parameters and their usage.

  • video_url: The URL of the video you want to edit.
  • text: The caption lines you wish to overlay, separated by newlines.
  • subtitle_style: Choose from styles like plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
  • aspect_ratio: Set the desired aspect ratio such as 16:9, 9:16, 4:3, or 3:4.
  • position: Specify the caption position as top, center, or bottom.
  • duration_per_line: Define how long each caption line should appear (1 to 30 seconds).
curl -X POST https://ffmpegapi.net/api/videos/add-text-overlay-captions \
-H 'Content-Type: application/json' \
-d '{"video_url":"https://example.com/video.mp4", "text":"First line\nSecond line", "duration_per_line":4}'
import requests

url = 'https://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())

FFMPEGAPI.net simplifies the process of video editing by providing a powerful API that requires no server setup or complex FFmpeg management. With just a few lines of code, you can automate the addition of captions to your videos, enhancing accessibility and engagement. Whether you are building a content pipeline, an automation tool, or a SaaS application, the Text Overlay Captions API is easy to implement and integrates seamlessly into your existing workflow. Start leveraging 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