Back to Blog

How to Add Text Overlay Captions to Your Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

In today’s digital landscape, the ability to add captions to videos programmatically is essential for enhancing user engagement. FFMPEGAPI.net provides a seamless way to add text overlay captions to your videos without the hassle of managing server infrastructure. This guide walks you through using the Text Overlay Captions API endpoint, allowing you to enrich your video content effortlessly.

Understanding the Text Overlay Captions API

FFMPEGAPI.net offers a dedicated endpoint for adding timed text overlay captions to videos. This feature allows developers to overlay custom text lines onto their videos, improving accessibility and viewer experience.

  • Simple POST request for text overlay captions.
  • Supports multiple customization options for captions.
  • No server setup required; fully hosted solution.
  • API-key authentication for secure access.

API Endpoint Details

To use the Text Overlay Captions API, you'll send a POST request to the following endpoint: `/api/videos/add-text-overlay-captions`. The request must include the video URL and the text you want to overlay.

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

Parameters Required for the API Call

The API requires the following parameters to function correctly. Each parameter allows for customization to fit your specific needs.

  • video_url (required): The URL of the video.
  • text (required): Caption lines separated by newlines.
  • subtitle_style (optional): Styles include plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
  • aspect_ratio (optional): Options are 16:9, 9:16, 4:3, or 3:4.
  • position (optional): Choose from top, center, or bottom for caption positioning.
  • duration_per_line (optional): Duration for each line displayed, from 1 to 30 seconds.

Example API Call

Here’s how you can make a practical API call to add text overlay captions to a video using CURL and Python.

curl -X POST https://ffmpegapi.net/api/videos/add-text-overlay-captions \n-H "Content-Type: application/json" \n-d '{"video_url":"https://example.com/video.mp4", "text":"First line\nSecond line", "duration_per_line":4}'
import requests\n\nurl = 'https://ffmpegapi.net/api/videos/add-text-overlay-captions'\ndata = {\n    'video_url': 'https://example.com/video.mp4',\n    'text': 'First line\nSecond line',\n    'duration_per_line': 4\n}\nresponse = requests.post(url, json=data)\nprint(response.json())

Using FFMPEGAPI.net for adding text overlay captions to videos allows developers to streamline their workflow without the complexity of managing servers. Its simple API and robust features make it the perfect choice for automation, SaaS applications, and content pipelines. With a few lines of code, you can enhance your video content, making it more engaging and accessible to a wider audience.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free