Dynamic watermarking means showing user-identifiable data over a video in a moving and non-intrusive manner to ensure the highest protection from screen capture and optimize the viewing experience. Videos hosted through VdoCipher cannot be illegally downloaded through any tools/extensions/downloaders. Screen capture block with 100% surety is possible only in mobile apps and Safari browsers. For Chrome, Firefox, and other browsers, there does however remain the risk of piracy from screen capture. User-based information shown as moving dynamic watermark effectively discourages users from pirating video content using screen capture and goes a long way towards helping users protect their premium content.
The sample video below contains a dynamic watermark displaying the User name, User IP, and User email. The below video is displayed using our WordPress plugin and the same can be configured using APIs or Moodle plugin as well.
The dynamic watermark can be customized for movement, color, size, transparency and frequency. You can try the watermark feature on your website by signing up for a Free 30 Day Trial on our home page.
Dynamic Watermark Demo
Features of Dynamic Watermark by VdoCipher
- Add user details like user id, email id, phone number, ip address as an overlay over your videos
- Add time stamp, and fixed text (e.g company name)
- Customise size, color, transparency, and frequency of moving watermark. You can make it very light and also change frequency so that it is not always visible, to ensure optimum viewing experience. You can optimize frequency in such a manner, that it is difficult to remove the watermark maintaining user experience. To show a watermark at a particular position for 5 seconds and then not show it for 20 seconds, you can use the parameters of ‘interval’:5000 and ‘skip ‘: 20000. (1 second = 1000 microsecond). Other parameters are explained in below tutorial steps below.
- If you are using a static/fixed text watermark, then it has to be compulsorily set at the top left of the player, it can not reside on other parts.
- Image watermark is currently not possible with VdoCipher, but you can use your company/brand name as a watermark.
- Quick 5-minute integration using wordpress plugin or moodle plugin or API. Iframe integration can show ip address and fixed text as watermark but it can not show user id, email id etc. as watermark since it is not a backend integration.
How to Add Dynamic Watermark to your VdoCipher Videos
To generate a watermark or to add text to videos you essentially need a JSON string describing how and what you will overlay on your protected videos. In this blog, we will be detailing how to integrate dynamic or static watermarks to add text to videos.
Step 1 is to create the watermark code. Once you have created the watermark code,
Step 2 you add the watermark to the video. This is done by adding watermark code to the WordPress plugin settings (for WordPress users), or by adding it as part of OTP API call for VdoCipher API users or by adding it to Moodle plugin settings.
Step 1: Create a Watermark Code
We are assuming that you have uploaded your video to your VdoCipher account. You would need to pass a JSON string as annotation code. The JSON string would contain all the information about the watermark. A JSON string is a universal form of representing structured data in a way that machines can understand.
Here is a sample JSON string that adds a moving (dynamic) watermark and a static watermark.
[ {'type':'rtext', 'text':'moving text', 'alpha':'0.8', 'color':'0xFF0000','size':'15','interval':'5000','skip':20000}, {'type':'text', 'text':'static text', 'alpha':'0.5' , 'x':'10', 'y':'100', 'color':'0xFF0000', 'size':'15'} ]
Technically, this is an array of JSON objects, where each object describes a single annotation item.
Each of these items will be described by its parameters. Every item requires a type parameter that defines the type of watermark. The type of watermark can be either a moving text or a static text. The rest of the parameters depend on the type.
Following is a short description of how each parameter affects the display of text.
Moving text
The following code will display a dynamic watermark code, displaying name, IP and email address in a single line. The text color will be red (#ff0000), opacity is 0.8, and font size is 15. The watermark is configured to keep one position for 5 seconds (5000ms) and then hide watermark for 20 seconds (20000 ms) , and then show again at a new position for 5 seconds.
[{ 'type':'rtext', 'text':'{name}, {ip}, {email}', 'alpha':'0.8', 'color':'0xFF0000', 'size':'15', 'interval':'5000', 'skip':'20000' }]
Type of text – Moving watermark
Set type parameter as rtext for Dynamic watermark
'type':'rtext',
Set the text to be shown
'text" : 'Enter whatever text you like to be displayed',
You can add user identifiable information, such as user name, user email and user IP.
- ‘text’: ‘{name}’,
- ‘text’: ‘{email}’,
- ‘text’: ‘{ip}’,
'text':'Name: {name}, email: {email}, IP: {ip}
To display the name, email and IP separately, and not in a single line, you can simply create 3 watermark objects, as follows:
[{'type':'rtext','text':'{name}','alpha':'0.8', 'color':'0xFF0000', 'size':'15', 'interval':'5000', 'skip':'2000'}, {'type':'rtext','text':'{ip}','alpha':'0.8', 'color':'0xFF0000', 'size':'15', 'interval':'5000', 'skip':'2000'}, {'type':'rtext','text':'{email}','alpha':'0.8', 'color':'0xFF0000', 'size':'15', 'interval':'5000', 'skip':'2000'} ]
Specify text opacity
This is the opacity of the text. For full opacity keep alpha value 1.
'alpha':'0.8',
Specify text color
This is the hex value of the watermark text color. You can pick your choice of color and its corresponding hex value from the following page on W3schools.
'color':'0xFF0000',
Specify the font size
This is the font size
'size':'15',
Specify the interval over which watermark changes position
The value is the interval in milliseconds when the text changes position
'interval':'5000',
Skip feature for watermark
It is possible to have watermark skip for some time between two overlays. Here is a sample code for it –
'skip':'2000'
Time stamp for watermark. (Only for WordPress)
[[{'type':'text', 'text':'Time: {date.h:i:s A}', 'alpha':'0.30' , 'x':'12', 'y':'130', 'color':'0xFF0000', 'size':'13'}]]
Add Custom Variables as Watermark
The following blog details how you can add text to videos or custom variables as watermark to your videos: Custom Variables as Watermark
Some important things to keep in mind about Watermark
- Note that both the name and the value of these parameters should be in quotes. This rule applies to both text as well as numbers.
- Each parameter is to be separated by a comma. There should not be a comma after the last parameter for the dynamic watermark video settings.
Static text
[{ 'type' : 'text', //This defines the type of annotation item to static watermark 'text' : 'the text you like to be displayed', 'x' : '10', //the distance from the left border of video. 'y': '50', //the distance from the top border of video. 'alpha': '0.8', //the opacity of the rendered text, 0 is invisible, 1 is full opaque 'color':'0xFF0000', //the color of the text specified as hexadecimal or uint 'size':'15' //Height of the text, in pixels. }]
Step 2: Add Watermark Code to Video Request using API or plugin
If you are using our WordPress or Moodle plugin you can simply add the watermark JSON in the plugin settings page. If you are integrating VdoCipher to your custom-built site, you would need to pass the JSON object as part of the OTP request.
The HTTP POST data containing watermark JSON object has to be sent as Content-Type: application/json
. The JSON Object is to be sent as value to the key annotate
. The header for the OTP request should include the Authorization using API Secret Key. A sample OTP request including watermark information is as follows.
curl -X POST \ https://dev.vdocipher.com/api/videos/1234567890/otp \ -H 'Accept: application/json' \ -H 'Authorization: Apisecret a1b2c3d4e5' \ -H 'Content-Type: application/json' \ -d '{ "annotate":"[{'\''type'\'':'\''rtext'\'', '\''text'\'':'\'' {name}'\'', '\''alpha'\'':'\''0.60'\'', '\''color'\'':'\''0xFF0000'\'','\''size'\'':'\''15'\'','\''interval'\'':'\''5000'\''}]" }'
The sample videoID is 1234567890
and the API Secret Key is a1b2c3d4e5
. This sample code only passes the annotation code as parameter.
This blog: Protect Videos on WordPress provides more details on securing videos using WordPress.
Still having problems to add text to videos or with the dynamic watermark on video code? Send us the code you are using and the output you wish to be shown to support@vdocipher.com
Supercharge Your Business with Videos
At VdoCipher we maintain the strongest content protection for videos. We also deliver the best viewer experience with brand friendly customisations. We'd love to hear from you, and help boost your video streaming business.
![Decorative Circle](png/circle.png)
For the sample code, where should I put that code on my site, to make it work with the video?
In your dashboard, go to vdocipher section under settings menu. You need to place this code in the text box labelled “Annotation Statement”
Hi, I have not located this path. Can you help me?
Hello Vaibhav Sir I Have Purchased Plan I Wanted to Know Phone Number Code For Watermark
Hi! How can I do that with the Joomla plugin ?
Currently, this feature is not available within our joomla module. You can use the API directly to enable watermark in your joomla website(using PHP code to make API calls). We have planned this for next version joomla module. Thanks for your suggestion.
Thanks for your answer. And when do you think to publish your next release of the Joomla plugin? This feature is really important for me. Thanks!
Could it display the name of the person who is watching if they are logged in? Thanks!
Hi Bailarina, yes if you can put any variables that you can obtain as watermark. If you are using the wordpress plugin, there is a very easy way to do that as described here https://www.vdocipher.com/blog/2014/08/variables-on-wordpress-videos/
How to prevent the copying of video link to use by other users?
Hello Peter, VdoCipher does not use normal public embed codes. Through our plugins & APIs, we provide a custom embed code, which generates a new url with OTP (One time password) at backend. Thus once a video url is generated for streaming, it will not play for second time.
$apikey = “$key”;
$vidID = $CourseYoutubeLink;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://dev.vdocipher.com/api/videos/$vidID/otp”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => json_encode([
“ttl” => 300,
]),
CURLOPT_HTTPHEADER => array(
“Accept: application/json”,
“Authorization: Apisecret $apikey”,
“Content-Type: application/json”
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
$obj = json_decode($response);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
$otp = $obj->otp;
$playback = $obj->playbackInfo;
This is my current code can you place add watermark to this ?
Kindly share this query in detail at support@vdocipher.com