axiomatic-systems / Bento4

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

Common segmentation for both dash and hls with DRM #404

Open haridarshan opened 5 years ago

haridarshan commented 5 years ago

Hi,

I was trying to create common segments for both dash and hls and it worked when content is not DRM protected but when passing DRM options to the packaging tool, it doesn't work

Here is the command I've used for segmentation with DRM protection

Dash works but Hls doesn't work as encryption scheme is cenc instead of cbcs

mp4dash -v -d -f -o test/segments --mpd-name=manifest.mpd --profiles=live --init-segment=init.mp4 --min-buffer-time=1.5 --encryption-key=@skm:https://api.service.expressplay.com/keystore/keys?customerAuthenticator=xxxxxxxxxxxxxxxxxxx#mode=get&kid=xxxxxxxxxxxxxxxxxxxxx&kek=xxxxxxxxxxxxxx&iv=xxxxxxxxxxxx --marlin --marlin-add-pssh --playready --playready-add-pssh --playready-header=LA_URL:https://pr-gen.service.expressplay.com --widevine --widevine-header provider:intertrust#content_id:2a --use-segment-template-number-padding --use-segment-timeline --subtitles --hls --encryption-cenc-scheme=cenc --hls-master-playlist-name=playlist.m3u8 --hls-media-playlist-name=chunk.m3u8 --fairplay-key-uri=skd://expressplay_token test/video_1080p_frag.mp4 test/video_720p_frag.mp4 test/video_480p_frag.mp4 test/video_360p_frag.mp4

Both hls and dash doesn't work, even if encryption scheme is cbcs

mp4dash -v -d -f -o test/segments --mpd-name=manifest.mpd --profiles=live --init-segment=init.mp4 --min-buffer-time=1.5 --encryption-key=@skm:https://api.service.expressplay.com/keystore/keys?customerAuthenticator=xxxxxxxxxxxxxxxxxxx#mode=get&kid=xxxxxxxxxxxxxxxxxxxxx&kek=xxxxxxxxxxxxxx&iv=xxxxxxxxxxxx --marlin --marlin-add-pssh --playready --playready-add-pssh --playready-header=LA_URL:https://pr-gen.service.expressplay.com --widevine --widevine-header provider:intertrust#content_id:2a --use-segment-template-number-padding --use-segment-timeline --subtitles --hls --encryption-cenc-scheme=cbcs --hls-master-playlist-name=playlist.m3u8 --hls-media-playlist-name=chunk.m3u8 --fairplay-key-uri=skd://expressplay_token test/video_1080p_frag.mp4 test/video_720p_frag.mp4 test/video_480p_frag.mp4 test/video_360p_frag.mp4

Anyone who can help me with this

barbibulle commented 5 years ago

Using --hls --encryption-cenc-scheme=cbcs should work. What type of error are you getting?

haridarshan commented 5 years ago

Hi @barbibulle

I've tried with --hls --encryption-cenc-scheme=cbcs and segmentation was successful but video is not getting played on Chrome with no error in bitmovin player

barbibulle commented 5 years ago

On Chrome, are you delivering the key with a DRM system, or the built-in "clearkey" method?

haridarshan commented 5 years ago

I'm delivering the key with a DRM system

here is the sample url Dash Streaming Url: https://public.jetstream.video/stage/test/test_segments/manifest.mpd Hls Streaming Url: https://public.jetstream.video/stage/test/test_segments/playlist.m3u8

Widevine LA: https://wv.service.expressplay.com/hms/wv/rights/?ExpressPlayToken=BAALuGDeKasAAABwElJKeBRCgsrN-MFbGjw_-D-Oef3-JGGcS6uChV35mvs8BqfUA-VBuGVs7dxbIrCLOEk_p0Ixh9UIxRB_ut6EBjaZKp8MJ4Sn6LLK-umouB7G8t0WzpPG11vVUvhcj3nqZsDd0owG0KXZA0LVZh4Vc_v8-9U20jsAzil9I9C6h0im67VD

FairPlay LA: https://fp.service.expressplay.com/hms/fp/rights/?ExpressPlayToken=AQALuGDeKbkAAABQmtujaxhmnkpRRSeRUVKUv7axFnWUgMDib_RTcuis4hnD1Opx0XrWgTRPF4-OhbkXxqhBBlWLSvboFp7mnmtxsFiWx_f_gUNUlltp2RFNtXmsUHoc5Q9wWcDFKWQScuIw3uVjWg

deisenbacher01 commented 5 years ago

Hello Are there any updates on this, is it a shaka player issue?

barbibulle commented 5 years ago

I'll try to investigate this next week.

On Fri, Aug 2, 2019 at 9:45 AM deisenbacher01 notifications@github.com wrote:

Hello Are there any updates on this, is it a shaka player issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/axiomatic-systems/Bento4/issues/404?email_source=notifications&email_token=AASYTDMFJWDAZYW5SVSFQVDQCRQD3A5CNFSM4IDVH67KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OIUMQ#issuecomment-517769778, or mute the thread https://github.com/notifications/unsubscribe-auth/AASYTDPXH6XA5PTYM5APUPTQCRQD3ANCNFSM4IDVH67A .