Support for jpg, bmp image files in Mediaconvert overlay

0

Regarding https://docs.aws.amazon.com/mediaconvert/latest/ug/requirements-for-the-overlay-file.html File type: Use .png or .tga.

Please clarify as to the limitation of only supporting these file types. We have internal requests to enable jpg, gif & bmp file types. Or Is there any work around that media convert can be enabled with a pre processing script to generate png out of these images

1 Answer
1
Accepted Answer

AWS Elemental MediaConvert currently exclusively supports .png and .tga file formats for overlays because these formats support transparency, which is essential for overlaying images on videos. On the other hand, JPEG, GIF, and BMP formats lack native transparency support.

To enable the use of JPG, GIF, and BMP files with MediaConvert, a potential workaround involves preprocessing these images to convert them into a compatible format such as .png or .tga.

Here's a high-level example of how you can achieve this using Amazon S3 and AWS Lambda:

  1. Image Upload: Whenever an image (JPEG, GIF, BMP) intended for overlaying is uploaded to a designated S3 bucket, it triggers an event.

  2. Lambda Function Trigger: This event triggers an AWS Lambda function, specifically designed to handle the image conversion process. The Lambda function's primary task is to convert the uploaded image into a .png file, which is supported by AWS MediaConvert for overlays. To perform the image conversion, you can employ an image processing library compatible with the runtime of your Lambda function, such as the Python Imaging Library (PIL) for Python runtime.

  3. Image Conversion: The Lambda function reads the image file from the S3 bucket, performs the necessary conversion to a .png image while striving to preserve the image quality, and writes back the converted .png file into the S3 bucket.

  4. MediaConvert Overlay: Subsequently, you can utilize the converted .png file as an overlay with AWS MediaConvert.

By implementing this workaround, you automate the conversion process for unsupported file types into a format compatible with AWS MediaConvert for overlays.

profile picture
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions