axiomatic-systems / Bento4

Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
http://www.bento4.com
2.02k stars 482 forks source link

HEVC with fairplay stream creation #379

Open SayoniDuttaRoy opened 5 years ago

SayoniDuttaRoy commented 5 years ago

I used this command for stream creation : "python2 mp4-dash.py --hls --fairplay-key-uri="skd://one?cek=ca864f218fa006bb7e59a35e110551e4&iv=890fb300266e05646dd3e37aa9e42967" --encryption-cenc-scheme=cbcs --encryption-key=ca864f218fa006bb7e59a35e110551e4:ca864f218fa006bb7e59a35e110551e4:890fb300266e05646dd3e37aa9e42967 frag_video.mp4"

But on trying to play the stream created, the master m3u8 and one media playlist are downloaded, after which the player stops and nothing plays.

barbibulle commented 5 years ago

I'm suspecting there's something off in the license data returned by your FairPlay key server (maybe some flag that allows/disallows playback on desktop machines?). I have verified that encrypted content (both h.264 and hevc) can play just fine in Safari. Here's a link to a page that has 4 examples: h264 and hevc, both in cleartext and encrypted. The encrypted content is the same as what you'd use if you used FairPlay as a key delivery DRM, but in this case the key is just delivered straight from the server without DRM. (but the encrypted format is the same). For reference, the encrypted content was generated with this command: mp4dash --hls --encryption-key=000102030405060708090a0b0c0d0e0f:00112233445566778899aabbccddeeff --encryption-cenc-scheme=cbcs -o encrypted_h265 hevc_video.mp4

You can access the test streams here: http://www.bok.net/tmp/safari_hls_test/player.html

SayoniDuttaRoy commented 5 years ago

But i can successfully play fairplay avc using the same fairplay key server module.

SayoniDuttaRoy commented 5 years ago

@barbibulle Have you been able to play any encrypted HEVC content using the Fairplay key server specifically?

barbibulle commented 5 years ago

Unfortunately, I don't have access to a test Fairplay key server. Apple doesn't provide one, and requesting credentials from Apple doesn't work as they only issue credential for "real" services, not for testing. I did test the functionality with a key server a while back, when I had access to one for a while, but that's no longer the case. A number of users of Bento4 use is regularly with their own Fairplay servers too. If you have a way for me to test with a key server, let me know.