FairPlay Streaming:在AVPlayerItemVideoOutput上调用copyPixelBufferForItemTime将返回NULL

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

我正在使用它的resourceLoader委托集AVURLAsset 。 我的AVAssetResourceLoaderDelegate负责处理Fairplay过程。

它在AVPlayerLayer上显示得很好,但是,当我尝试使用附加到AVPlayerItem并对其使用copyPixelBufferForItemTime时,返回的pixelBuffer始终为NULL。

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

这是按照预期工作吗? (即使用FairPlay保护的stream不会暴露它们的像素缓冲区以防止误用。)

如果不是,有没有办法从iOS上的FairPlay保护的stream中获取像素缓冲区?

在进一步研究这个问题后,我得出结论,苹果deviseAVPlayer的方式是,一旦使用了FairPlay保护的HLS,解密数据copyPixelBufferForItemTime的唯一出口点(见A :)总是返回nil。

  • 我testing了完全相同的stream没有encryption和copyPixelBufferForItemTime返回像素缓冲区的预期的引用。
  • 我已经在AVPlayerLayer上testing了完全相同的encryptionstream并将video显示为例外。

看来,一旦您使用FairPlay,唯一的方法来显示您的受保护的video内容是通过使用AVPlayerLayer 。 例如,目前似乎没有办法从Apple的API中检索FairPlay保护的HLS媒体,以便在3D空间中将其显示在OpenGL纹理上。

答: copyPixelBufferForItemTime是自从在AVPlayerLayer上调用renderInContext的唯一出口点不起作用

Interesting Posts