Search in sources :

Example 1 with CreateJobOutput

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

the class ElasticTranscoderImpl method getCreateJobOutput.

protected CreateJobOutput getCreateJobOutput(String baseKey, TranscoderOutput output) {
    CreateJobOutput jobOutput = new CreateJobOutput();
    jobOutput.setPresetId(output.getPresetId());
    jobOutput.setKey(baseKey + output.getOutputKeySuffix());
    if (StringUtils.isNotEmpty(output.getThumbnailSuffixFormat())) {
        jobOutput.setThumbnailPattern(baseKey + output.getThumbnailSuffixFormat());
    }
    return jobOutput;
}
Also used : CreateJobOutput(com.amazonaws.services.elastictranscoder.model.CreateJobOutput)

Example 2 with CreateJobOutput

use of com.amazonaws.services.elastictranscoder.model.CreateJobOutput in project aws-doc-sdk-examples by awsdocs.

the class JobStatusNotificationsSample method createElasticTranscoderJob.

/**
 * Creates a job in Elastic Transcoder using the configured pipeline, input
 * key, preset, and output key prefix.
 * @return Job ID of the job that was created in Elastic Transcoder.
 * @throws Exception
 */
private static String createElasticTranscoderJob() throws Exception {
    // Setup the job input using the provided input key.
    JobInput input = new JobInput().withKey(INPUT_KEY);
    // Setup the job output using the provided input key to generate an output key.
    List<CreateJobOutput> outputs = new ArrayList<CreateJobOutput>();
    CreateJobOutput output = new CreateJobOutput().withKey(TranscoderSampleUtilities.inputKeyToOutputKey(INPUT_KEY)).withPresetId(PRESET_ID);
    outputs.add(output);
    // Create a job on the specified pipeline and return the job ID.
    CreateJobRequest createJobRequest = new CreateJobRequest().withPipelineId(PIPELINE_ID).withOutputKeyPrefix(OUTPUT_KEY_PREFIX).withInput(input).withOutputs(outputs);
    return amazonElasticTranscoder.createJob(createJobRequest).getJob().getId();
}
Also used : JobInput(com.amazonaws.services.elastictranscoder.model.JobInput) ArrayList(java.util.ArrayList) CreateJobOutput(com.amazonaws.services.elastictranscoder.model.CreateJobOutput) CreateJobRequest(com.amazonaws.services.elastictranscoder.model.CreateJobRequest)

Example 3 with CreateJobOutput

use of com.amazonaws.services.elastictranscoder.model.CreateJobOutput in project aws-doc-sdk-examples by awsdocs.

the class HlsJobCreationSample method createElasticTranscoderHlsJob.

/**
 * Creates a job which outputs an HLS playlist for adaptive bitrate playback.
 * @return Job that was created by Elastic Transcoder.
 * @throws Exception
 */
private static Job createElasticTranscoderHlsJob() throws Exception {
    // Setup the job input using the provided input key.
    JobInput input = new JobInput().withKey(INPUT_KEY);
    // Setup the job outputs using the HLS presets.
    String outputKey = TranscoderSampleUtilities.inputKeyToOutputKey(INPUT_KEY);
    CreateJobOutput hlsAudio = new CreateJobOutput().withKey("hlsAudio/" + outputKey).withPresetId(HLS_64K_AUDIO_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    CreateJobOutput hls0400k = new CreateJobOutput().withKey("hls0400k/" + outputKey).withPresetId(HLS_0400K_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    CreateJobOutput hls0600k = new CreateJobOutput().withKey("hls0600k/" + outputKey).withPresetId(HLS_0600K_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    CreateJobOutput hls1000k = new CreateJobOutput().withKey("hls1000k/" + outputKey).withPresetId(HLS_1000K_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    CreateJobOutput hls1500k = new CreateJobOutput().withKey("hls1500k/" + outputKey).withPresetId(HLS_1500K_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    CreateJobOutput hls2000k = new CreateJobOutput().withKey("hls2000k/" + outputKey).withPresetId(HLS_2000K_PRESET_ID).withSegmentDuration(SEGMENT_DURATION);
    List<CreateJobOutput> outputs = Arrays.asList(hlsAudio, hls0400k, hls0600k, hls1000k, hls1500k, hls2000k);
    // Setup master playlist which can be used to play using adaptive bitrate.
    CreateJobPlaylist playlist = new CreateJobPlaylist().withName("hls_" + outputKey).withFormat("HLSv3").withOutputKeys(hlsAudio.getKey(), hls0400k.getKey(), hls0600k.getKey(), hls1000k.getKey(), hls1500k.getKey(), hls2000k.getKey());
    // Create the job.
    CreateJobRequest createJobRequest = new CreateJobRequest().withPipelineId(PIPELINE_ID).withInput(input).withOutputKeyPrefix(OUTPUT_KEY_PREFIX + outputKey + "/").withOutputs(outputs).withPlaylists(playlist);
    return amazonElasticTranscoder.createJob(createJobRequest).getJob();
}
Also used : JobInput(com.amazonaws.services.elastictranscoder.model.JobInput) CreateJobPlaylist(com.amazonaws.services.elastictranscoder.model.CreateJobPlaylist) CreateJobOutput(com.amazonaws.services.elastictranscoder.model.CreateJobOutput) CreateJobRequest(com.amazonaws.services.elastictranscoder.model.CreateJobRequest)

Example 4 with CreateJobOutput

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

the class ElasticTranscoderImpl method getCreateJobRequest.

protected CreateJobRequest getCreateJobRequest(String inputKey, String baseKey, TranscoderProfile profile) {
    JobInput jobInput = new JobInput();
    jobInput.setKey(inputKey);
    List<CreateJobOutput> jobOutputs = new ArrayList<>(profile.getOutputs().size());
    for (TranscoderOutput output : profile.getOutputs()) {
        jobOutputs.add(getCreateJobOutput(baseKey, output));
    }
    CreateJobRequest jobRequest = new CreateJobRequest();
    jobRequest.setPipelineId(profile.getPipelineId());
    jobRequest.setInput(jobInput);
    jobRequest.setOutputs(jobOutputs);
    return jobRequest;
}
Also used : JobInput(com.amazonaws.services.elastictranscoder.model.JobInput) TranscoderOutput(org.craftercms.studio.api.v1.aws.elastictranscoder.TranscoderOutput) ArrayList(java.util.ArrayList) CreateJobOutput(com.amazonaws.services.elastictranscoder.model.CreateJobOutput) CreateJobRequest(com.amazonaws.services.elastictranscoder.model.CreateJobRequest)

Aggregations

CreateJobOutput (com.amazonaws.services.elastictranscoder.model.CreateJobOutput)4 CreateJobRequest (com.amazonaws.services.elastictranscoder.model.CreateJobRequest)3 JobInput (com.amazonaws.services.elastictranscoder.model.JobInput)3 ArrayList (java.util.ArrayList)2 CreateJobPlaylist (com.amazonaws.services.elastictranscoder.model.CreateJobPlaylist)1 TranscoderOutput (org.craftercms.studio.api.v1.aws.elastictranscoder.TranscoderOutput)1