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