【问题标题】:Error encrypting webm video with webm crypt使用 webm crypt 加密 webm 视频时出错
【发布时间】:2017-12-10 07:00:22
【问题描述】:

我正在尝试将示例 here 用于视频的 Clearkey 加密。根据here 提到的步骤,我能够下载并构建加密工具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 文件。无法打开 WebM 文件。

尝试了许多不同的webm 文件,但没有成功。

还有其他方法可以使用其他工具加密明文密钥媒体吗?关于上述错误的任何线索?

【问题讨论】:

  • 这对我来说似乎不是一个编程问题。试试超级用户。

标签: encryption drm webm


【解决方案1】:

您可以使用 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/) 创建基本的明文 DASH 加密:

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

drm 信息包含在 drm_file.xml 中,并在上面的链接中进行了说明。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 2017-07-25
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 2021-12-07
    相关资源
    最近更新 更多