Search in sources :

Example 1 with CreateJobResult

use of com.amazonaws.services.elastictranscoder.model.CreateJobResult in project studio by craftercms.

the class ElasticTranscoderImpl method startJob.

@Override
public TranscoderJob startJob(String filename, InputStream content, TranscoderProfile profile) throws AwsException {
    try {
        AmazonS3 s3Client = getS3Client(profile);
        AmazonElasticTranscoder transcoderClient = getTranscoderClient(profile);
        Pipeline pipeline = getPipeline(profile.getPipelineId(), transcoderClient);
        String baseKey = FilenameUtils.removeExtension(filename) + "/" + UUID.randomUUID().toString();
        String inputKey = baseKey + "." + FilenameUtils.getExtension(filename);
        uploadInput(inputKey, filename, content, pipeline, s3Client);
        CreateJobResult jobResult = createJob(inputKey, baseKey, profile, transcoderClient);
        return createResult(baseKey, jobResult, pipeline);
    } catch (Exception e) {
        throw new AwsException("Error while attempting to start an AWS Elastic Transcoder job for file " + filename, e);
    }
}
Also used : AmazonS3(com.amazonaws.services.s3.AmazonS3) CreateJobResult(com.amazonaws.services.elastictranscoder.model.CreateJobResult) AmazonElasticTranscoder(com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder) AwsException(org.craftercms.studio.api.v1.exception.AwsException) AwsException(org.craftercms.studio.api.v1.exception.AwsException) Pipeline(com.amazonaws.services.elastictranscoder.model.Pipeline)

Example 2 with CreateJobResult

use of com.amazonaws.services.elastictranscoder.model.CreateJobResult in project studio by craftercms.

the class ElasticTranscoderImpl method createJob.

protected CreateJobResult createJob(String inputKey, String baseKey, TranscoderProfile profile, AmazonElasticTranscoder transcoderClient) {
    CreateJobRequest jobRequest = getCreateJobRequest(inputKey, baseKey, profile);
    CreateJobResult jobResult = transcoderClient.createJob(jobRequest);
    return jobResult;
}
Also used : CreateJobResult(com.amazonaws.services.elastictranscoder.model.CreateJobResult) CreateJobRequest(com.amazonaws.services.elastictranscoder.model.CreateJobRequest)

Aggregations

CreateJobResult (com.amazonaws.services.elastictranscoder.model.CreateJobResult)2 AmazonElasticTranscoder (com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder)1 CreateJobRequest (com.amazonaws.services.elastictranscoder.model.CreateJobRequest)1 Pipeline (com.amazonaws.services.elastictranscoder.model.Pipeline)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 AwsException (org.craftercms.studio.api.v1.exception.AwsException)1