amazon-web-serviceshttp-live-streamingwebmaws-media-convert

Difference between playing webm vs HLS video over AWS


Im building an webapp which does screen recording, have it stored and played back on demand.

The recording is happening as .webm which is being streamed to S3 bucket via a multipart upload. I'm using AWS MediaConvert to convert .webm to HLS format for the video on demand. Problem is I need the video immediately available whereas the video conversion can take a few minutes.

Currently my approach is to provide .webm file for immediate viewing until the conversion happens after which the switch over is done to HLS.

Is this approach sound? What are the inherent drawbacks of this besides a higher bitrate and bandwidth considerations?

I don't want to switch to Amazon MediaLive unless it's absolutely essential.


Solution

  • As you initially alluded to, your current approach is a viable option however there are bandwidth and bitrate considerations to keep in mind. One potential caveat / 'gottcha' as well is that you may have to set the content type and disposition to "video/webm" and "inline" in order for the webm. file to be playable within the browser.

    Working with object metadata : https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html

    With that said, based on your use case, you may want to consider implementing an on-the-fly video conversion workflow.

    The example blogpost below details a serverless workflow for on-the-fly video conversion; From MP4 video source files stored in an Amazon S3 bucket to HTTP Live Streaming (HLS) served through Amazon CloudFront. The workflow uses Lambda@Edge function to invoke an AWS Elemental MediaConvert job.

    On-the-fly video conversion with Amazon CloudFront, Lambda@Edge, and AWS Elemental MediaConvert : https://aws.amazon.com/blogs/networking-and-content-delivery/on-the-fly-video-conversion-amazon-cloudfront-lambdaedge-mediaconvert/

    Points 5 - 8 are likely of more interest to you: