gpt4 book ai didi

ios - 在 iOS 中使用解密流式传输分段数据

转载 作者:行者123 更新时间:2023-11-29 00:17:29 24 4
gpt4 key购买 nike

我正在创建一个应用程序,其中我需要下载加密的 Mpeg 片段并在使用从服务器下载的 key 解密后在播放器中播放视频。我不知道从哪里开始。我从 here 得到了一些帮助并致力于它,如果有人曾经构建或创建过此类功能,请告诉我。

最佳答案

如果您需要 DRM 级别的保护,在 iOS 设备上执行此操作的常用方法是使用 Apple 的 FairPlay DRM 解决方案。

如果您有 Apple 开发者 ID:https://developer.apple.com/streaming/fps/,则可以使用文档、SDK 和示例应用程序。

但请注意,要实际部署它,您必须是“许可内容所有者”,我认为这主要针对较大的运营商和内容所有者,因此首先检查您是否符合他们的定义非常重要:

Request Deployment Package

If you're a licensed content owner ready to deploy your implementation of FairPlay Streaming to a production environment, request the FPS Deployment Package. Please note that you must be the Team Agent of a development team that is a licensed content owner. The FPS Deployment Package is not available to third parties acting on behalf of licensed content owners.

如果您可以接受较低级别的保护,那么 AES 加密的 HLS 可能就足够了 - 实际的视频加密与 DRM 几乎相同,但 key 本身并未加密。

您可以使用 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

关于ios - 在 iOS 中使用解密流式传输分段数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44941616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com