Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,11 @@ public static String createMediaJob(MediaConvertClient mc, String mcRoleARN, Str

try {
// snippet-start:[mediaconvert.java.createjob.getendpointurl]
DescribeEndpointsResponse res = mc
.describeEndpoints(DescribeEndpointsRequest.builder().maxResults(20).build());

if (res.endpoints().size() <= 0) {
System.out.println("Cannot find MediaConvert service endpoint URL!");
System.exit(1);
}
String endpointURL = res.endpoints().get(0).url();
System.out.println("MediaConvert service URL: " + endpointURL);
System.out.println("MediaConvert role arn: " + mcRoleARN);
System.out.println("MediaConvert input file: " + fileInput);
System.out.println("MediaConvert output path: " + s3path);
// snippet-end:[mediaconvert.java.createjob.getendpointurl]

MediaConvertClient emc = MediaConvertClient.builder()
.region(Region.US_WEST_2)
.endpointOverride(URI.create(endpointURL))
.build();

// output group Preset HLS low profile
Output hlsLow = createOutput("hls_low", "_low", "_$dt$", 750000, 7, 1920, 1080, 640);
// output group Preset HLS media profile
Expand Down Expand Up @@ -369,7 +355,7 @@ public static String createMediaJob(MediaConvertClient mc, String mcRoleARN, Str
.settings(jobSettings)
.build();

CreateJobResponse createJobResponse = emc.createJob(createJobRequest);
CreateJobResponse createJobResponse = mc.createJob(createJobRequest);
return createJobResponse.job().id();

} catch (MediaConvertException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,11 @@ public static void main(String[] args) {

public static void getSpecificJob(MediaConvertClient mc, String jobId) {
try {
DescribeEndpointsResponse res = mc.describeEndpoints(DescribeEndpointsRequest.builder()
.maxResults(20)
.build());

if (res.endpoints().size() <= 0) {
System.out.println("Cannot find MediaConvert service endpoint URL!");
System.exit(1);
}
String endpointURL = res.endpoints().get(0).url();
MediaConvertClient emc = MediaConvertClient.builder()
.region(Region.US_WEST_2)
.endpointOverride(URI.create(endpointURL))
.build();

GetJobRequest jobRequest = GetJobRequest.builder()
.id(jobId)
.build();

GetJobResponse response = emc.getJob(jobRequest);
GetJobResponse response = mc.getJob(jobRequest);
System.out.println("The ARN of the job is " + response.job().arn());

} catch (MediaConvertException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,14 @@ public static void main(String[] args) {

public static void listCompleteJobs(MediaConvertClient mc) {
try {
DescribeEndpointsResponse res = mc.describeEndpoints(DescribeEndpointsRequest.builder()
.maxResults(20)
.build());

if (res.endpoints().size() <= 0) {
System.out.println("Cannot find MediaConvert service endpoint URL!");
System.exit(1);
}

String endpointURL = res.endpoints().get(0).url();
MediaConvertClient emc = MediaConvertClient.builder()
.region(Region.US_WEST_2)
.endpointOverride(URI.create(endpointURL))
.build();

// Create the ListJobsRequest
ListJobsRequest jobsRequest = ListJobsRequest.builder()
.maxResults(10)
.status("COMPLETE")
.build();

ListJobsResponse jobsResponse = emc.listJobs(jobsRequest);
// Call the listJobs operation
ListJobsResponse jobsResponse = mc.listJobs(jobsRequest);
List<Job> jobs = jobsResponse.jobs();
for (Job job : jobs) {
System.out.println("The JOB ARN is : " + job.arn());
Expand Down
Loading