Watermark Profile Configurations

Fastevo MP2 allows you to create Watermark Profiles to insert visible watermarks into your content. This guide will walk you through the process of creating, setting, deleting, and listing Watermark Profiles.

⚠️

Remember to keep your watermark profiles updated for each content. Fastevo MP2 may occasionally choose to reprocess content, and when it does, it will apply the latest watermark configuration present for that content. To avoid any discrepancies, ensure that your watermark profiles are always current.

Watermark Configuration Fields

Regardless of the type of watermark, the configuration must include the following mandatory field:

  • type: The type of watermark. This field is mandatory for all watermarks. Currently, only text is supported.

In addition to the mandatory type field, the configuration can include the following optional fields:

  • opacity: The translucency of the watermark. The minimum opacity is 0.01 (almost transparent), and the maximum is 1.0 (completely opaque). The default value is 1.0.
  • padding: The blank space between the adjacent edges (determined by position) of the video and the watermark. The minimum padding is 0.0 (no padding), and the maximum is 1.0 (padded full video width or length). The default value is 0.05.
  • scale: The size of the watermark relative to the overall size of the video. This parameter will adapt to horizontal and vertical videos automatically. The minimum scale is 0.01 (almost invisible), and the maximum is 1.0 (fills the entire video). The default value is 0.3.
  • position: The location of the watermark. Valid positions are topRight, topLeft, bottomRight, bottomLeft, and center. The default value is bottomRight. Note that center will ignore the padding parameter.
ℹ️

Ensure the combined values of scale and padding don't exceed 1.0. For instance, a scale of 1.0 and padding of 0.05 will cut off part of the watermark, as it totals 105% coverage.

Text Watermarks

For text watermarks, in addition to the general configuration fields, the following fields are mandatory:

  • textContent: This is the text that will be displayed as the watermark. Fastevo MP2 supports Pango markup, allowing you to style your text. For example:
<span foreground="red">Red!</span><span background="cyan">blue</span>

For more information on Pango markup, refer to the Pango Markup Documentation (opens in a new tab).

  • font: This is the font of the text. In this guide, we will use "Roboto Medium". However, Fastevo MP2 supports a variety of fonts:
Roboto, Roboto Black, Roboto Black Italic, Roboto Bold, Roboto Bold Italic, Roboto Italic, Roboto Light, Roboto Light Italic, Roboto Medium, Roboto Medium Italic, Roboto Thin, Roboto Thin Italic, Super Funky

Creating or Modifying a Watermark Profile

To create or modify a watermark profile, make a POST request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/{profileName}

Replace {profileName} with the name of your watermark profile. The request body should contain the mandatory type, textContent, and font fields, along with any other optional fields you wish to include.

Here is an example of a request body:

{
  "type": "text",
  "textContent": "<span foreground='red'>This is a watermark</span>",
  "font": "Roboto Medium",
  "opacity": 0.5,
  "padding": 0.05,
  "scale": 0.3,
  "position": "bottomRight"
}

In this example, the watermark text is "This is a watermark" displayed in red color and "Roboto Medium" font. The watermark is semi-transparent (opacity 0.5), has a padding of 0.05, a scale of 0.3, and is positioned at the bottom right of the video.

ℹ️

If the watermark profile already exists, this endpoint will modify it. However, these changes will not apply to media contents that have already been prepared with the previous watermark profile. The changes will only apply when the content is reprocessed. For example, if you have content A with watermark profile A, and you modify watermark profile A, content A will still retain the original watermark profile A. If you want content A to have the modified watermark profile A, you would have to re-process content A.

⚠️

Fastevo MP2 might choose to reprocess the content at its discretion, so always ensure to have the correct watermark profiles in place and updated.

Listing Watermark Profiles with Pagination

To retrieve a list of watermark profiles with pagination, you need to perform a GET request to the following endpoint:

GET https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles

You can include query parameters such as page, limit, orderBy, order, and filter to customize the response.

