Adding watermarks to videos is a common practice used for branding, copyright protection, and enhancing visual appeal. As the demand for video content grows across various platforms, the need for efficient and automated solutions has become increasingly important. Using APIs to streamline the watermarking process not only simplifies implementation but also ensures consistency and quality in video presentation. This approach allows content creators to protect their intellectual property while reinforcing brand identity, all with minimal effort. Before we get into the technical steps, it's important to understand the two primary types of watermarks perceptible and imperceptible and their distinct benefits.
Video watermarking is the process of embedding a unique identifier into a video file. This identifier can be visible (perceptible) or invisible (imperceptible) mar to viewers. The primary goals of watermarking are to assert copyright ownership, deter piracy, and track the distribution of video content.
Watermarks can carry various types of information, including:
Video watermarking techniques can be broadly categorized into two types: perceptible and imperceptible.
Perceptible watermarking:
Imperceptible watermarking:
While video watermarking provides significant benefits, it also faces several challenges:
Streaming services utilize watermarking to protect their original content from piracy and unauthorized distribution.
Example: Netflix and Hulu employ advanced watermarking techniques to safeguard their exclusive shows and movies. For instance, Netflix uses forensic watermarking to embed unique identifiers into its streams. This allows them to trace the source of any leaked content back to the specific user account, thereby deterring piracy and ensuring that their intellectual property is protected.
Television networks use watermarking to track their broadcasts and ensure compliance with licensing agreements.
Example: BBC and other major broadcasters often embed watermarks in their programming to monitor where their content is aired. For example, during the Olympics, broadcasters use watermarked feeds to verify that their coverage is compliant with broadcasting rights agreements. This helps them track unauthorized broadcasts and enforce licensing terms effectively.
Advertisers incorporate perceptible watermarks in promotional videos to enhance brand visibility while ensuring that their content is attributed correctly.
Example: During high-profile events like the Super Bowl, advertisers often use visible watermarks or logos in their commercials. For example, a company like Coca-Cola may include its logo prominently in ads aired during the event. This not only reinforces brand recognition but also ensures that viewers associate the advertisement with Coca-Cola, even if it gets shared on social media platforms.
Implementing video watermarking can be complex, but APIs simplify this process by providing a streamlined solution for developers. Here are a few key benefits:
FastPix provides API for video processing, including features for adding watermarks or image overlays to videos. You can add watermarks during media creation, which applies to both uploaded videos.
The URL can originate from various cloud storage services or content delivery networks (CDNs) such as:
Amazon S3: URLs from Amazon's Simple Storage Service.
Google Cloud Storage: URLs from Google Cloud's storage solution.
Azure Blob Storage: URLs from Microsoft's Azure storage.
Public CDNs: URLs from public content delivery networks that host video files.
Or any URL that the public can access.
Create an account and get your API key
First, sign up for a FastPix account at dashboard.fastpix.io Once registered, navigate to your account settings to find your API keys. You will need these keys to authenticate your requests.
Upload your video
Before adding a watermark, you need to upload the video you want to watermark. This can be done using the FastPix API's Create media from URL creation endpoint.
POST https://v1.fastpix.io/on-demand
This endpoint allows developers or users to create a new video or audio media in FastPix using a publicly accessible URL. FastPix will fetch the media from the provided URL, process it, and store it on the platform for use.
Example cURL request for uploading a video:
1curl -X POST 'https://v1.fastpix.io/on-demand' \
2 --user {Access Token ID}:{Secret Key} \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "inputs": [
6 {
7 "type": "video",
8 "url": "https://static.fastpix.io/sample.mp4",
9 "startTime": 0,
10 "endTime": 60
11 },
12 {
13 "type": "watermark",
14 "url": "https://static.fastpix.io/watermark-4k.png",
15 "placement": {
16 "xAlign": "left",
17 "xMargin": "10%",
18 "yAlign": "top",
19 "yMargin": "10%"
20 }
21 }
22 ],
23"metadata": {
24 "key1": "value1"
25 },
26"accessPolicy": "public",
27 "maxResolution": "1080p"
28}
This request uploads your video and returns an asset ID that you will use in subsequent requests.
Once your video is uploaded, you can add a watermark using the overlay settings in your media creation request. The first input in your array should be the video file URL, followed by the URL of your watermark image along with its placement details.
Request Example:
1{
2
3 "inputs": [
4
5 {
6 "type": "video",
7 "url": " {VIDEO_INPUT_URL}”,
8 "startTime": 0,
9 "endTime": 60
10 },
11
12 {
13 "type": "watermark",
14 "url": " {IMAGE _INPUT_URL} ",
15 "placement": {
16 "xAlign": "top",
17 "xMargin": "10%",
18 "yAlign": "left",
19 "yMargin": "10%"
20 },
21 "width": "25%",
22 "height": "25%",
23 "opacity": "80%"
24
25 }
26 ] ,
27
28 "accessPolicy": "public",
29 “maxResolution”: “1080p”
30
31}
Explanation:
XAlign : Displays the vertical positioning of the watermark.
XMargin: The horizontal distance between the starting point of vertical alignment and the closest edge of the image/video
YAlign: Displays the horizontal positioning of the watermark
YMargin: The vertical distance between the starting point of vertical alignment and the closest edge of the image/video.
After sending your request with overlay settings:
Video watermarking is an essential tool for protecting digital content in an era where piracy poses significant challenges for creators and distributors alike. By understanding the different techniques available ranging from perceptible to imperceptible methods content owners can choose appropriate strategies that align with their specific needs for security and branding.
Adding watermarks to videos using the FastPix API is a straightforward process that enhances branding and protects content from unauthorized use. By leveraging customizable overlay settings, you can ensure that your videos not only look professional but also serve their intended purpose effectively.