Widevine DRM Architecture Overview PDF
Widevine DRM Architecture Overview PDF
Widevine DRM Architecture Overview PDF
Widevine DRM
Architecture Overview
Table of Contents
Contact Widevine 4
Related Documentation 4
Shaka Packager 14
Packaging Steps 14
Working with Shaka Packager 15
Downloading Shaka Packager 15
Building Shaka Packager 15
Shaka Packager Community 16
ISO BMFF 16
Google - Confidential Version 1.2: March 6, 2017
Page 2 of 28
Player Components 16
Widevine License Server 17
Shaka Player Library 17
Encrypted Media Extensions 17
Media Source Extensions 17
Content Decryption Module 17
Component Stack for Shaka Player 17
Chrome Components Needed by Shaka Player 18
App Development with Shaka Player 18
Working with Shaka Player 19
Downloading Shaka 19
Shaka Requirements 19
Shaka Community 19
Building Shaka 19
Pre-compiled Builds 20
Test Application 20
Google - Confidential Version 1.2: March 6, 2017
Page 3 of 28
Widevine iOS SDK Requirements 26
Widevine CDM Dynamic Library Versions 27
Production Releases 27
Development Releases 27
Widevine iOS Community 27
Version History 28
Contact Widevine
For more information about Widevine, contact us at http://www.widevine.com/contact.html.
Related Documentation
For content provider partners, please look at the Getting Started guide.
For device partners, please look at the Getting Started for Devices guide.
Google - Confidential Version 1.2: March 6, 2017
Page 4 of 28
Widevine DRM Architecture Overview
Google's Widevine DRM architecture provides a market-leading platform for delivering protected
premium content at the highest possible quality to the largest number of devices. The Widevine
DRM platform uses standards-based royalty-free solutions for encryption, adaptive streaming,
transport, and player software. It also includes free, open source tools for content preparation
and media playback, enabling openness and innovation at every level.
Widevine DRM gives content partners easy, effective, and inexpensive methods for streaming
video over the Internet, accelerating the transition away from proprietary and legacy systems to
give billions of video consumers better access to the next generation of media experiences.
This overview will introduce the nine core components of the Widevine DRM architecture and
explain how the components work together to create a secure playback system that starts with
the Shaka Packager and finishes with a choice of players on multiple client platforms and
devices, including HTML5, Android, and iOS.
Name Description
Video Players (HTML5, Android, iOS, OEM) Secure playback on various platforms
Components Overview
This section introduces the nine core components and explains the role they play in the
Widevine DRM platform.
Common Encryption
The Widevine DRM uses the Common Encryption (CENC) open standard for encryption and
also recommends the ISO Base Media File Format (BMFF) standard with CENC, but note that
the WEBM format is also supported and that other formats may be supported in the future. You
can read more about CENC and BMFF on the W3C site at
w3c.github.io/encrypted-media/cenc-format.html. Note that the Widevine DRM CENC (Common
Encryption), Generic CENC, Generic FairPlay Streaming encryption formats are currently
supported.
The DASH protocol is used because it solves two important content delivery problems:
bandwidth and transport.
Diagram 2-1 shows how dynamic adaptive streaming works. The highlighted areas indicate
which alternate chunk (segment) will play at a specific time, determined by current bandwidth.
These are only sample numbers, and the numbers and times will vary depending on bandwidth
and quality desired.
HLS Streaming
Widevine also supports the Apple HLS Live adaptive streaming format.
Google - Confidential Version 1.2: March 6, 2017
Page 9 of 28
Media Packaging
Widevine DRM provides a complete open-source DASH packaging system called Shaka
Packager. The packager converts files of different resolutions and bandwidth to fragmented
MP4, defining equal-length segments for all desired files. A manifest (MPD) is prepared that
describes the different resolutions and bandwidth for each file. When a player receives
encrypted content, it requests the appropriate segment that will provide optimal viewing at that
moment, but can request different segments as bandwidth conditions change. The Shaka
Packager is covered in more detail in the Shaka Content Packager section.
License Server
In order to provide license information for encrypting and decrypting media securely, Widevine
DRM provides a Cloud-based license service. When media is prepared, information about the
media is sent to the Widevine License Server for later use. Then when the stream is received by
the Player, the License Server is called and license information is provided. The license protocol
used to communicate with the License Server is a simple request-response over HTTPS. The
License Request and License Response messages are constructed and parsed using Google
Protocol Buffers.
Video Players
Widevine DRM supports player technologies for HTML5, Android, and iOS. In addition, it also
supports individual OEM devices on a licensed request basis. Specific details for developing
with HTML5, Android, and iOS player technologies are covered in later sections.
1. When the Player determines that the content is encrypted, it tells the CDM to generate a
license request. The MPD and PSSH (Protection System Specific Header) information is
retrieved from the content and parsed in order to determine the DRM system to be used.
2. The CDM then creates an encrypted license request object which it passes back to the
Player. The Player will then pass the encrypted license object to the License Server.
3. Next, when the License Server responds to the Player request, it sends an encrypted
object containing license information to the Player. Finally, the Player passes the
encrypted object to the CDM, which in turn passes it to the OEMCrypto Module for
decryption.
OEMCrypto Module
The OEMCrypto Module decrypts the content using information passed to it from the Player
(and the License Server). The OEMCrypto Module is in the Trusted Layer of the device and is
tied into the device hardware. It uses the encrypted license information to decrypt the media,
and the media sent to the video stack.
The following eight steps explain the sequence of security exchanges for decryption:
Diagram 1-3 shows the playback security model's sequence of exchanges between the
playback components.
Diagram 1-3: Widevine DRM Playback Security Model
Security Level 2
Performs cryptography (but not video processing) within the TEE: decrypted buffers are
returned to the application domain and processed through separate video hardware or software.
At level 2, however, cryptographic information is still processed only within the trusted execution
environment.
Security Level 3
Does not have a TEE on the device. Appropriate measures may be taken to protect the
cryptographic information and decrypted content on host operating system. A Level 3
implementation may also include a hardware cryptographic engine, but that only enhances
performance, not security.
Chrome on desktops L3
ChromeOS L1, L3
Android L1, L3
Packaging Steps
These are the steps for packaging your content for DASH streaming:
1. Encode the video using the VP9 or H.264 codec. MPEG2-TS and Widevine 1.0 (WVM)
are also supported and other encoding formats may be supported in the future. You can
use any encoding tools you want as long as they follow the standards for the media you
are encoding
2. Separate files must be encoded for each resolution and bitrate that you want your player
to support. For example, 1920x1080 at 6MBPS might be a high-quality choice and a
low-quality would be 320x240 at 1MBPS.
3. The following three steps are then performed concurrently by Shaka Packager:
Once Shaka Packager is finished, copy the different bitrate/resolution files and the manifest to a
folder on your Content Delivery Network. The URL pointing to the MPD will be used to begin the
streaming.
Diagram 2-1 shows the process flow for using Shaka Packager.
1. Install the Chromium Depot tools. The Chromium Depot tools can be found at
https://www.chromium.org/developers/how-tos/get-the-code.
2. Get the Shaka Packager source code from GitHub.
3. Build the Shaka Packager using the Ninja build tool. Ninja is a utility similar to the make
build tool, but is faster. Ninja are included in the Chromium depot tools.
ISO BMFF
Shaka Packager supports common media containers: WebM, ISO BMFF, MPEG-2 TS, and
Widevine Media 1.0 (WVM). You can learn more about ISO BMFF at
http://www.w3.org/2013/12/byte-stream-format-registry/isobmff-byte-stream-format.html. The
current version supported is ISO/IEC 23001-7 Common Encryption in ISO base media file
format files - version 2.
The video must be encoded in VP9 or H.264 format but other formats may be supported at a
later time. You are free to use any tools to encode video in those formats, but the Shaka
Packager must be used to prepare files for DASH or HLS streaming.
Player Components
The playback of secure video content through Shaka Player involves these five major
components:
Downloading Shaka
You can download the latest version of Shaka at https://GitHub.com/google/shaka-player. More
information about Shaka Player is available from g.co/shakainfo
Shaka Requirements
Shaka requires an HTML5-compliant browser (i.e. Chrome 33 or higher) that supports EME and
MSE.
Shaka Community
There is an online community of participants in the Shaka open source GitHub project at
https://GitHub.com/google/shaka-player/issues. At this site you can meet with other users and
Google developers who can answer questions, make suggestions, and discuss programming
options. There is also a mailing list you can join for further discussion of Shaka issues at
https://groups.google.com/forum/#!forum/shaka-player-users.
Building Shaka
In order to get the most out of Shaka Player, you need to build it from source code provided by
Widevine on GitHub. This code is updated frequently, ensuring that you can get the latest build.
The build uses the Google Closure compiler on the Shaka JavaScript source code to minify,
optimize, obfuscate, and check for many different types of errors. You can run Shaka in the
uncompiled state but this is not recommended for production environments because the
compiled version is faster, smaller, and more robust. Instructions for downloading and building
Pre-compiled Builds
Pre-compiled release builds of Shaka Player are available from CDNJS.com for your
convenience. For more information, visit https://cdnjs.com/libraries/shaka-player.
Test Application
Shaka provides a test app you can use for functional testing. You can tune this app by adjusting
specific URL parameters if needed. By using this app, you can determine that your own media
application running on top of Shaka is working correctly. For more information, see
http://shaka-player-demo.appspot.com/docs/tutorial-dev.html.
Diagram 4-1 shows the components for Android in Widevine DRM and how they relate to each
other.
MediaExtractor http://developer.android.com/reference/android/media/MediaExtractor.html
MediaCodec http://developer.android.com/reference/android/media/MediaCodec.html
MediaCrypto http://developer.android.com/reference/android/media/MediaCrypto.html
MediaDrm https://developer.android.com/reference/android/media/MediaDrm.html
For an example of how to use these interfaces to play DASH video, see the ExoPlayer
open-source project at http://google.GitHub.io/ExoPlayer.
ExoPlayer
The ExoPlayer project can be useful when creating native applications in the following ways:
● Reference Player
● Source Code Study
● Library Wrapper
Reference Player
The ExoPlayer can be used as an A/B reference to test your native player application. You will
be able to see if your application is functional by switching back and forth between your player
and ExoPlayer.
Source Code
You can study the ExoPlayer source code to see how the Android libraries are called.
Library Wrapper
The ExoPlayer exports methods that you can call to simplify your Android development. The
methods provide a wrapper for complicated method calls, saving you time and trouble.
Google - Confidential Version 1.2: March 6, 2017
Page 22 of 28
HTML5 Chrome in Android
Android 5+ includes a version of Chrome that supports HTML5. You can implement an HTML5
DASH and CENC video application using Encrypted Media Extensions (EME) and Media
Source Extensions (MSE). Shaka Player supports Chrome on Android. See Shaka Player
section for more information on HTML5 playback.
Google - Confidential Version 1.2: March 6, 2017
Page 23 of 28
Widevine DRM SDK for iOS
Apple iOS does not natively support Dynamic Adaptive Streaming over HTTP (DASH) or
Common Encryption (CENC). For this reason, Widevine DRM has created an SDK for iOS
developers who want to stream video using DASH with CENC. Since iOS uses the HTTP Live
Streaming (HLS) protocol instead of DASH, Widevine DRM transmuxes DASH to HLS
on-the-fly, while keeping the content protected. Widevine DRM provides the CDM Dynamic
Library to facilitate the transmuxing process.
iOS Host
The Host interface communicates with the upper layers of the iOS system and processes
application-level events and system-level services.
Protocol Buffers
The license protocol used to communicate with the License Server is a simple request-response
over HTTPS. The License Request and License Response messages are constructed and
parsed using Google Protocol Buffers.
String Encoders
A collection of high performance c-string transformations used for base64 strings.
OEMCrypto API
The purpose of OEMCrypto API is to provide an additional layer of security while handling
license information exchange. This interface defines a standard set of functions that are needed
to securely perform various license protocol operations.
Production Releases
The production release dynamic library is protected and obfuscated and does not support
jailbroken devices or run with a debugger attached to the build (including XCode). Symbols are
removed and you can only work with Widevine production License Servers.
Development Releases
If you are working with a development release, you must use the Widevine test License Server
(license.uat.widevine.com). There are two Development builds: EIT and SIM. EIT contains
obfuscation and will only run on devices; SIM will only work on simulators, not devices.
© 2017 Google, Inc. All Rights Reserved. No express or implied warranties are provided for herein. All specifications are subject to
change and any expected future products, features or functionality will be provided on an if and when available basis. Note that the
descriptions of Google’s patents and other intellectual property herein are intended to provide illustrative, non-exhaustive examples
of some of the areas to which the patents and applications are currently believed to pertain, and is not intended for use in a legal
proceeding to interpret or limit the scope or meaning of the patents or their claims, or indicate that a Google patent claim(s) is
materially required to perform or implement any of the listed items.