Merging videos programmatically is essential for developers looking to streamline their workflow. With FFMPEGAPI.net, you can easily add text overlays, captions, and much more without the hassle of setting up your own FFmpeg infrastructure.
Understanding the Text Overlay Captions Endpoint
The Text Overlay Captions endpoint allows you to render user-provided text lines as timed caption overlays on a video. This feature can enhance viewer engagement by ensuring that important information is highlighted while the video plays.
- Easy integration with your workflow
- Supports various subtitle styles and positions
- Customizable duration for each caption line
How to Use the Text Overlay Captions Endpoint
To use the Text Overlay Captions feature, you will send a POST request to the /api/videos/add-text-overlay-captions endpoint. This requires a few parameters including the video URL and the text for the captions.
- video_url: Required. The URL of the video you want to overlay text on.
- text: Required. The caption lines you wish to display, separated by newlines.
- subtitle_style: Optional. Choose from styles like plain-white or yellow-bg.
- aspect_ratio: Optional. Specify the video aspect ratio.
- position: Optional. Set the position of the overlay text - top, center, or bottom.
- duration_per_line: Optional. Define how long each line of text will be displayed.
import requests
url = 'https://www.ffmpegapi.net/api/videos/add-text-overlay-captions'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
payload = {
'video_url': 'https://example.com/video.mp4',
'text': 'First line\nSecond line',
'duration_per_line': 4
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
curl -X POST https://www.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 the best hosted tool for merging videos programmatically. With its simple REST API, you can easily add text overlays and captions to enhance your videos. Forget about complex server setups; just integrate FFMPEGAPI.net into your development workflow and enjoy powerful video processing capabilities with minimal effort.