Created
May 17, 2016 17:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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