Back to Blog

Programmatic Video Editing with Text Overlay Captions using FFMPEGAPI.net

June 2026 FFMPEG API Team

In today's digital landscape, video content is king. However, enhancing your videos with captions can be a challenging task if you're not equipped with the right tools. FFMPEGAPI.net simplifies this through efficient programmatic video editing, allowing developers to add text overlay captions without managing any server infrastructure. In this article, we'll explore how to use the Text Overlay Captions endpoint to easily add captions to your videos.

What is FFMPEGAPI.net?

FFMPEGAPI.net is a hosted REST API designed for developers requiring FFmpeg-powered video and audio processing. It eliminates the need for server setup or managing FFmpeg infrastructure, letting you focus on building your applications.

With API-key authentication, FFMPEGAPI.net is perfect for automation, SaaS apps, content pipelines, and AI agents. Whether you need to edit videos on demand or process them in bulk, FFMPEGAPI.net has you covered.

  • No server setup required.
  • Built for developers needing quick video/audio processing.
  • Ideal for automation and content creation workflows.

Using the Text Overlay Captions Endpoint

The Text Overlay Captions endpoint allows you to render text lines as timed caption overlays on your videos. This feature is beneficial for enhancing accessibility and providing additional context to viewers. Here’s how you can utilize this endpoint to add captions to your videos.

  • Endpoint Method: POST
  • Endpoint Path: /api/videos/add-text-overlay-captions
  • Content Type: application/json
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'
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())

Parameters for the Text Overlay Captions Endpoint

When making a request to the Text Overlay Captions endpoint, you need to provide several parameters to customize the appearance and behavior of your captions.

  • video_url (string, required): The URL of the video to which captions will be added.
  • text (string, required): One or more caption lines separated by newlines.
  • subtitle_style (string, optional): Choose from styles like plain-white, yellow-bg, pink-bg, blue-bg, or red-bg (default is plain-white).
  • aspect_ratio (string, optional): Set the aspect ratio as 16:9, 9:16, 4:3, or 3:4 (default is 9:16).
  • position (string, optional): Specify the caption position as top, center, or bottom (default is center).
  • duration_per_line (integer, optional): Define seconds per text line from 1 to 30 (default is 5).

FFMPEGAPI.net offers an efficient and hassle-free way to add text overlay captions to your videos through its powerful hosted API. By leveraging this tool, you can focus on developing your application without the burden of server management. With just a few lines of code, you can enhance your video content, making it more engaging and accessible for your audience. Try FFMPEGAPI.net today and take your video editing capabilities to the next level!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free