Back to Blog

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

June 2026 FFMPEG API Team

In today's digital landscape, the demand for video content is skyrocketing. Automating video editing tasks can save time and enhance productivity, especially for developers working on content pipelines, SaaS apps, or AI agents. FFMPEGAPI.net offers a powerful hosted REST API to streamline this process. This article will guide you through adding text overlay captions to your videos using the FFMPEGAPI.net API.

Why Choose FFMPEGAPI.net for Video Processing?

FFMPEGAPI.net provides a hassle-free solution for developers looking to implement video and audio processing capabilities without the need for server setup or FFmpeg infrastructure management. The API-key authentication process ensures a secure workflow, making it ideal for automation and integration into larger projects.

  • No server management required.
  • Flexible API-key authentication.
  • Suitable for content automation and SaaS applications.
  • Built-in support for advanced video editing features.

Understanding the Text Overlay Captions API

The Text Overlay Captions endpoint allows you to render user-supplied text lines as timed caption overlays on your videos. This feature enhances viewer engagement and allows for customization based on your content requirements.

  • Endpoint Path: /api/videos/add-text-overlay-captions
  • HTTP Method: POST
  • Content Type: application/json

Parameters for the Text Overlay Captions API

The API requires a few parameters to generate captions effectively. Below are the essential parameters you need to include in your request:

  • video_url (string, required): The URL of the video.
  • text (string, required): Caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from styles like plain-white, yellow-bg, etc. Default is plain-white.
  • aspect_ratio (string, optional): Specify the video aspect ratio. Default is 9:16.
  • position (string, optional): Position of the text on the video (top, center, bottom). Default is center.
  • duration_per_line (integer, optional): Duration for each line of text in seconds, from 1 to 30. Default is 5.

Making a Request to Add Text Overlay Captions

To add text overlay captions to your video, you can make a POST request to the API. The following examples demonstrate how to do this using cURL and Python.

curl -X POST https://www.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://www.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())

FFMPEGAPI.net offers an efficient way to automate video editing tasks like adding text overlay captions. With its user-friendly API and robust features, developers can easily enhance their video processing workflows without the overhead of managing their own FFmpeg setup. Start using FFMPEGAPI.net today to simplify and optimize your video editing processes.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free