Transcoding Configurations
Fastevo MP2 allows you to configure various transcoding settings for your media protection project. These settings determine which video quality levels are enabled during transcoding, as well as other related options like storing original copies and image processing. This page describes how to retrieve and update these settings using the Fastevo MP2 API.
All transcoding configuration endpoints require authorization via the project API key. Ensure that the API key is sent as a Bearer token in the Authorization header.
Transcoding Configuration Fields
The transcoding configuration consists of the following fields:
-
Quality Settings:
For each available quality level, you can enable or disable transcoding. To see which qualities are available for your project, use the Available Qualities endpoint.For each quality, the configuration is an object with the following property:
isEnabled(boolean): Indicates if transcoding for that quality is enabled.
Important: When updating transcoding qualities, you can now send partial updates. Any quality not included in the request will automatically be set to
isEnabled: false. -
isStoringOriginalCopiesEnabled:
A boolean value that indicates whether the system should keep the original media copies after transcoding.- Default value: Depends on the initial project configuration.
-
isImageProcessingEnabled:
A boolean flag to enable or disable image processing.
Note: Only users with the admin role are allowed to update this setting.
Additionally, when updating quality settings, at least one quality must remain enabled; otherwise the API will reject the configuration with an error.
Retrieving Available Qualities
Endpoint
GET https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcoding/availableQualitiesDescription
Retrieve the list of transcoding qualities available for your project. This endpoint returns an array of quality options that can be configured. The available qualities may vary based on your project plan and organization settings.
Example Request
GET https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcoding/availableQualities
Authorization: Bearer <your_project_api_key>Example Response
{
"qualities": ["240p", "360p", "480p", "720p", "1080p", "1440p", "2160p"]
}Use this endpoint to dynamically determine which quality options to display in your application's UI, ensuring compatibility with your project's available features.
Retrieving Transcoding Configurations
Endpoint
GET https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcodingDescription
Retrieve the current transcoding settings for your project. The returned object will include each of the quality settings as well as flags for storing original copies and image processing.
Example Request
GET https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcoding
Authorization: Bearer <your_project_api_key>Example Response
{
"240p": { "isEnabled": true },
"360p": { "isEnabled": true },
"480p": { "isEnabled": true },
"720p": { "isEnabled": true },
"1080p": { "isEnabled": true },
"1440p": { "isEnabled": false },
"2160p": { "isEnabled": false },
"isStoringOriginalCopiesEnabled": false,
"isImageProcessingEnabled": false
}If the request is made without valid authorization, the API will return a 401 Unauthorized error.
Updating Transcoding Configurations
Endpoint
PATCH https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcodingDescription
Update the transcoding settings for your project. This endpoint supports modifying the following fields:
isStoringOriginalCopiesEnabled: Enable or disable storing original copies.isImageProcessingEnabled: Enable or disable image processing (admin only).- Quality configurations for any available resolution: You can send partial updates. Any quality not included in the request will be set to
isEnabled: false.
When updating quality settings, at least one quality must be enabled; otherwise, the endpoint will reject the request with a 400 error.
Example Request
PATCH https://api.fastevo.com/api/v1/projects/mediaProtection/configurations/transcoding
Authorization: Bearer <your_project_api_key>
{
"isStoringOriginalCopiesEnabled": true,
"720p": { "isEnabled": true },
"1080p": { "isEnabled": true },
"1440p": { "isEnabled": true }
}In this example, only 720p, 1080p, and 1440p are specified. All other available qualities will automatically be set to isEnabled: false.
Expected Behavior
-
Authorization Required:
The request must include a valid API key. If omitted, the endpoint returns a 401 error. -
Admin Restriction for Image Processing:
Regular users are not allowed to update theisImageProcessingEnabledfield. Attempting to change this value without admin privileges will result in an error. -
Quality Settings Check:
If all quality fields are disabled (either explicitly or by omission), the server will respond with a 400 error indicating that at least one quality must be enabled.
Example Error Response for All Qualities Disabled
{
"error": "At least one quality must be enabled."
}Only users with administrative privileges may update the image processing setting.
Partial updates are now supported for quality configurations. Any quality not included in your request will default to isEnabled: false, making it easier to enable specific qualities without listing all of them.
Behind the Scenes
The API internally calls the media protection service functions to update the settings:
setIsStoringOriginalCopiesEnabledForProject(projectId, isEnabled)setImageProcessingEnabledForProject(projectId, isEnabled)setTranscodingQualitiesForProject(projectId, qualitiesConfig)
Each service function performs additional validation and updates the transcoding configuration on the corresponding project extension.