A RESTful API operation is available to remotely start the video re-encoding process for an item in the library or a sequence.
RESTful re-encoding endpoint:
/rest-api/v1/op/reencode- Start video re-encoding.
An object containing the
blobId must be POSTed to the endpoint.
itemId is the sequence or item identifier and
blobId is the BLOB identifier referring to the video resource that requires re-encoding.
Example POST to start re-encoding
When re-encoding a library item, the
blobId can be omitted. The largest video resource within the library item will be re-encoded. To find the
blobId of a recently uploaded or imported video it will be necessary to query the library item or sequence using the REST API after uploading or importing is complete. Alternatively the BLOB ID can be constructed using the MD5 and size of the raw uploaded data.
Re-encode server response
A server will respond with an object containing a
pendingId is a datasource reference that can be used to query the status of the asynchronous re-encoding operation. Typically this will be of the format
Query the status of re-encoding
The re-encoding process progress is visible in the administration interface as a progress bar over the item. It can also be queried using a REST call to the datasource endpoint.
RESTful datasource endpoint:
/rest-api/v1/datasource/[PENDING-ID]- GET the status of the re-encoding operation.
Datasource server response
The re-encoding process progress can be found by reading the
blobProcessingProgress within the data object of the response. This will be a percentage value from 0 to 100.
When re-encoding is complete, the new video resource will be transferred to its final storage locations. This process can also be monitored using the datasource API. When re-encoding is complete the data object will contain
redirect. This refers to another datasource.
Query this datasource to find the
progress (bytes transferred to our server) and
blobDeployProgress (bytes transferred to final storage locations).
The datasource API requires addresses in the query to be encoded to protect special characters it may contain.
/rest-api/v1/datasource?uri=[URL-ENCODED-REDIRECT]- GET the deployment status of the re-encoded video.
When re-encoding and deployment is complete, the datasource will include a
snapshot object. The snapshot contain a list of the resources resultant from the re-encoding process including the new
blobId that refers to the re-encoded video.
Please note that the original video will remain in the item but will no longer be enabled or transferred to devices.
Advanced encoding options
Advanced video encoding options can be passed through to the re-encoding service. Add options to the request:
The platform uses Zencoder to perform video re-encoding. The following options will be passed through to this service: