我正在尝试使用用于视频的Clearkey加密示例这里。按照提到的这里步骤,我可以下载并构建加密工具wemb_crypt,但是当我尝试用
webm_crypt -i input.webm -o input-enc_bear1_0123456789012345.webm -video true -audio true -video_options content_id=0123456789012345,base_file=bear1.key -audio_options content_id=0123456789012345,base_file=bear1.key我知道这个错误
文件: input.webm不是WebM,file.Could不是打开WebM文件。
尝试了许多不同的webm文件却没有成功。
还有其他方法用其他工具加密密钥媒体吗?上面的错误有线索吗?
发布于 2017-07-07 13:18:19
您可以使用ffmpeg和openssl创建一个AES加密的HLS流-- ffmpeg文档(http://ffmpeg.org/ffmpeg-all.html#Options-34)包括以下示例脚本:
#!/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/)创建基本的清晰破折号加密:
MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4
drm信息包含在drm_file.xml中,并在上面的链接中解释。
https://stackoverflow.com/questions/44946042
复制相似问题