Skip to main content
Skip table of contents

Transcoding With VidiCoder [GL IG]

Motivation

Transcoding is the process of converting media files from one format to another format without changing the media’s duration. Transcoding usually creates and additional shape on the item where the source file is attached to.

In an Enterprise MAM Solution transcoding usually is orchestrated by VidiFlow workflows. Workflow tasks provided by VidiFlow allow specification of different input parameters to a VidiCore TRANSCODE job.

The following sections describe how VidiFlow’s workflow tasks pass on this information to VidiCore. This information can be used to create VidiCore TRANSCODE jobs directly on VidiCore’s API. However, we recommend to orchestrate this via VidiFlow’s workflow engine.

Specify Destination Storage

To start a transcoding job in VidiCore use this request:

POST /API/item/<itemId/transcode?tag=<destinationShapeTag>&storageId=<destinationStorageId>

The query parameter tag defines the transcoding profile to use. The query parameter storageId can be used to specify to which storage the transcoding result is written to.

This procedure works with a local transcoder as well with a transcoder in a VidiCore Server Agent (VSA).

To specify the transcoding resource that should execute the transcoding job use the query parameter resourceId.

Specify Destination File Name

For copy and move operations this can be achieved with the filename query parameter:

POST /API/storage/file/<fileId>/storage/<destinationStorageId>?filename=MyFilename.mxf

This call will copy the file <fileId> from its current storage to storage <destinationStorageId> and will use MyFilename.mxf as name for the file on the destination storage.

For other operations (e.g. transcoding, export) VidiCore doesn’t provide query parameters to specify the target filename. However, this can be achieved by using a file naming script on the destination storage:

CODE
PUT /API/storage/<destinationStorageId>/metadata/filenameScript

var filename = context.getFileId();
var jobMetadata = context.getJobMetadata();
if (jobMetadata != null && jobMetadata.get("vpmsDestinationFilename") != null) {
    logger.log("filename from metadata vpmsDestinationFilename ");
    var filename = jobMetadata.get("vpmsDestinationFilename ");
}
logger.log("Final filename " + filename);
filename;

The desired destination filename can then be specified with

POST /API/item/<itemId>/transcode?tag=<destinationShapeTag>&storageId=<destinationStorageId>&jobmetadata=vpmsDestinationFilename%3DMyFilename.mxf

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.