Question

My simple question is how to set the preset when we create a job. I am using aws sdk for java. I am learning Elastic Transcoder web service. For the same I could not find any tutorial on net, so I had to venture on my own. But I am stuck at this point. Following is the code -

public void createJob () {
    final CreateJobRequest createJobRequest = new CreateJobRequest();
    createJobRequest.setPipelineId(createPipelineResult.getPipeline().getId());
    createJobRequest.setOutputKeyPrefix("transcoded.mp3");
    amazonElasticTranscoderClient.createJob(createJobRequest);
}  

This part comes under "Output Details" if we go from the UI. So my guess is we can set it using the setOutput(CreateJobOutput) method of CreateJobRequest class, but I am not able to find a suitable way. Any help is appreciated.

Was it helpful?

Solution

AWS Transcoder already has some presets created for us to use. You can check if any of those suits your need, if not then you'll have to create your own preset using CreatePresetRequest.

Once you have the preset, you'll have to set it in job output object. Following is the pseudo code :

CreateJobOutput jobOutput = new CreateJobOutput();

jobOutput.setPresetId("1351620000001-000001");//can use already created presets jobReq.setOutput(jobOutput);

jobReq is the CreateJobRequest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top