PUT Re encode Video
Overview
The following table contains important information about the PUT method in regards to reencode a video.
| PUT Method | |
|---|---|
| Method | PUT |
| URL or Endpoint | /api/projects/projectId/encodes/videoId |
| Headers | Authorization |
| Parameters | videoId, projectId |
| Body | downloadUrl |
The description of the URL parameter is as follows:
| videoId Parameter | |
|---|---|
| URL Parameter Name | videoId |
| Mandatory | Yes |
| Type | string |
| Description | Unique Id of the video. |
| projectId Parameter | |
|---|---|
| URL Parameter Name | projectId |
| Mandatory | Yes |
| Type | string |
| Description | Unique Id of the project. |
Request Body
{
"downloadUrl": "downloadUrl",
"callBackUrl": "callBackUrl",
"hasDrm": true,
"generateThumbnail": true,
"folderId": 0,
"encodingTemplateId": 0,
"videoVisibilityOptionId": 0,
"uploadFileDetailsId": 0,
"previewRequested": false,
"previewSeconds": 0,
"priority": 0
}
For more information about visibility options, please visit the Visibility Options API
The description of the parameters is as follows:
| Body Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
| downloadUrl | Yes | string | The URL of the video that will be encoded. |
| callBackUrl | No | string | The URL where the encoding status will be sent. |
| hasDrm | No | boolean | Specifies whether the video has DRM protection. |
| generateThumbnail | No | boolean | Specifies whether a thumbnail should be generated for the video. |
| folderId | No | integer | The ID of the folder where the video will be saved. |
| encodingTemplateId | No | integer | The ID of the encoding template to be used. |
| videoVisibilityOptionId | No | integer | The visibility option ID for the video. |
| uploadFileDetailsId | No | integer($int32) | The ID of upload file details. |
| previewRequested | No | boolean | Determines whether preview video should be generated. |
| previewSeconds | No | integer($int32) | Duration of the preview in seconds. Required and must be greater than zero when previewRequested is true. |
| priority | No | integer or null | Encoding priority of the video. 0 for Normal and 1 for High. When omitted or null, the video is encoded with normal priority. See Encoding Priority below. |
Response
{
"success": true,
"errors": [],
"messages": [],
"result": {
"name": "name",
"originalFile": "originalFile"
},
"resultInfo": null,
"statusCode": 200
}
Information about the fields that appear when you receive the response are displayed in the table below.
| Field Name | Type | Description |
|---|---|---|
| success | bool | If the response is successful it will return true. Otherwise will return false. |
| errors | array[string] | Indicates if there was an error. |
| messages | array[string] | Returns the response message from back-end. |
| result | object | Returns the response object. |
| name | string | Returns the unique name of the encoded video. |
| originalFile | string | Returns the original file of the video. |
| resultInfo | string | Returns extra information about the result. |
| statusCode | integer($int32) | Returns the HTTP Status Code. |
If the action is successful, the service sends back an HTTP 200 or 201 response.
Errors
For information about the errors that are common to all actions, see Common Errors:
HTTP Status Code 400: Bad Request
HTTP Status Code 401: Unauthorized
HTTP Status Code 403: Forbidden
HTTP Status Code 404: Result Not Found
HTTP Status Code 500: Internal Server Error
HTTP Status Code 503: Backend Fetch Failed
Encoding Priority
The optional priority field controls how soon the video is picked up by the encoding fleet. High priority videos are placed ahead of normal ones in the encoding queue, and their playable quality is produced first, so playback becomes available sooner.
| Value | Name | Behavior |
|---|---|---|
0 | Normal | Default. The video is encoded in the standard queue order. |
1 | High | The video is encoded ahead of normal priority videos. |
Each re-encode is evaluated on its own — the priority of a previous encode of the same video is not carried over, so it must be supplied again on every request that needs it.
High priority must be enabled for your project before it takes effect. If your project does not have it enabled, the request still succeeds and the video is re-encoded with normal priority — the response messages array explains that the requested priority was not applied:
{
"success": true,
"errors": [],
"messages": [
"High priority encoding is not enabled for this project. The video will be encoded with normal priority."
],
"result": {
"name": "{name}",
"originalFile": "{originalFile}"
},
"resultInfo": null,
"statusCode": 200
}
A priority value other than 0 or 1 is rejected with an HTTP 400 Bad Request.
To have high priority encoding enabled for your project, contact GjirafaTech support.
The available priority values can also be retrieved from the Encoding Priorities endpoint.