ios - FairPlay 流媒体 : Calling copyPixelBufferForItemTime on AVPlayerItemVideoOutput returns NULL

标签 ios http-live-streaming fairplay

有没有人有使用 HLS 和 Fairplay 并成功检索像素缓冲区的经验?

我正在使用 AVURLAsset及其resourceLoader委托(delegate)集。我的 AVAssetResourceLoaderDelegate负责处理 Fairplay 流程。

它在 AVPlayerLayer 上显示良好,但是,当我尝试使用 AVPlayerItemVideoOutput附加到 AVPlayerItem并使用 copyPixelBufferForItemTime在它上面,返回的 pixelBuffer 始终为 NULL。

另一方面,当我使用非加密流而不使用 resourceLoader 时,copyPixelBufferForItemTime 按预期返回像素缓冲区。

这是按预期工作吗? (即使用 FairPlay 保护的流不会暴露其像素缓冲区以防止滥用。)

如果没有,有没有办法从 iOS 上使用 FairPlay 保护的流中获取像素缓冲区?

最佳答案

在进一步研究这个问题后,我得出的结论是,Apple 以这样一种方式设计了他们的 AVPlayer,一旦你使用受 FairPlay 保护的 HLS,解密数据的唯一导出点(见 A:)copyPixelBufferForItemTime总是返回零。

  • 我已经测试了没有加密的完全相同的流和copyPixelBufferForItemTime按预期返回对像素缓冲区的引用。
  • 我测试了完全相同的流 AVPlayerLayer 上的加密,它将视频显示为异常(exception)。

  • 看来,一旦您使用 FairPlay,显示 protected 视频内容的唯一方法就是使用 AVPlayerLayer .到目前为止,似乎无法从 Apple 的 API 中检索受 FairPlay 保护的 HLS 媒体,以便将其显示在 3D 空间中的 OpenGL 纹理上。

    答:copyPixelBufferForItemTime是自调用 renderInContext 以来唯一的退出点在 AVPlayerLayer 上不起作用

    关于ios - FairPlay 流媒体 : Calling copyPixelBufferForItemTime on AVPlayerItemVideoOutput returns NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42839831/

    相关文章:

    ios - 如何在 iPhone SDK 3.0 中使用 HTTP Live Streaming 协议(protocol)

    javascript - 使用 FFmpeg 通过管道输出视频片段

    openssl - Azure 媒体服务 - FairPlay 配置显示 - 证书验证失败

    swift - 无法使用 Fairplay HLS 从 AVPlayer 获取视频缩略图

    iphone - 如何在适用于 IOS 6 的 Google map API 中使用委托(delegate)

    ios - 使用 AutoLayout 时折叠 UIView

    video - 使用多隔离 ts 创建 m3u8

    IOS App Submission with Encryption/Fairplay,怎么做或者自动

    ios - 在 UITableView 中搜索具有多个部分的 Controller

    ios - 如何与 PLC 建立数据交换连接?输入/输出