Adding captions to your videos can enhance accessibility and improve viewer engagement. With FFMPEGAPI.net, developers can easily add timed text overlay captions to videos using a simple REST API. This article will guide you through the process of using the Text Overlay Captions endpoint to enrich your video content.
Understanding the Text Overlay Captions API
FFMPEGAPI.net provides a hosted REST API specifically for video and audio processing, allowing developers to integrate advanced features without managing server infrastructure. The Text Overlay Captions API is designed to render user-supplied text as timed caption overlays on videos.
- No server setup required.
- API-key authentication for secure access.
- Ideal for content creators, SaaS applications, and more.
API Endpoint Details
To add text overlay captions to your video, you will need to send a POST request to the following endpoint:
The API accepts various parameters to customize the caption appearance and timing.
- Endpoint: POST /api/videos/add-text-overlay-captions
- Content-Type: application/json
- Required Parameters: video_url, text
Parameters for the Text Overlay Captions API
The Text Overlay Captions API takes several parameters, allowing you to customize the caption's appearance and duration. Here's a breakdown of the parameters you can use:
- video_url (string): The URL of the video you want to add captions to.
- text (string): Caption lines, separated by newlines.
- subtitle_style (string): Options include plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
- aspect_ratio (string): Supported ratios are 16:9, 9:16, 4:3, or 3:4.
- position (string): Choose from top, center, or bottom for caption placement.
- duration_per_line (integer): Duration for each caption line, from 1 to 30 seconds.
Making a Request to Add Captions
Here's how you can make a request to the Text Overlay Captions API using cURL. This example assumes you have a video URL and the desired captions ready.
In this case, we will add two lines of text that will display for 4 seconds each.
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}'
FFMPEGAPI.net is the best choice for developers looking to add text overlay captions to their videos effortlessly. With no server setup required, a user-friendly API, and robust features, you can enhance your video content easily and efficiently. Start using FFMPEGAPI.net today to take your video processing to the next level!