use of com.amazonaws.services.elastictranscoder.model.Pipeline 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);
}
}
Aggregations