Back to Blog

Automate Video Editing with FFMPEGAPI.net: Adding Text Overlay Captions

June 2026 FFMPEG API Team

In today's digital landscape, automating video editing tasks can save time and enhance productivity. FFMPEGAPI.net provides a powerful hosted REST API that allows developers to add text overlay captions to videos seamlessly. In this article, we will explore how to utilize the Text Overlay Captions endpoint to enhance your video projects effortlessly.

What is FFMPEGAPI.net?

FFMPEGAPI.net is a hosted REST API designed for FFmpeg-powered video and audio processing. It simplifies the complexities of video editing by eliminating the need for server setup or FFmpeg infrastructure management.

  • API-key authentication ensures secure access.
  • No need for extensive technical knowledge.
  • Ideal for automation, SaaS applications, content pipelines, and AI agents.

Using the Text Overlay Captions Endpoint

The Text Overlay Captions endpoint allows you to render user-supplied text lines as timed caption overlays on your videos. This can be useful for creating engaging content with subtitles or emphasizing key points.

To use this feature, you'll make a POST request to the endpoint /api/videos/add-text-overlay-captions.

  • Supports various subtitle styles: plain-white, yellow-bg, pink-bg, blue-bg, red-bg.
  • Allows customization of video aspect ratios: 16:9, 9:16, 4:3, or 3:4.
  • Text can be positioned at the top, center, or bottom of the video.
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'
headers = {'Content-Type': 'application/json'}
data = {
    'video_url': 'https://example.com/video.mp4',
    'text': 'First line\nSecond line',
    'duration_per_line': 4
}
response = requests.post(url, headers=headers, json=data)
print(response.json())

Parameters for Text Overlay Captions

When using the Text Overlay Captions endpoint, you'll need to provide specific parameters to customize your captions effectively. Here’s a breakdown of the required and optional parameters:

  • video_url (string, required): The URL of the video to which captions will be added.
  • text (string, required): Caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from predefined styles (default is plain-white).
  • aspect_ratio (string, optional): Define the aspect ratio (default is 9:16).
  • position (string, optional): Set the text position (default is center).
  • duration_per_line (integer, optional): Duration for each text line in seconds (default is 5).

FFMPEGAPI.net is the ideal solution for developers looking to automate video editing with ease. By leveraging the Text Overlay Captions endpoint, you can enhance your video content and improve viewer engagement. Say goodbye to the complexities of video processing and embrace the simplicity of FFMPEGAPI.net as your go-to hosted API for all your video editing needs.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free