Update the tutorial and documentation for multi-DRM support.
Change-Id: I61061583f44dec1a44e4021a9d78affcaeb903d0
This commit is contained in:
parent
f331f18f0e
commit
03e69f1b85
|
@ -25,18 +25,12 @@ Shaka Packager Library (Continued)
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::PlayReadyEncryptionParams
|
.. doxygenstruct:: shaka::PlayReadyEncryptionParams
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::RawKeyEncryptionParams
|
.. doxygenstruct:: shaka::RawKeyParams
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::RawKeyEncryptionParams::KeyPair
|
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::EncryptionParams
|
.. doxygenstruct:: shaka::EncryptionParams
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::WidevineDecryptionParams
|
.. doxygenstruct:: shaka::WidevineDecryptionParams
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::RawKeyDecryptionParams
|
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::RawKeyDecryptionParams::KeyPair
|
|
||||||
|
|
||||||
.. doxygenstruct:: shaka::DecryptionParams
|
.. doxygenstruct:: shaka::DecryptionParams
|
||||||
|
|
||||||
.. doxygenclass:: shaka::Status
|
.. doxygenclass:: shaka::Status
|
||||||
|
|
|
@ -13,3 +13,20 @@ General encryption options
|
||||||
--clear_lead <seconds>
|
--clear_lead <seconds>
|
||||||
|
|
||||||
Clear lead in seconds if encryption is enabled.
|
Clear lead in seconds if encryption is enabled.
|
||||||
|
|
||||||
|
--generate_widevine_pssh
|
||||||
|
|
||||||
|
Generate a Widevine PSSH box. This option is always true
|
||||||
|
when using :doc:`/tutorials/widevine` key source.
|
||||||
|
|
||||||
|
--generate_common_pssh
|
||||||
|
|
||||||
|
Generate a v1 PSSH box for the common system ID that includes
|
||||||
|
the key IDs. See https://goo.gl/s8RIhr. This option is default to be
|
||||||
|
true when using :doc:`/tutorials/raw_key` source and no other pssh
|
||||||
|
flag is specified.
|
||||||
|
|
||||||
|
--generate_playready_pssh
|
||||||
|
|
||||||
|
Generate a PlayReady PSSH box. This option is always
|
||||||
|
true when using :doc:`/tutorials/playready` key source.
|
||||||
|
|
|
@ -13,11 +13,6 @@ Widevine encryption options
|
||||||
AES signing key (--aes_signing_key, --aes_signing_iv) or RSA signing key
|
AES signing key (--aes_signing_key, --aes_signing_iv) or RSA signing key
|
||||||
(--rsa_signing_key_path).
|
(--rsa_signing_key_path).
|
||||||
|
|
||||||
--include_common_pssh
|
|
||||||
|
|
||||||
When using Widevine encryption, include an additional v1 PSSH box for the
|
|
||||||
common system ID that includes the key IDs. See https://goo.gl/s8RIhr.
|
|
||||||
|
|
||||||
--key_server_url <url>
|
--key_server_url <url>
|
||||||
|
|
||||||
Key server url. Required for Widevine encryption and decryption.
|
Key server url. Required for Widevine encryption and decryption.
|
||||||
|
|
|
@ -54,7 +54,7 @@ The above packaging command creates five single track fragmented mp4 streams
|
||||||
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s' \
|
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s' \
|
||||||
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s' \
|
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s' \
|
||||||
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s' \
|
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s' \
|
||||||
'in=h264_main_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s' \
|
'in=h264_high_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s' \
|
||||||
--generate_static_mpd --mpd_output h264.mpd
|
--generate_static_mpd --mpd_output h264.mpd
|
||||||
|
|
||||||
The above packaging command creates five groups of segments (each with an init
|
The above packaging command creates five groups of segments (each with an init
|
||||||
|
|
|
@ -65,10 +65,10 @@ H264 encoding
|
||||||
|
|
||||||
$ ffmpeg -i original.mp4 -c:a copy \
|
$ ffmpeg -i original.mp4 -c:a copy \
|
||||||
-vf "scale=-2:1080" \
|
-vf "scale=-2:1080" \
|
||||||
-c:v libx264 -profile:v main -level:v 4.2 \
|
-c:v libx264 -profile:v high -level:v 4.2 \
|
||||||
-x264opts scenecut=0:open_gop=0:min-keyint=72:keyint=72 \
|
-x264opts scenecut=0:open_gop=0:min-keyint=72:keyint=72 \
|
||||||
-minrate 6000k -maxrate 6000k -bufsize 6000k -b:v 6000k \
|
-minrate 6000k -maxrate 6000k -bufsize 6000k -b:v 6000k \
|
||||||
-y h264_main_1080p_6000.mp4
|
-y h264_high_1080p_6000.mp4
|
||||||
|
|
||||||
VP9 encoding
|
VP9 encoding
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
|
@ -65,7 +65,7 @@ The above packaging command creates five single track TS streams
|
||||||
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s,playlist_name=h264_360p/main.m3u8,iframe_playlist_name=h264_360p/iframe.m3u8' \
|
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s,playlist_name=h264_360p/main.m3u8,iframe_playlist_name=h264_360p/iframe.m3u8' \
|
||||||
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s,playlist_name=h264_480p/main.m3u8,iframe_playlist_name=h264_480p/iframe.m3u8' \
|
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s,playlist_name=h264_480p/main.m3u8,iframe_playlist_name=h264_480p/iframe.m3u8' \
|
||||||
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s,playlist_name=h264_720p/main.m3u8,iframe_playlist_name=h264_720p/iframe.m3u8' \
|
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s,playlist_name=h264_720p/main.m3u8,iframe_playlist_name=h264_720p/iframe.m3u8' \
|
||||||
'in=h264_main_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s,playlist_name=h264_1080p/main.m3u8,iframe_playlist_name=h264_1080p/iframe.m3u8' \
|
'in=h264_high_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s,playlist_name=h264_1080p/main.m3u8,iframe_playlist_name=h264_1080p/iframe.m3u8' \
|
||||||
--hls_master_playlist_output h264_master.m3u8
|
--hls_master_playlist_output h264_master.m3u8
|
||||||
|
|
||||||
The above packaging command creates five groups of streams (each with an init
|
The above packaging command creates five groups of streams (each with an init
|
||||||
|
|
|
@ -51,7 +51,7 @@ Common PSSH (different keys for different streams)::
|
||||||
--keys label=AUDIO:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519,label=SD:key_id=abba271e8bcf552bbd2e86a434a9a5d9:key=69eaa802a6763af979e8d1940fb88392,label=HD:key_id=6d76f25cb17f5e16b8eaef6bbf582d8e:key=cb541084c99731aef4fff74500c12ead \
|
--keys label=AUDIO:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519,label=SD:key_id=abba271e8bcf552bbd2e86a434a9a5d9:key=69eaa802a6763af979e8d1940fb88392,label=HD:key_id=6d76f25cb17f5e16b8eaef6bbf582d8e:key=cb541084c99731aef4fff74500c12ead \
|
||||||
--mpd_output h264.mpd
|
--mpd_output h264.mpd
|
||||||
|
|
||||||
Widevine PSSH (different keys for different streams)::
|
Widevine PSSH (with pre-generated Widevine PSSH)::
|
||||||
|
|
||||||
$ packager \
|
$ packager \
|
||||||
in=h264_baseline_360p_600.mp4,stream=audio,output=audio.mp4,drm_label=AUDIO \
|
in=h264_baseline_360p_600.mp4,stream=audio,output=audio.mp4,drm_label=AUDIO \
|
||||||
|
@ -64,6 +64,23 @@ Widevine PSSH (different keys for different streams)::
|
||||||
--pssh 000000407073736800000000edef8ba979d64acea3c827dcd51d21ed000000201a0d7769646576696e655f74657374220f7465737420636f6e74656e74206964 \
|
--pssh 000000407073736800000000edef8ba979d64acea3c827dcd51d21ed000000201a0d7769646576696e655f74657374220f7465737420636f6e74656e74206964 \
|
||||||
--mpd_output h264.mpd
|
--mpd_output h264.mpd
|
||||||
|
|
||||||
|
Widevine PSSH and PlayReady PSSH::
|
||||||
|
|
||||||
|
$ packager \
|
||||||
|
in=h264_baseline_360p_600.mp4,stream=audio,output=audio.mp4,drm_label=AUDIO \
|
||||||
|
in=h264_baseline_360p_600.mp4,stream=video,output=h264_360p.mp4,drm_label=SD \
|
||||||
|
in=h264_main_480p_1000.mp4,stream=video,output=h264_480p.mp4,drm_label=SD \
|
||||||
|
in=h264_main_720p_3000.mp4,stream=video,output=h264_720p.mp4,drm_label=HD \
|
||||||
|
in=h264_high_1080p_6000.mp4,stream=video,output=h264_1080p.mp4,drm_label=HD \
|
||||||
|
--enable_raw_key_encryption \
|
||||||
|
--keys label=AUDIO:key_id=f3c5e0361e6654b28f8049c778b23946:key=a4631a153a443df9eed0593043db7519,label=SD:key_id=abba271e8bcf552bbd2e86a434a9a5d9:key=69eaa802a6763af979e8d1940fb88392,label=HD:key_id=6d76f25cb17f5e16b8eaef6bbf582d8e:key=cb541084c99731aef4fff74500c12ead \
|
||||||
|
--generate_widevine_pssh \
|
||||||
|
--generate_playready_pssh \
|
||||||
|
--mpd_output h264.mpd
|
||||||
|
|
||||||
|
Note that user is responsible for setting up Widevine and PlayReady license server
|
||||||
|
and managing keys there.
|
||||||
|
|
||||||
Refer to
|
Refer to
|
||||||
`player setup <https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html>`_
|
`player setup <https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html>`_
|
||||||
on how to config the DRM in Shaka Player.
|
on how to config the DRM in Shaka Player.
|
||||||
|
|
|
@ -72,6 +72,26 @@ The examples below uses the H264 streams created in :doc:`encoding`.
|
||||||
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \
|
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \
|
||||||
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249
|
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249
|
||||||
|
|
||||||
|
* One example with multi-DRM support (Playready PSSH in addition to Widevine PSSH)::
|
||||||
|
|
||||||
|
$ 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 \
|
||||||
|
--mpd_output h264.mpd \
|
||||||
|
--hls_master_playlist_output h264_master.m3u8 \
|
||||||
|
--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 \
|
||||||
|
--generate_playready_pssh
|
||||||
|
|
||||||
|
Note that user is responsible for setting up the PlayReady server and managing keys there.
|
||||||
|
|
||||||
Refer to
|
Refer to
|
||||||
`player setup <https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html>`_
|
`player setup <https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html>`_
|
||||||
on how to config the DRM in Shaka Player.
|
on how to config the DRM in Shaka Player.
|
||||||
|
|
Loading…
Reference in New Issue