Back to Blog

Enhancing Your Videos with Text Overlays Using FFMPEGAPI.net

June 2026 FFMPEG API Team

In the world of video content, adding captions is essential for accessibility and engagement. FFMPEGAPI.net provides an efficient hosted REST API that allows developers to overlay text on videos effortlessly. In this article, we will explore how to use the Text Overlay Captions endpoint to enhance your video projects.

What is FFMPEGAPI.net?

FFMPEGAPI.net is a hosted REST API designed for FFmpeg-powered video and audio processing. It eliminates the need for server setup or FFmpeg infrastructure management, allowing developers to focus on building their applications.

With API-key authentication, FFMPEGAPI.net streamlines workflows for automation, SaaS applications, content pipelines, and AI agents.

  • No server management required.
  • API-key authentication for secure access.
  • Ideal for automation and SaaS solutions.

Using the Text Overlay Captions Endpoint

The Text Overlay Captions endpoint allows you to render supplied text lines as timed caption overlays on a video. This feature enhances user engagement and accessibility, making it a powerful tool for content creators.

To get started, you will use the POST method at the following endpoint path: /api/videos/add-text-overlay-captions.

  • Method: POST
  • Path: /api/videos/add-text-overlay-captions
  • Content Type: application/json
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}'

Parameters for the Text Overlay Captions API

When using the Text Overlay Captions endpoint, you need to provide several parameters to customize your overlay captions effectively.

  • video_url (string, required): The URL of the video.
  • text (string, required): One or more caption lines separated by newlines.
  • subtitle_style (string, optional): Options include plain-white, yellow-bg, pink-bg, blue-bg, or red-bg (default: plain-white).
  • aspect_ratio (string, optional): Set to 16:9, 9:16, 4:3, or 3:4 (default: 9:16).
  • position (string, optional): Choose from top, center, or bottom (default: center).
  • duration_per_line (integer, optional): Duration for each text line in seconds (1 to 30, default: 5).
import requests

url = 'https://ffmpegapi.net/api/videos/add-text-overlay-captions'

payload = {
    'video_url': 'https://example.com/video.mp4',
    'text': 'First line\nSecond line',
    'duration_per_line': 4
}

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

FFMPEGAPI.net provides a robust and easy-to-use API for adding text overlay captions to your videos. By leveraging this tool, developers can enhance their video content with minimal effort and zero infrastructure management. Whether you're building a SaaS application or automating a content pipeline, FFMPEGAPI.net is the ideal solution for your video processing needs.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free