In today's fast-paced digital landscape, video content is crucial for engaging audiences on social media platforms. Adding text overlay captions is a powerful way to enhance your videos, making them more accessible and engaging. FFMPEGAPI.net offers a robust hosted REST API that simplifies the process of adding text overlays to your videos, allowing developers to streamline their video workflows without the hassle of server management.
What is the Text Overlay Captions Endpoint?
The Text Overlay Captions endpoint of FFMPEGAPI.net enables developers to render user-defined text as timed caption overlays on videos. This can be particularly useful for creating captioned videos for social media, improving viewer engagement, and ensuring that content is accessible to all.
The endpoint supports multiple parameters, allowing you to customize the appearance and timing of the captions according to your needs.
- Seamless integration into your video processing workflow.
- Customizable caption styles and positioning.
- Supports various aspect ratios for different video formats.
How to Use the API
To use the Text Overlay Captions endpoint, you will need to send a POST request to `/api/videos/add-text-overlay-captions`. Below are the parameters you can include in your request:
- video_url (string): The URL of the video to which you want to add captions. Required.
- text (string): One or more caption lines separated by newlines. Required.
- subtitle_style (string): Options include plain-white, yellow-bg, pink-bg, blue-bg, or red-bg. Default is plain-white.
- aspect_ratio (string): Choose from 16:9, 9:16, 4:3, or 3:4. Default is 9:16.
- position (string): Set to top, center, or bottom. Default is center.
- duration_per_line (integer): The duration for which each caption line is displayed, from 1 to 30 seconds. Default is 5.
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
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
response = requests.post(url, json=data, headers=headers)
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 is your go-to solution for seamlessly adding text overlay captions to your videos, especially when targeting social media audiences. With its hosted REST API, developers can integrate powerful video processing capabilities without the complexities of infrastructure management. Enhance your content's accessibility and engagement by leveraging the Text Overlay Captions feature today.