Back to Blog

Enhance Your Videos with Text Overlay Captions Using FFMPEGAPI.net

June 2026 FFMPEG API Team

In today's content-driven world, adding captions and overlays to videos is essential for accessibility and engagement. With FFMPEGAPI.net, developers can leverage a powerful hosted REST API for FFmpeg-based video and audio processing, streamlining the workflow without the need for complex server setups. In this article, we will explore how to utilize the Text Overlay Captions API to add timed captions to your videos effortlessly.

What is the Text Overlay Captions API?

The Text Overlay Captions API offered by FFMPEGAPI.net allows developers to render user-supplied text lines as timed overlays on any video. This feature is particularly useful for making videos more accessible and engaging by displaying captions that complement the visual content.

  • Add one or more caption lines to your videos.
  • Specify how long each caption is displayed.
  • Choose from various subtitle styles and positions.

How to Use the API Endpoint

To add text overlays to your video, you will make a POST request to the following endpoint: `/api/videos/add-text-overlay-captions`. The request must be made with the appropriate parameters in JSON format.

  • video_url (string): The URL of the video you want to process.
  • text (string): Caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from styles like plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
  • aspect_ratio (string, optional): Specify the aspect ratio, such as 16:9, 9:16, 4:3, or 3:4.
  • position (string, optional): Position the captions at top, center, or bottom.
  • duration_per_line (integer, optional): Duration each line is displayed, ranging from 1 to 30 seconds.
import requests

url = 'https://ffmpegapi.net/api/videos/add-text-overlay-captions'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
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())
curl -X POST https://ffmpegapi.net/api/videos/add-text-overlay-captions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"video_url":"https://example.com/video.mp4", "text":"First line\nSecond line", "duration_per_line":4}'

FFMPEGAPI.net stands out as the best video processing API for automation, providing an easy-to-use interface for developers who want to enhance their video content with captions. With the Text Overlay Captions API, you can quickly add timed overlays to videos without the overhead of managing FFmpeg infrastructure. Get started today and transform your video assets into more engaging content!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free