Query Parameters

  • page (optional): The page number to retrieve.
  • limit (optional): The number of items per page.
  • orderBy (optional): The field to order by. Options are _id (creation date) and name.
  • order (optional): The order direction. Options are asc for ascending and desc for descending.
  • filter (optional): A string to filter the watermark profiles based on name.

API Response

The API will return a response with a status code of 200 and a JSON body containing the list of watermark profiles along with pagination details.

Example Response

{
  "currentPage": 1,
  "totalPages": 3,
  "totalRecords": 3,
  "data": [
    {
      "name": "TWM1",
      "isDefault": true
    }
  ]
}

Explanation of Response Fields

  • currentPage: The current page number.
  • totalPages: The total number of pages available.
  • totalRecords: The total number of watermark profile records.
  • data: An array of watermark profile objects, each containing:
    • name: The name of the watermark profile.
    • isDefault: A boolean indicating if the profile is the default one.

Ordering and Filtering

To order the watermark profiles by their creation date, you should query the order on _id. This represents a similar ordering to createdAt since the _id field is generated based on the creation time.

You can also use the filter query parameter to filter the watermark profiles based on the name.

Setting a Default Watermark Profile

You can set a watermark profile as the default for an MP2 project. This means that every future content in that project will inherit this watermark configuration.

ℹ️

If you change the default watermark profile for the project later, it will not affect the watermark for the content already created. For example, if you set watermark profile A as the default and create content A, content A will have watermark profile A. If you later change the project's default watermark profile to profile B, content A will still retain watermark profile A. To apply the new watermark profile B to content A, you would have to change the watermark for content A and then re-process that content.

To set a watermark profile as the default, make a PUT request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/{profileName}/default

Replace {profileName} with the name of your watermark profile.

Getting a Watermark Profile

To get the configuration of a watermark profile, make a GET request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/{profileName}

Replace {profileName} with the name of your watermark profile.

Getting the Default Watermark Profile

To get the name of the default watermark profile, make a GET request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/default

This will return the name of the default watermark profile. If you want to get the configuration of the default watermark profile, you will need to make a GET request to the watermark profile endpoint with the name of the default profile.

Removing a Default Watermark Profile

To remove a default watermark profile, make a DELETE request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/default

Deleting a Watermark Profile

You can delete a watermark profile by making a DELETE request to the following endpoint:

https://api.fastevo.net/api/v1/projects/mediaProtection/configurations/watermarkProfiles/{profileName}

Replace {profileName} with the name of your watermark profile.

If you delete a watermark assigned to some contents, the watermark configuration for those contents will be removed. When these contents are reprocessed, they will no longer have watermarks. To assign a new watermark, you would have to assign it to each content.

⚠️

Under certain circumstances, if you modify the watermark profile but do not reprocess the content, Fastevo MP2 might choose to retranscode the content at a later time. The watermark configuration present at that time would then apply.

Modifying Watermark Profile for Existing Content

To modify the watermark profile for an existing media content, use the following API endpoint. This allows you to assign a new watermark profile to specific content.

Endpoint

PUT /api/v1/projects/mediaProtection/contents/{contentId}/watermarkProfiles/{profileName}

Replace {contentId} with the ID of the media content for which you want to change the watermark profile, and {profileName} with the name of the new watermark profile to be applied.

Example Request

PUT /api/v1/projects/mediaProtection/contents/12345/watermarkProfiles/NewWatermarkProfile
ℹ️

After modifying the watermark profile, remember to reprocess the content to apply the new settings. See details on how to do this in Content Reprocessing.

Deleting Watermark Profile from Existing Content

To remove the watermark profile from an existing media content, use the following API endpoint:

Endpoint

DELETE /api/v1/projects/mediaProtection/contents/{contentId}/watermarkProfiles

Replace {contentId} with the ID of the media content from which you want to remove the watermark profile.

Example Request

DELETE /api/v1/projects/mediaProtection/contents/12345/watermarkProfiles
ℹ️

After deleting the watermark profile, it is crucial to reprocess the content to ensure the watermark is removed in the output. For guidance on reprocessing, refer to Content Reprocessing.