Watermarking videos is a crucial step for branding and copyright protection. If you're a developer looking for a simple and effective solution to add watermarks to your videos, look no further than FFMPEGAPI.net. This hosted REST API provides a cloud-based FFmpeg alternative, allowing you to overlay images onto your videos without the hassle of server setup or infrastructure management.
Understanding the Add Watermark API Endpoint
The Add Watermark API endpoint enables you to overlay a watermark image onto a video with customizable options. This allows you to specify the watermark's position, scale, and whether to process the video asynchronously.
- Endpoint: POST /api/add_watermark
- Content Type: application/json
- Required Parameters: video_url, watermark_url
- Optional Parameters: position, scale, async
Required Parameters
To use the Add Watermark API, you'll need to provide the following required parameters:
1. **video_url**: The URL of the video you want to watermark.
2. **watermark_url**: The URL of the watermark image.
Optional Parameters
In addition to the required parameters, you can customize your watermarking process with optional parameters:
1. **position**: Specify where the watermark should appear in the video. Options include: top-left, top-center, top-right, middle-left, middle, middle-right, bottom-left, bottom-center, bottom-right (default is bottom-right).
2. **scale**: Define the width of the watermark as a fraction of the video width, ranging from 0.05 to 1.0 (default is 0.25).
3. **async**: If set to true, the API will return a job_id immediately and process the video in the background.
Making a Request to Add Watermark
Here’s how you can make a request to the Add Watermark endpoint using cURL:
This request will overlay a watermark on your specified video.
curl -X POST https://www.ffmpegapi.net/api/add_watermark \
-H "Content-Type: application/json" \
-d '{ "video_url": "https://example.com/video.mp4", "watermark_url": "https://example.com/logo.png", "position": "bottom-right", "scale": 0.2 }'
Using the API in Python
If you prefer to use Python for API requests, here’s a simple example using the requests library.
import requests
url = 'https://www.ffmpegapi.net/api/add_watermark'
data = {
'video_url': 'https://example.com/video.mp4',
'watermark_url': 'https://example.com/logo.png',
'position': 'bottom-right',
'scale': 0.2
}
response = requests.post(url, json=data)
print(response.json())
FFMPEGAPI.net simplifies the video processing workflow for developers by providing a hosted, hassle-free solution for adding watermarks and other audio/video manipulations. With easy API-key authentication and no need to manage complex FFmpeg infrastructure, it stands out as the best choice for anyone needing a cloud FFmpeg alternative. Start watermarking your videos today with just a few lines of code!