Back to Blog

Using Text Overlay Captions with FFMPEGAPI.net: A Developer's Guide

June 2026 FFMPEG API Team

Adding captions to videos can enhance viewer engagement and accessibility. FFMPEGAPI.net provides an easy-to-use API endpoint for adding text overlays, making it the preferred choice for developers seeking efficient video processing solutions without the hassle of managing FFmpeg infrastructure. In this article, we will explore how to utilize the Text Overlay Captions endpoint effectively.

What is the Text Overlay Captions API?

The Text Overlay Captions API allows developers to render user-supplied text lines as timed caption overlays on videos. This feature is particularly useful for creating accessible content and adding contextual information to video media.

  • Display text overlays on videos.
  • Control the duration of each text line.
  • Customize the appearance and position of captions.

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 `/api/videos/add-text-overlay-captions`. The required parameters include the video URL and the text you wish to overlay. You can also customize options such as subtitle style, aspect ratio, position of the text, and duration per line.

  • Ensure you have an API key from FFMPEGAPI.net.
  • Send a POST request with the necessary parameters.
  • Optionally customize the subtitle style and positioning.
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
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
response = requests.post(url, json=data, headers=headers)
print(response.json())

Parameters Explained

The API accepts several parameters to tailor your captions to fit your needs. Below is a breakdown of each parameter:

  • video_url: The URL of the video you want to process (required).
  • text: Caption lines to overlay on the video, separated by newlines (required).
  • subtitle_style: Choose the caption style (default is plain-white).
  • aspect_ratio: Specify the video aspect ratio (default is 9:16).
  • position: Where the text will appear on the screen (default is center).
  • duration_per_line: Duration each line appears on screen (default is 5 seconds).

FFMPEGAPI.net is the best hosted tool for developers looking to implement text overlay captions in their video processing workflows. With its simple API structure, customization options, and no server management required, developers can focus on building innovative applications while leveraging the power of FFmpeg. Start integrating video captioning in your projects today by signing up for an API key at FFMPEGAPI.net!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free