AWS Transcode

QName: f:aws-transcode

Applying this feature allows a piece of content's default attachment to be automatically transcoded from one filetype to one or more other filetypes. This is done to the specification of custom or AWS predefined presets.

Once a transcoding is finished, an array of S3 paths for the transcoded files will be saved back to the content.

To use this feature, you will need to have an AWS account with S3 and Amazon Elastic Transcoder setup. You will also need to configure an S3 bucket for the files to be written to, and create a transcoder pipeline to run the transcodings in.

To learn more about Amazon Elastic Transcoder, see: https://docs.aws.amazon.com/elastictranscoder/latest/developerguide/introduction.html

Configuration

Property Type Required Default Read-Only Description
serviceDescriptorId text false The ID or Key of the service descriptor to use.
pipelineId text true The ID of the Amazon Elastic Transcoder pipeline to use to perform transcodings.
presetIds text true An array of preset ids representing which transcodings should be performed for a given input. For example, a document with a video input could have several transcodings performed for different video resolutions.
property text false outputPaths Name of the property where the S3 paths of transcoded files will be written to on the document.

Create a Service Descriptor

To use this feature, you will first need to declare a Service within Cloud CMS. Go to the Manage Platform > Services page and then click Create a New Service.

Given the service any Title and unique Key that you'd like.

The type should be aws_transcode and the configuration should look like this:

{
    "accessKey": "",
    "secretKey": "",
    "region": "",
    "bucketName": ""
}

Save your service. That's all there is to it.

Apply the Feature to your Definition

As with all features, you can apply them at either the instance or the type level.

Suppose you have a content type called Video which stores information related to video content on a website. It might look like this:

{
    "title": "Video",
    "_qname": "my:video",
    "properties": {
        "title": {
            "title": "Title",
            "type": "string"
        },
        "description": {
            "title": "Description",
            "type": "string"
        }        
    }
}

Each video instance would have a video attachment. We would then add the f:aws-transcode feature to the content type like this:

{
    "title": "Video",
    "_qname": "my:video",
    "properties": {
        "title": {
            "title": "Title",
            "type": "string"
        },
        "description": {
            "title": "Description",
            "type": "string"
        }        
    },
    "mandatoryFeatures": {
        "f:aws-transcode": {
            "pipelineId": "P1P3L1N31D",
            "presetIds": ["1351620000001-000001", "1351620000001-000010"],
            "property": "outputs"
        }
    }
}

We could then create a piece of Video content like so:

{
    "title": "My video",
    "description": "This is a good video"
}

With a full resolution mp4 attachment. After a time, the content will be updated behind the scenes with the results of the transcodings, and look something like this:

{
    "title": "My video",
    "description": "This is a good video",
    "outputs": [
        "<filename1>.mp4",
        "<filename2>.mp4"
    ]
}