简体   繁体   中英

Widevine URL License Key

How to make widevine with license key url on code m3u android iptv application?

Link: https://example.com/file.mpd

Widevine url license key: https://example.com/key?=12345

Example code IPTV.m3u:

#EXTM3U

#EXTINF:-1 tvg-name" TV", TV
https://example.com/file.mpd`

I tried with some attributes but it doesn't work like: #EXT-X-SESSION-KEY:METHOD=AES-128,URI="https://example.com/key?=12345"

I need explanation and code to make my program work. Thanks

I think you want to generate a HLS stream that is protected by Widevine DRM and with the correct information included in the HLS manifest.

The easiest way to do this is likely to look at an example from an existing packager - Shaka packager includes the example below, which create both DASH and HLS encrypted output with Widvine DRM. The link also includes test widevine credentials

$ packager
in=h264_baseline_360p_600.mp4,stream=audio,output=audio.mp4
in=h264_baseline_360p_600.mp4,stream=video,output=h264_360p.mp4
in=h264_main_480p_1000.mp4,stream=video,output=h264_480p.mp4
in=h264_main_720p_3000.mp4,stream=video,output=h264_720p.mp4
in=h264_high_1080p_6000.mp4,stream=video,output=h264_1080p.mp4
--enable_widevine_encryption
--key_server_url https://license.uat.widevine.com/cenc/getcontentkey/widevine_test
--content_id 7465737420636f6e74656e74206964
--signer widevine_test
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249
--mpd_output h264.mpd
--hls_master_playlist_output h264_master.m3u8

( https://shaka-project.github.io/shaka-packager/html/tutorials/widevine.html )

If you are just tying to understand what the format of Widevine URL's look like in a HLS manifest, then the HLS RFC itself has an explanation and some examples (see section 8.3 of https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-01 ) which includes:

#EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52"

One note on your question, you are using EXT-X-SESSION-KEY which is an optional mechanism when you have multiple playlists with media keys and you want to be able to preload them in a master playlist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM