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 of ElasticTranscoder. 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 Details

    • partSize

      protected int partSize
  • Constructor Details

    • ElasticTranscoderImpl

      public ElasticTranscoderImpl()
  • Method Details

    • 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 given TranscoderProfile. It first uploads the file to the input bucket in S3 before the job is created.
      Specified by:
      startJob in interface ElasticTranscoder
      Parameters:
      filename - the video's file name
      content - the file of the video
      profile - 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 software.amazon.awssdk.services.elastictranscoder.model.Pipeline getPipeline(String pipelineId, software.amazon.awssdk.services.elastictranscoder.ElasticTranscoderClient client)
    • uploadInput

      protected void uploadInput(String inputKey, String filename, InputStream content, software.amazon.awssdk.services.elastictranscoder.model.Pipeline pipeline, software.amazon.awssdk.services.s3.S3Client s3Client) throws AwsException
      Throws:
      AwsException
    • createJob

      protected software.amazon.awssdk.services.elastictranscoder.model.CreateJobResponse createJob(String inputKey, String baseKey, TranscoderProfile profile, software.amazon.awssdk.services.elastictranscoder.ElasticTranscoderClient transcoderClient)
    • createResult

      protected TranscoderJob createResult(String baseKey, software.amazon.awssdk.services.elastictranscoder.model.CreateJobResponse jobResponse, software.amazon.awssdk.services.elastictranscoder.model.Pipeline pipeline)
    • getS3Client

      protected software.amazon.awssdk.services.s3.S3Client getS3Client(TranscoderProfile profile)
    • getTranscoderClient

      protected software.amazon.awssdk.services.elastictranscoder.ElasticTranscoderClient getTranscoderClient(TranscoderProfile profile)
    • getCreateJobRequest

      protected software.amazon.awssdk.services.elastictranscoder.model.CreateJobRequest getCreateJobRequest(String inputKey, String baseKey, TranscoderProfile profile)
    • getCreateJobOutput

      protected software.amazon.awssdk.services.elastictranscoder.model.CreateJobOutput getCreateJobOutput(String baseKey, TranscoderOutput output)