Skip to main content

PUT Re encode Video

Overview


The following table contains important information about the PUT method in regards to reencode a video.

PUT Method
MethodPUT
URL or Endpoint/api/projects/projectId/encodes/videoId
HeadersAuthorization
ParametersvideoId, projectId
BodydownloadUrl

The description of the URL parameter is as follows:

videoId Parameter
URL Parameter NamevideoId
MandatoryYes
Typestring
DescriptionUnique Id of the video.
projectId Parameter
URL Parameter NameprojectId
MandatoryYes
Typestring
DescriptionUnique 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
}
tip

For more information about visibility options, please visit the Visibility Options API

The description of the parameters is as follows:

Body Parameter NameMandatoryTypeDescription
downloadUrlYesstringThe URL of the video that will be encoded.
callBackUrlNostringThe URL where the encoding status will be sent.
hasDrmNobooleanSpecifies whether the video has DRM protection.
generateThumbnailNobooleanSpecifies whether a thumbnail should be generated for the video.
folderIdNointegerThe ID of the folder where the video will be saved.
encodingTemplateIdNointegerThe ID of the encoding template to be used.
videoVisibilityOptionIdNointegerThe visibility option ID for the video.
uploadFileDetailsIdNointeger($int32)The ID of upload file details.
previewRequestedNobooleanDetermines whether preview video should be generated.
previewSecondsNointeger($int32)Duration of the preview in seconds. Required and must be greater than zero when previewRequested is true.
priorityNointeger or nullEncoding 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 NameTypeDescription
successboolIf the response is successful it will return true. Otherwise will return false.
errorsarray[string]Indicates if there was an error.
messagesarray[string]Returns the response message from back-end.
resultobjectReturns the response object.
namestringReturns the unique name of the encoded video.
originalFilestringReturns the original file of the video.
resultInfostringReturns extra information about the result.
statusCodeinteger($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.

ValueNameBehavior
0NormalDefault. The video is encoded in the standard queue order.
1HighThe 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.

info

To have high priority encoding enabled for your project, contact GjirafaTech support.

tip

The available priority values can also be retrieved from the Encoding Priorities endpoint.