Skip to content

Instantly share code, notes, and snippets.

@sapher
Created May 17, 2016 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapher/0af2af8e396d258acffc1d8fa5e7e859 to your computer and use it in GitHub Desktop.
Save sapher/0af2af8e396d258acffc1d8fa5e7e859 to your computer and use it in GitHub Desktop.
Simple Snippet that show how to create a conversion job on AWS ElasticTranscoder
// Create ElasticTranscoderClient
AWSCredentials credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
AmazonElasticTranscoderClient client = new AmazonElasticTranscoderClient(credentials);
client.configureRegion(Regions.US_WEST_2);
// JobInput
JobInput jobInput = new JobInput();
jobInput.setKey(key); // name of the input object in your source S3
// Create JobOuput
CreateJobOutput jobOutput = new CreateJobOutput();
jobOutput.setPresetId(presetId); // MP3 @ 320 according to https://docs.aws.amazon.com/elastictranscoder/latest/developerguide/system-presets.html
jobOutput.setKey(key); // name of the output object in your dest S3
// Create JobRequest
CreateJobRequest jobRequest = new CreateJobRequest();
jobRequest.setInput(jobInput);
jobRequest.setOutput(jobOutput);
jobRequest.setPipelineId(pipelineId); // can be found on your AWS ElasticTranscoder console
// Send JobRequest
client.createJob(jobRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment