Back to Blog

Enhance Your Videos with Text Overlay Captions Using FFMPEGAPI.net

June 2026 FFMPEG API Team

In the world of video content creation, the ability to add captions quickly and efficiently is critical. Whether you're developing a SaaS application, creating an automated video processing pipeline, or just enhancing your video content for accessibility, FFMPEGAPI.net is your go-to solution. With our hosted REST API, you can easily overlay text captions on your videos without any server setup or FFmpeg infrastructure management. Let's dive into how to use our 'Text Overlay Captions' feature.

What is the Text Overlay Captions Feature?

The 'Text Overlay Captions' feature allows you to render supplied text lines as timed overlays on your videos. This means you can display user-provided text over a video, with each line appearing for a specific duration, enhancing viewer experience and engagement.

  • Add captions to your videos effortlessly.
  • Customize the style, aspect ratio, and position for your text overlays.
  • Utilize a simple POST request to get started.

How to Use the Text Overlay Captions API

To utilize the Text Overlay Captions feature, you will need to make a POST request to the endpoint '/api/videos/add-text-overlay-captions'. Below are the required and optional parameters you can use in your request.

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())

Parameters for the Text Overlay Captions

Here are the key parameters you can include in your API request:

  • video_url (string, required): The URL of the video to be processed.
  • text (string, required): Caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from styles like 'plain-white', 'yellow-bg', 'pink-bg', etc., with 'plain-white' as the default.
  • aspect_ratio (string, optional): Options include '16:9', '9:16', '4:3', or '3:4', with '9:16' as the default.
  • position (string, optional): Set to 'top', 'center', or 'bottom', defaulting to 'center'.
  • duration_per_line (integer, optional): Control the display duration for each caption line, ranging from 1 to 30 seconds, defaulting to 5.

FFMPEGAPI.net is the best video processing API for automation, enabling developers to effortlessly add text overlays to videos. With a simple HTTP request, you can enhance your video content, improve viewer engagement, and save significant time in your development workflow. Start using FFMPEGAPI.net today for your video processing needs!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free