![]() ![]() ![]() Step 1: Compile MediaInfo for Amazon Linux The rest of this post shows the steps necessary to create this workflow on AWS. The technical metadata is then stored in DynamoDB in XML format. Using MediaInfo, the Lambda function then extracts the technical metadata from the multimedia file.MediaInfo downloads the minimum bytes necessary of the multimedia file stored on S3. The Lambda function generates a S3 signed URL, which is passed as an input to MediaInfo.The LambdaMediaInfo Lambda function, which you create below, is executed.Using S3 event notifications, S3 triggers a Lambda function.A multimedia file is uploaded to an S3 bucket.The new workflow looks like the following diagram: In this post, I walk through how to compile MediaInfo for Lambda. Static compilation to include all dependencies into a single executable that runs in Lambda functions.XML export format for easier processing programmatically.An abundance of technical metadata information about the asset.Only parts of the file are downloaded, processed in memory, and never saved to disk. For example, MediaInfo processed a 1.6 GB video file in 2.5 seconds and the entire function only used 46 MB of memory. You can pass a simple URL as an input parameter and MediaInfo downloads only the necessary information from the file on S3 in order to get the technical metadata. Using MediaInfo has several significant benefits: MediaInfoĪ more elegant and less brittle solution uses MediaInfo, a popular free and open-source program that extracts technical metadata about media assets for many audio and video files. Finally, you may prefer to do all of the processing in memory, which decreases Lambda processing time and hence reduces your costs. Also, many customers prefer not to store their assets on the local temporary storage available with Lambda. It’s not immediately apparent which specific bytes to download from the head and the tail of the file. There are several issues with this process. A tool like ffprobe is then run against these concatenated bytes to extract the technical metadata. ![]() These downloaded bytes are then concatenated and saved to the Lambda temp storage. To accomplish this limited download, customers use a feature available in S3 called ranged gets that allows you to specify the bytes of a file to download. One typical solution downloads just the first few bytes from the head and tail of the file. If you download the entire file, you run into issues with either the limited temp space available to Lambda or run into the 300s timeout limit when dealing with long running functions.Ĭustomers have come up with inventive ways to get around these problems. You need a way to seamlessly download the minimum number of bytes from the file in order to extract the technical metadata. The extraction of technical metadata from the asset on S3 becomes the tricky part in this workflow. In this post, I walk you through the process of setting up a workflow to extract technical metadata from multimedia files uploaded to S3 using Lambda. When customers work with media assets like video and audio files on Amazon S3, there is a typical workflow where assets get uploaded to S3, S3 triggers an event for that upload, and that event triggers an AWS Lambda function, which can extract technical metadata from the asset on S3. The technical metadata may also be stored for indexing and fast retrieval in a database service like Amazon DynamoDB or Amazon RDS. The asset may be transcoded to a standard “house” format, resized, or have a quality check performed to make sure it is in an acceptable format. With technical metadata, customers can make intelligent decisions about what to do next in their workflow. For a video asset, technical metadata includes information such as video codec, audio codec, resolution, frame rate, aspect ratio, and a host of other very detailed technical information.
0 Comments
Leave a Reply. |