如何让 mediafilesegmenter 生成加密密钥以便我可以在本地提供它们?
我想我错过了一些关于 mediafilesegmenter 的东西。
文档对于加密内容是这样说的:
Apple 提供的媒体流分段器提供加密功能 并支持三种配置加密模式。第一种模式 允许您指定磁盘上现有密钥文件的路径。在这个 模式下,分段器将现有密钥文件的 URL 插入到 索引文件。它使用此密钥加密所有媒体文件。第二个 mode 指示分段器生成随机密钥文件,保存在 指定位置,并在索引文件中引用它。所有媒体 文件使用此随机生成的密钥进行加密。第三种模式 指示分段器每 n 生成一个新的随机密钥文件 媒体片段,将其保存在指定位置,并在中引用它 索引文件。这种模式称为密钥轮换。各组 n 个文件使用不同的密钥进行加密。
文档是这样描述 mediafilesegmenter 的: 文件分段器执行与流分段器相同的任务,但它将文件而不是流作为输入。 http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/HTTPStreamingArchitecture/HTTPStreamingArchitecture.html#//apple_ref/doc/uid/TP40008332-CH101-DontLinkElementID_7
所以,我猜测 mediafilesegmenter 具有这三种模式,就像 mediastreamsegmenter 一样 做。我正在尝试使用第二种模式。这是我的命令:
mediafilesegmenter -f cryptoSegmentsDirectory -encrypt-iv=sequence -加密密钥encryptedSegmentsDirectory/key.txt media.m4v
结果是 .ts 文件和两个 m3u8 文件,这两个文件似乎都没有引用密钥文件。我得到这样的回应: mediafilesegmenter:选项“-加密密钥”不明确 有没有一个例子可以说明如何成功地做到这一点?
此外,HTTP Live Streaming 似乎坚持通过 http 提供关键文件:
您可以使用 HTTP 或 HTTPS 提供密钥文件。您还可以 选择使用您自己的来保护密钥文件的传送 基于会话的认证方案。详情请参见“服务密钥 通过 HTTPS 安全地保存文件。”
我想将其提供给 iOS 文件系统上的本地文件,而不是服务器。这可能吗?如果没有,从本地网络服务器提供服务会有什么问题吗?
抱歉,如果我错过了一些明显的内容 - 请随时向我指出相关文档!
I think I'm missing something about mediafilesegmenter.
The docs say this about encrypting content:
The media stream segmenter available from Apple provides encryption
and supports three modes for configuring encryption. The first mode
allows you to specify a path to an existing key file on disk. In this
mode the segmenter inserts the URL of the existing key file in the
index file. It encrypts all media files using this key. The second
mode instructs the segmenter to generate a random key file, save it in
a specified location, and reference it in the index file. All media
files are encrypted using this randomly generated key. The third mode
instructs the segmenter to generate a new random key file every n
media segments, save it in a specified location, and reference it in
the index file. This mode is referred to as key rotation. Each group
of n files is encrypted using a different key.
The docs say this about mediafilesegmenter:
The file segmenter performs the same tasks as the stream segmenter, but it takes files as input instead of streams.
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/HTTPStreamingArchitecture/HTTPStreamingArchitecture.html#//apple_ref/doc/uid/TP40008332-CH101-DontLinkElementID_7
So, I'm guessing mediafilesegmenter has those three modes, just like mediastreamsegmenter does. I'm trying to use the second mode. Here's my command:
mediafilesegmenter -f encryptedSegmentsDirectory -encrypt-iv=sequence
-encrypt-key encryptedSegmentsDirectory/key.txt media.m4v
The result is .ts files and two m3u8 files, neither of which seem to reference key files. I get this response:
mediafilesegmenter: option `-encrypt-key' is ambiguous
Is there an example that shows how to do this successfully?
Also, HTTP Live Streaming seems to insist on serving key files over http:
You can serve key files using either HTTP or HTTPS. You may also
choose to protect the delivery of the key files using your own
session-based authentication scheme. For details, see “Serving Key
Files Securely Over HTTPS.”
I'd like to serve it on a local file on the iOS file system instead from a server. Is this possible? If not, would there any problem with serving it from a local web server?
Sorry if I missed something obvious - please feel free to just point me to the relevant documentation!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Doh - 我把开关弄错了。它是-加密密钥文件,而不是-加密密钥。对不起大家!我只需要离开一会儿。
Doh - I got the switch wrong. It's -encrypt-key-file, not -encrypt-key. Sorry, everyone! I just needed to step away for a while.