Is it possible to burn a watermark onto the video file upon transcoding?
I’ve configured the Kaltura flavors and removed the original (file) flavor. I’ve set the watermark on a player. It plays with watermark, but seems that the file is not burned with the watermark because I can still download the video (from my browser toolbar) without any watermark.
I’m looking to get the video branded upon upload rather than on streaming within the player.
What are the procedures to get this accomplished?
There is a watermarkData field in the flavorParams (customData), it accepts following json string -
imageEntry - (optional),an image entry that will be used as a watermark image. Supported - PNG and JPG. Transparent alpha layer
(PNG only) is supported.
url - (optional), external url for the watermark image file. Formats same as above. Either ‘imageEntry’ or ‘url’ must be provided
margins - (optional), ‘WxH’, distance from the video frame borders. Positive numbers refer to LeftUp corner, negative to
RightDown corner of the video frame. If omitted - LeftUp is assumed. (Example - ‘-100x10’- 100pix from right side, 10 pixs from the
upper side)
opacity - (optional) - 0-1.0 range. Defines the blending level between the watermark image and the video frame. if omitted the
watermark is presented un-blended.
scale - (optional), ‘WxH’ - scale the water mark image to the given size. If one of the dimensions is omitted, it is calculated
to preserve the watermark image aspect ratio.
Limitations:
The combination of transparent watermark with opacity does not work properly.
Hi Jess, thank you for your prompt response. Would I be able to connect with the API through the TestMe console? I was able to connect and start a session, but I received a SERVICE_FORBIDDEN error when trying to update (or add) a flavorParam:
The access to service [flavorParams->update] is forbidden
You can do it from the test me but note the partner ID you need is 0, not your own partner.
$userId = null;
$expiry = null;
$privileges = null;
// get with:
// mysql> select admin_secret from partner where id=0\G
$secret = $argv[1];
$type = KalturaSessionType::ADMIN;
$partnerId=0;
$service_url= $argv[2];
$client=generate_ks($service_url,$partnerId,$secret,$type=KalturaSessionType::ADMIN,$userId=null,$expiry = null,$privileges = null);
I was not able to update any of the existing flavors that come with core. I can select ‘list’ all flavors and see all results, but when using the ‘ID’ of any existing flavor with ‘update’ … then I get error, ID cannot be found.
However, I was able to successfully ‘add’ a new flavor, and ‘update’ the new flavor with watermark data using it’s ID. Not really sure why the existing flavors are locked up (even using 0 as partner) but in any case, I guess what I can do is replicate each one as a new flavor with watermark, if I’m not able to ‘update’ existing.
What was the error you got when trying to update an existing flavor?
Regardless, creating your own custom flavors rather than updating defaults actually feels better to me…
Probably because I wasn’t able to connect with Partner ID 0, whereas the new flavor I added was with my own Partner ID. Well, at least this way the default flavors will stay in tact.
Yes, it is possible:
‘x30%’ - scale to 30% of the source height. Calc the width to match the aspect ratio
All available options:
Watermark Data
imageEntry (optional, either 'imageEntry or ‘url’ must be provided)
An image entry that will be used as a watermark image.
Supported - PNG and JPG. Transparent alpha layer (PNG only) is supported.
url (optional, either 'imageEntry or ‘url’ must be provided)
External url for the watermark image file.
Formats same as above.
margins (optional)
‘WxH’, distance from the video frame borders.
Positive numbers refer to LeftUp corner, negative to RightDown corner of the video frame.
‘center’ allowed to place the WM relatively to the center of the image. Offset allowed
If omitted - LeftUp is assumed.
Example -
‘-100x10’- 100pix from right side, 10 pixs from the upper side
’center-10xcenter+30’ - place the WM 10pix left to the middle and 30pix bellow the middle
opacity (optional)
0-1.0 range. Defines the blending level between the watermark image and the video frame.
If omitted the watermark is presented un-blended.
scale (optional)
‘WxH’ - scale the water mark image to the given size. If one of the dimensions is omitted,
it is calculated to preserve the watermark image aspect ratio.
‘n%’ to scale to n% of the source size.
Example
’x30%’ - scale to 30% of the source height. Calc the width to match the aspect ratio
fade (optional)
Several fade in/outs are allowed
– type - in/out, default ‘in’
– start_time - in sec (flaot), default 0
– alpha - If set to 1, fade only alpha channel, if one exists on the input. default 0
– duration - in sec, default ~1sec.