Class ElasticTranscoderImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v1.aws.elastictranscoder.ElasticTranscoderImpl
-
- All Implemented Interfaces:
ElasticTranscoder
public class ElasticTranscoderImpl extends Object implements ElasticTranscoder
Default implementation ofElasticTranscoder
. Just as indicated by the interface, the video file is first uploaded to the S3 input bucket of the AWS Elastic Transcoder pipeline, but before uploading, a unique bucket key is generated so that there's no issue when a file with the same filename is uploaded several times. In this way all video file versions (original or transcoded) are kept at all times and there's no downtime when a file is transcoded again.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected int
partSize
-
Constructor Summary
Constructors Constructor Description ElasticTranscoderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.amazonaws.services.elastictranscoder.model.CreateJobResult
createJob(String inputKey, String baseKey, TranscoderProfile profile, com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder transcoderClient)
protected TranscoderJob
createResult(String baseKey, com.amazonaws.services.elastictranscoder.model.CreateJobResult jobResult, com.amazonaws.services.elastictranscoder.model.Pipeline pipeline)
protected com.amazonaws.services.elastictranscoder.model.CreateJobOutput
getCreateJobOutput(String baseKey, TranscoderOutput output)
protected com.amazonaws.services.elastictranscoder.model.CreateJobRequest
getCreateJobRequest(String inputKey, String baseKey, TranscoderProfile profile)
protected com.amazonaws.services.elastictranscoder.model.Pipeline
getPipeline(String pipelineId, com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder client)
protected com.amazonaws.services.s3.AmazonS3
getS3Client(TranscoderProfile profile)
protected com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder
getTranscoderClient(TranscoderProfile profile)
void
setPartSize(int partSize)
TranscoderJob
startJob(String filename, InputStream content, TranscoderProfile profile)
Starts a transcoder job for the specified file, based on the givenTranscoderProfile
.protected void
uploadInput(String inputKey, String filename, InputStream content, com.amazonaws.services.elastictranscoder.model.Pipeline pipeline, com.amazonaws.services.s3.AmazonS3 s3Client)
-
-
-
Method Detail
-
setPartSize
public void setPartSize(int partSize)
-
startJob
public TranscoderJob startJob(String filename, InputStream content, TranscoderProfile profile) throws AwsException
Description copied from interface:ElasticTranscoder
Starts a transcoder job for the specified file, based on the givenTranscoderProfile
. It first uploads the file to the input bucket in S3 before the job is created.- Specified by:
startJob
in interfaceElasticTranscoder
- Parameters:
filename
- the video's file namecontent
- the file of the videoprofile
- the transcoding profile- Returns:
- the metadata of the transcoder job. It's important to point out that returning the job info doesn't mean that the job has been completed. To monitor the progress of the job the returned job ID can be used.
- Throws:
AwsException
- if an error occurred
-
getPipeline
protected com.amazonaws.services.elastictranscoder.model.Pipeline getPipeline(String pipelineId, com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder client)
-
uploadInput
protected void uploadInput(String inputKey, String filename, InputStream content, com.amazonaws.services.elastictranscoder.model.Pipeline pipeline, com.amazonaws.services.s3.AmazonS3 s3Client) throws AwsException
- Throws:
AwsException
-
createJob
protected com.amazonaws.services.elastictranscoder.model.CreateJobResult createJob(String inputKey, String baseKey, TranscoderProfile profile, com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder transcoderClient)
-
createResult
protected TranscoderJob createResult(String baseKey, com.amazonaws.services.elastictranscoder.model.CreateJobResult jobResult, com.amazonaws.services.elastictranscoder.model.Pipeline pipeline)
-
getS3Client
protected com.amazonaws.services.s3.AmazonS3 getS3Client(TranscoderProfile profile)
-
getTranscoderClient
protected com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder getTranscoderClient(TranscoderProfile profile)
-
getCreateJobRequest
protected com.amazonaws.services.elastictranscoder.model.CreateJobRequest getCreateJobRequest(String inputKey, String baseKey, TranscoderProfile profile)
-
getCreateJobOutput
protected com.amazonaws.services.elastictranscoder.model.CreateJobOutput getCreateJobOutput(String baseKey, TranscoderOutput output)
-
-