How to implement video DRM in iOS

2019-03-15 11:56发布

问题:

I'm looking to implement DRM in an iOS video player, but I'm not sure how to implement this. In order to implement video DRM (while still using Apple's hardware accelerated H264 decode), I need a way to feed the decrypted H264 stream into the standard iOS video playback APIs.

According to this question, it was not possible to implement 3rd party DRM in September 2010. There's a thread in the Apple Developer Forums that goes nowhere. However, as of today a number of 3rd party DRM libraries exist: Widevine, Irdeto (PDF), Marlin. They have clearly found some way to pass a custom stream to the media player in Apple approved apps.

I've found two leads. One is a suggestion to create a custom URL protocol, but people seem to have poor success using this with video. The other is to create a local HTTP server thread and provide the content by HTTP live streaming on 127.0.0.1 inside the iDevice. I'd like to be very sure that Apple will approve before going that route.

So - what Apple approved APIs do 3rd party DRM implementations use to get decrypted video data into the video player?

Edit: the latest BBC iPlayer for iOS allows programmes to be downloaded for later viewing. Either they store the content in the clear, or they have cracked this problem.

回答1:

You can begin decrypting the file into another file and playback that file as you decrypt. You'll need to let it buffer a few seconds worth of video, but it will work.

Additionally you'll need to make sure that the moov atom is BEFORE the mdat atom in the file, otherwise it won't work. (AVFoundation, for example, creates MP4s where the moov atom comes after the mdat atom, and so they would need to be modified to work)



回答2:

A working solution is local http server. But the patent application was submitted by Authentec.

http://www.google.com/patents/US20120284802



标签: ios h.264 drm