简体   繁体   English

如何正确处理AWS,CLoudFront视频流?

[英]how to handle properly AWS , CLoudFront Video streaming?

Sorry if question us duplicate I can't seem to find answers to my questions . 对不起,如果我们重复提问,我似乎无法找到问题的答案。 Using s3 and cloudfront to stream videos for web project using Laravel . 使用s3和cloudfront通过Laravel为Web项目流式传输视频。 Objects in bucket are private . 存储桶中的对象是私有的。

Bucket policy 铲斗政策

{
"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
    {
        "Sid": "1",
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ENE98C17OQICY"
        },
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::bucket_name/*"
    }
  ]
}

What we want to achieve is to send content partially , chunk-by-chunk from cloudfront but it seems to be just streaming the hall video with one request . 我们想要实现的是从Cloudfront逐块地部分发送内容,但似乎只是通过一个请求流式传输大厅视频。

Also I was wandering if it is impossible to prevent video downloading from user side even with cloudfronts partial content delivery? 我是否还在徘徊,即使有云的部分内容交付也无法阻止从用户端下载视频?

The main question what time shall I send as expiry date ? 主要问题是我应在什么时候发送到期日? Videos have different duration's. 视频的时长不同。 A video might be 60 second , the next one 150 seconds . 视频可能是60秒,接下来的是150秒。 Shall I set it individually per video ? 我可以为每个视频单独设置吗? or there is optimal solution ? 还是有最佳解决方案?

As after expiry has expired users can't watch the videos without refresh . 由于到期后,用户无法刷新就无法观看视频。

Thanks and sorry if this is duplicate I can not really figure this puzzle . 谢谢,如果这是重复的,对不起,我真的无法弄清楚这个难题。

If you want to stream your video chunk-by-chunk you need to first process your video to convert it to HLS or Dash. 如果要逐块流式传输视频,则需要先处理视频以将其转换为HLS或Dash。

You can use AWS Media Convert or AWS elastic transcoder to do so. 您可以使用AWS Media Convert或AWS弹性代码转换器来执行此操作。

If you want to quickly experiment with both protocole, I recommend you to deploy this cloudformation template : https://aws.amazon.com/answers/media-entertainment/live-streaming/ 如果您想快速尝试两种协议,建议您部署以下cloudformation模板: https ://aws.amazon.com/answers/media-entertainment/live-streaming/

So every time a video (mp4) will be deployed in the the s3 source bucket media convert will process it, save it to s3 destination bucket and finally update dynamoDB with the correct Cloudfront URL for Dash and HLS playlist. 因此,每次将视频(mp4)部署到s3源存储桶中时,媒体转换都会对其进行处理,将其保存到s3目标存储桶中,并最终使用Dash和HLS播放列表的正确Cloudfront URL更新dynamoDB。

Answering ' Also I was wandering if it is impossible to prevent video downloading from user side even with cloudfronts partial content delivery? 回答' 同样,我是否还在徘徊,即使有云内容交付,也无法阻止从用户端下载视频? '. ”。

The answer is basically, no, I'm afraid. 答案基本上是,不,恐怕。

If the user can play the video then they can make a copy of the stream, even if you make it difficult via authenticated URL's etc. 如果用户可以播放视频,那么即使您通过经过身份验证的URL等很难,他们也可以复制该流。

The usual approach to fight this is to encrypt the file so that even if they do copy it they can't play it without the encryption key. 解决此问题的常用方法是对文件进行加密,这样即使他们复制了文件,也没有加密密钥也无法播放文件。

The next problem is then passing the key securely from the server to the client - this is one of the main functions that DRM systems bring. 然后,下一个问题是将密钥从服务器安全地传递到客户端-这是DRM系统带来的主要功能之一。

Higher security levels of DRM will ensure the video path is never exposed to the application or even the OS, using a secure media path which essentially places the decrypted video in secure memory and renders it directly form there. 更高的DRM安全级别将使用安全的媒体路径来确保视频路径永远不会暴露给应用程序或操作系统,该路径本质上是将解密的视频放置在安全的内存中并直接将其呈现在其中。

Of course, after all this someone can still point a high quality camera at the screen and, if your video is available in high resolution, get a reasonable copy. 当然,毕竟,有人仍可以将高质量的相机对准屏幕,并且,如果您的视频具有高分辨率,则可以获取合理的副本。 This is why forensic (invisible) watermarking for tracing is becoming more prominent. 这就是为什么用于跟踪的法证(不可见)水印变得越来越突出的原因。

Ultimately, media security is usually about cost vs benefit - ie having enough hurdles that it is not worth someone's while going to the effort to copy it. 归根结底,媒体安全通常是成本与收益之间的关系,即,在进行复制时,有足够的障碍使其不值得别人去做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM