[英]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.我正在构建一个 web 应用程序,它可以进行屏幕录制、存储和按需播放。
The recording is happening as .webm which is being streamed to S3 bucket via a multipart upload.录制以 .webm 的形式发生,该 .webm 通过分段上传流式传输到 S3 存储桶。 I'm using AWS MediaConvert to convert .webm to HLS format for the video on demand.
我正在使用 AWS MediaConvert 将 .webm 转换为 HLS 格式的视频点播。 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.目前我的方法是提供 .webm 文件以供立即查看,直到发生转换,然后切换到 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.除非绝对必要,否则我不想切换到 Amazon MediaLive。
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.
一个潜在的警告/“gottcha”是您可能必须将内容类型和处置设置为“video/webm”和“inline”才能使用 webm。 file to be playable within the browser.
文件可以在浏览器中播放。
Working with object metadata : https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html使用对象元数据: 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.
从存储在 Amazon S3 存储桶中的 MP4 视频源文件到通过 Amazon CloudFront 提供的 HTTP Live Streaming (HLS)。 The workflow uses Lambda@Edge function to invoke an AWS Elemental MediaConvert job.
该工作流使用 Lambda@Edge 函数来调用 AWS Elemental MediaConvert 作业。
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/使用 Amazon CloudFront、Lambda@Edge 和 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:第 5 - 8 点您可能更感兴趣:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.