有什么方法可以安全地在浏览器中显示视频 [英] Is any way that is safe to display videos in a browser

查看:205
本文介绍了有什么方法可以安全地在浏览器中显示视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以安全地在浏览器中显示视频,
Like,他的一项安全措施是,无法下载视频
谢谢

解决方案

我认为你的意思是说你不希望你的视频被下载或复制?

如果是这样的话或多或少不可能阻止人们下载视频 - 即使是像YouTube这样的大型供应商,也有很多工具可供下载。

因此,最常采用的方法是加密视频并使用HTML5的加密媒体扩展(EME)来处理安全播放 - 基本上支持视频上的DRM。



如果您只想设置一个基本屏障来阻止临时用户复制视频,然后MPEG DASH'clearkey'加密或HLS AES加密可能足以满足您的需求 - 大多数大型内容所有者认为这些并不健全,但可能适用于简单用途。

您可以使用ffmpeg和openssl创建AES加密的HLS流 - ffmpeg文档( http://ffmpeg.org/ffmpeg-all.html# Options-34 )包括这个示例脚本:


$ b

 #!/ bin / sh 
BASE_URL = $ {1: - '。'}
openssl rand 16> file.key
echo $ BASE_URL / file.key> file.keyinfo
echo file.key>> file.keyinfo
echo $(openssl rand -hex 16)>> file.keyinfo
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
-hls_key_info_file file.keyinfo out.m3u8

您也可以使用mp4Box( https://gpac.wp.imt.fr/mp4box/encryption/common-encryption/ )创建基本的清除DASH加密:


MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4


drm info包含在drm_file.xml中,并在上面的链接中解释。


Is any way that is safe to display videos in a browser, Like, one of his security things, the video cannot be downloaded thanks

解决方案

I think you mean that you don't want your video to be downloaded or copied?

If so then it is more or less impossible to stop people downloading the video - there are many tools available to download even from big providers like YouTube.

So the approach most take is to encrypt the video and use HTML5's Encrypted Media Extension (EME) to handle secure playback - basically support DRM on the video.

If you just want to put a basic barrier to stop casual users copying the video then MPEG DASH 'clearkey' encryption or HLS AES encryption may be sufficient for your needs - these are not considered robust by most large content owners, but may be fine for simple use.

You can use ffmpeg and openssl to create an AES encrypted HLS stream - the ffmpeg documentation (http://ffmpeg.org/ffmpeg-all.html#Options-34) includes this example script:

#!/bin/sh
BASE_URL=${1:-'.'}
openssl rand 16 > file.key
echo $BASE_URL/file.key > file.keyinfo
echo file.key >> file.keyinfo
echo $(openssl rand -hex 16) >> file.keyinfo
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  -hls_key_info_file file.keyinfo out.m3u8

You can also use mp4Box (https://gpac.wp.imt.fr/mp4box/encryption/common-encryption/) to create basic clear DASH encryptions:

MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4

The drm info is included in the drm_file.xml and is explained at the link above.

这篇关于有什么方法可以安全地在浏览器中显示视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