From 03e69f1b8568f554afe619747ee1b243cacf44a9 Mon Sep 17 00:00:00 2001 From: Haoming Chen Date: Thu, 19 Jul 2018 17:31:28 -0700 Subject: [PATCH] Update the tutorial and documentation for multi-DRM support. Change-Id: I61061583f44dec1a44e4021a9d78affcaeb903d0 --- docs/source/library_details.rst | 8 +------- .../options/general_encryption_options.rst | 17 ++++++++++++++++ .../options/widevine_encryption_options.rst | 5 ----- docs/source/tutorials/dash.rst | 2 +- docs/source/tutorials/encoding.rst | 4 ++-- docs/source/tutorials/hls.rst | 2 +- docs/source/tutorials/raw_key.rst | 19 +++++++++++++++++- docs/source/tutorials/widevine.rst | 20 +++++++++++++++++++ 8 files changed, 60 insertions(+), 17 deletions(-) diff --git a/docs/source/library_details.rst b/docs/source/library_details.rst index d47312f832..2c491788f6 100644 --- a/docs/source/library_details.rst +++ b/docs/source/library_details.rst @@ -25,18 +25,12 @@ Shaka Packager Library (Continued) .. doxygenstruct:: shaka::PlayReadyEncryptionParams -.. doxygenstruct:: shaka::RawKeyEncryptionParams - -.. doxygenstruct:: shaka::RawKeyEncryptionParams::KeyPair +.. doxygenstruct:: shaka::RawKeyParams .. doxygenstruct:: shaka::EncryptionParams .. doxygenstruct:: shaka::WidevineDecryptionParams -.. doxygenstruct:: shaka::RawKeyDecryptionParams - -.. doxygenstruct:: shaka::RawKeyDecryptionParams::KeyPair - .. doxygenstruct:: shaka::DecryptionParams .. doxygenclass:: shaka::Status diff --git a/docs/source/options/general_encryption_options.rst b/docs/source/options/general_encryption_options.rst index 654b2a163c..101a641647 100644 --- a/docs/source/options/general_encryption_options.rst +++ b/docs/source/options/general_encryption_options.rst @@ -13,3 +13,20 @@ General encryption options --clear_lead 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. diff --git a/docs/source/options/widevine_encryption_options.rst b/docs/source/options/widevine_encryption_options.rst index 78b9a3a8dd..7b95e978fc 100644 --- a/docs/source/options/widevine_encryption_options.rst +++ b/docs/source/options/widevine_encryption_options.rst @@ -13,11 +13,6 @@ Widevine encryption options AES signing key (--aes_signing_key, --aes_signing_iv) or RSA signing key (--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 Key server url. Required for Widevine encryption and decryption. diff --git a/docs/source/tutorials/dash.rst b/docs/source/tutorials/dash.rst index 40ae311cdc..65b3f135ad 100644 --- a/docs/source/tutorials/dash.rst +++ b/docs/source/tutorials/dash.rst @@ -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_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_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 The above packaging command creates five groups of segments (each with an init diff --git a/docs/source/tutorials/encoding.rst b/docs/source/tutorials/encoding.rst index c25e5a5fbb..4a4e61c36f 100644 --- a/docs/source/tutorials/encoding.rst +++ b/docs/source/tutorials/encoding.rst @@ -65,10 +65,10 @@ H264 encoding $ ffmpeg -i original.mp4 -c:a copy \ -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 \ -minrate 6000k -maxrate 6000k -bufsize 6000k -b:v 6000k \ - -y h264_main_1080p_6000.mp4 + -y h264_high_1080p_6000.mp4 VP9 encoding """""""""""" diff --git a/docs/source/tutorials/hls.rst b/docs/source/tutorials/hls.rst index d8b18a057b..ff9abedb51 100644 --- a/docs/source/tutorials/hls.rst +++ b/docs/source/tutorials/hls.rst @@ -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_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_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 The above packaging command creates five groups of streams (each with an init diff --git a/docs/source/tutorials/raw_key.rst b/docs/source/tutorials/raw_key.rst index 4f32679bb4..8534ec5d2b 100644 --- a/docs/source/tutorials/raw_key.rst +++ b/docs/source/tutorials/raw_key.rst @@ -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 \ --mpd_output h264.mpd -Widevine PSSH (different keys for different streams):: +Widevine PSSH (with pre-generated Widevine PSSH):: $ packager \ 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 \ --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 `player setup `_ on how to config the DRM in Shaka Player. diff --git a/docs/source/tutorials/widevine.rst b/docs/source/tutorials/widevine.rst index d586be039b..a8c9ba0bc7 100644 --- a/docs/source/tutorials/widevine.rst +++ b/docs/source/tutorials/widevine.rst @@ -72,6 +72,26 @@ The examples below uses the H264 streams created in :doc:`encoding`. --aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \ --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 `player setup `_ on how to config the DRM in Shaka Player.