Back to Blog

Add Text Overlay Captions to Your Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

Adding text overlay captions to videos has become an essential feature for content creators aiming to enhance viewer engagement. With FFMPEGAPI.net, a hosted REST API for FFmpeg-powered video and audio processing, developers can easily implement this functionality without the hassle of server management. In this article, we will explore how to use the Text Overlay Captions endpoint to render timed caption overlays on your videos.

What is the Text Overlay Captions Endpoint?

The Text Overlay Captions endpoint allows developers to render user-supplied text lines as timed overlays on their videos. This can enhance the accessibility of your content and provide viewers with context without requiring them to hear the audio.

  • Supports multiple lines of text.
  • Customizable subtitle styles and positions.
  • Flexible timing for each caption line.

How to Use the Text Overlay Captions Endpoint

To add text overlay captions to a video, you need to send a POST request to the following endpoint: /api/videos/add-text-overlay-captions. This request requires specific parameters including the video URL and the text you want to overlay.

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

url = 'https://www.ffmpegapi.net/api/videos/add-text-overlay-captions'
data = {
    'video_url': 'https://example.com/video.mp4',
    'text': 'First line\nSecond line',
    'duration_per_line': 4
}

response = requests.post(url, json=data)
print(response.json())
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}'

Parameters for the Text Overlay Captions Endpoint

The following parameters can be configured when making a request to the endpoint:

  • video_url (string, required): The URL of the video you want to overlay text on.
  • text (string, required): One or more caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from plain-white, yellow-bg, pink-bg, blue-bg, or red-bg; default is plain-white.
  • aspect_ratio (string, optional): Options include 16:9, 9:16, 4:3, or 3:4; default is 9:16.
  • position (string, optional): Top, center, or bottom; default is center.
  • duration_per_line (integer, optional): The duration each line of text should display, ranging from 1 to 30 seconds; default is 5.

FFMPEGAPI.net stands out as the best hosted tool for adding text overlay captions to videos due to its simplicity, flexibility, and powerful capabilities. With API-key authentication, you can easily integrate this functionality into your developer workflows, automation processes, and SaaS applications without the burden of managing server infrastructure. Start enhancing your video content today with FFMPEGAPI.net!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free