有没有人有使用 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
按预期返回对像素缓冲区的引用。 看来,一旦您使用 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/