As stated in the title, nothing in their API seems to provide a list of encoded files after a job is complete, crucial in case of HLS encoding since I need to move them from S3 to another cloud provider.
Asked
Active
Viewed 363 times
1 Answers
0
MediaConvert emits CloudWatch Events [1] for job status changes. You can implement this workflow by capturing jobs that go into a COMPLETE status and triggering a lambda function to gather required S3 paths. The COMPLETE CloudWatch event provide you the playlistFilePaths
and outputFilePaths
that will contain the S3 path your main and variant playlist.
CloudWatch event pattern to capture all completed jobs.
{
"source": [
"aws.mediaconvert"
],
"detail": {
"status": [
"COMPLETE"
]
}
}
An example for the CloudWatch event payload can be found in the documentation [1]
== Resources ==
[1] https://docs.aws.amazon.com/mediaconvert/latest/ug/apple-hls-group.html

jjohn
- 233
- 1
- 3
-
It's almost the way, it does work with single encoded files, but not when there are multiple files in the output (HLS and other transcode), it's just outputting the main .m3u8 file – yemd May 06 '21 at 03:44
-
You can parse the path for outputFilePaths per each variant, and find the directory where all the segments live. For example, you have a job that has the following: Destination: s3://bucket/123/main Output 1: name modifier /1/v1 Output 2: name modifier /2/v2 Your outputDetails would look like "outputFilePaths": [ "s3://bucket/123/main/1/v1.m3u8"], "outputFilePaths": [ "s3://bucket/123/main/2/v2.m3u8" ], You could then just list keys for bucket/123/main/1/ and get all the segments for that variant. Repeat for the second outputFilePaths – jjohn May 06 '21 at 22:48