Exoplayer - HDCP test on Android

I first heard about ExoPlayer in an Android TV Overview presentation at Linaro Connect 2014, but I never really looked into it. The source code is available on Github, and I’ve been given ExoPlayer.apk as it can be used to test UHD H265 support, HDCP 1.x, HDCP 2.x compatibility, PlayReady & Widevine DRM using different format and so on.

ExoPlayer Demo - Click to Enlarge

ExoPlayer Demo – Click to Enlarge

So I installed it on Beelink GT1 Android TV box which I’m currently reviewing, and only include basic Widewine Level 3 DRM, and certainly does not support HDCP features.

There are 9 sections in the app to test various videos and DRM schemes:

  • YouTube Dash
  • Widevine Dash Policy Tests (GTS) – Widewine with or without HDCP, with or without secure video path
  • Widevine HDCP Capabilities Tests – NoHDCP, HDCP 1.0, HDCP 1.1, HDCP 2.0, HDCP 2.1, HDCP 2.2, and HDCP no digital output
  • Widevine Dash MP4, H264 – Various resolution (SD, HD, UHD) for clear or secure videos
  • Widevine Dash WebM, VP9
  • Widevine Dash MP4, H.265
  • SmoothStreaming – Super speed or Super speed (PlayReady)
  • HLS – Apple master playlist, Apple TS media playlist, Apple ID3 metadata, etc…
  • Misc – Various video & audio formats and codecs (MKV, FLV, Google Play videos…)

I tested a few the tests without HDCP nor secure data requirement will work just fine. Widevine secure SD (MP4, H.265) would work fine, but as expect Widevine Secure HD and UHD would not work, and only show a black screen with audio since Level 1 DRM is not supported by my device.

Then I switched to Widewine HDCP 2.2, and to my surprise the video could play… I later found out that HDCP does not kick-in immediately, and if I play the video for a longer time, the video will stop after 9 seconds because Beelink did not get the HDCP 2.2 license for their box.

AFAIC, there’s automatic testing, and each test must be started manually. But it’s still a useful if you are interested in copy protection schemes supported by your Android device.

I’ll complete the post with something unrelated with ExiPlayer, but still interesting to check HDCP support if you own an Amlogic device, as there are some commands to check the status of HDCP:

  • Show whether the TV is currently working with HDCP 2.x or HDCP 1.x:

22 = HDCP2, 11 = HDCP1, off = HDCP not enabled right now


  • Check HDCP authentication status:

1=authenticated ok, 0 = failed to authenticate.


  • HDCP keys for device

00 = no HDCP key, 14 = has HDCP1_key, 22 = has HDCP2_key


  • Check TV HDCP version

22 = TV supports HDCP2, 14 = TV supports HDCP1)


  • Disable HDCP protection:

------------------------------------------------------------------------cut line-------------------------------------------------------------

1. Choosing a Content Protection System(Clearkey,Widevine,HLS AES, PlayReady,FairPlay)

Content protection is key to a successful content monetization strategy for premium digital video publishers. When considering content protection, however, there is a delicate balance between strength of protection and the barriers it presents in reaching the viewers.

In addition to impacting user experience, there are direct and indirect technology costs, like additional development and maintenance of more complex workflows. On the flip side, more sophisticated systems can enable richer feature sets, such as offline viewing and TVE. All of these factors should be carefully considered before you commit to implementing a particular technology and workflow.

Besides DRM, there are several other options to mitigate the illicit distribution of your content. In this guide we will discuss three common approaches, including tokenization, encrypted streaming and DRM.

Tokenization

Tokenization offers a basic level of protection that can prevent most users from unauthorized viewing and sharing of content. This system works by creating a URL with a key or token that grants access, but has a short expiration period, preventing the use of that URL by other users once it has expired.

This system is simple and cheap to implement, doesn’t require any advanced software on users’ devices, and is supported almost universally. This is frequently used to implement content restrictions such as availability based on time, GeoBlocking, and IP restrictions.

Tokenization is limited in that it only protects access to the content. Once a motivated and technically proficient user gains access to the content, they are often able to capture that content using widely available tools.

Tokenization is typically implemented in conjunction with your CDN, and you should contact your CDN provider to get instructions on how to deploy this technology.

MPEG-CENC ClearKey and HLS AES Encryption

When content requires a higher degree of security, MPEG-CENC ClearKey and HLS AES Encryption, may be a good option. MPEG-CENC ClearKey is implemented as part of the Media Source Extensions (MSE) and Encrypted Media Extension (EME), which enable playback of protected content in web browsers. These content protection technologies protect the actual content themselves, scrambling the video with the AES-128 algorithm in either the CTR mode for DASH or the CBC mode for HLS (CTR and CBC modes are explained in more depth in the section on CMAF below). These systems offer several advantages over tokenization to protect your content. The first notable advantage is that encrypted content is unviewable without access to the decryption keys. Implementing an encryption does not carry any additional costs beyond its implementation, and in the case of HLS, can be implemented as sample-HLS, where only some parts of the video are encrypted, such as certain segments, rendering the video difficult or impossible to watch, but using fewer resources. These systems, however, lack the more secure key handling of DRM and do not offer some of the advanced license management or output controls that DRM systems enable.

See our tutorials for instructions on how to implement MPEG-CENC ClearKey and HLS AES Encryption.

Digital Rights Management

Digital Rights Management, or DRM, offer the highest degree of control over the viewability of your content. The most common DRM systems in the market today are: Google’s Widevine Modular (with some legacy implementations of Widevine Classic), Microsoft’s PlayReady, Apple’s FairPlay, and Adobe Primetime (a successor to Adobe Access, their flash-based DRM). Multi-DRM solution providers, like EZDRM, significantly simplify the complexities of implementing a Multi-DRM workflow to allow you to reach the broadest range of end-user devices.

DRM workflow

DRM technologies differ from other content protection methods in a number of ways, including price, complexity, user experience, compatibility, and feature set. In addition to the cost of implementation, DRM systems also have a cost of use associated with them, usually on CPM-bases. Adding to the challenge is the fact that until recently, there was not a cross-platform protection standards, requiring a different DRM technology for each platform, as well, as creating and storing separate files to support each of the environments you may be trying to deliver to (See Appendix at the end of the post for an overview of DRM Support by Platform). Some technologies also offer richer features out-of-the-box, such as offline viewing, pre-provisioning licenses, or granular control over the outputs.

One of the main benefits of using DRM over other content protection technologies is the Selectable Output Control, which enables content providers to restrict playback to unauthorized devices. This is achieved with High-bandwidth Digital Content Protection (HDCP), a copy protection scheme that in theory eliminates the possibility of intercepting digital data midstream between the source and the display. However, it is a nuanced technology with many different versions for different implementations, adding one more layer of complexity to consider when selecting content protection technology.

Overview of DRM Technology Providers

Microsoft PlayReady

Microsoft’s PlayReady DRM is one of the most widely implemented DRM technologies, supporting MPEG-DASH with AES-128 in CTR mode (and recently CBC mode as discussed in the section below on CMAF) and Microsoft Smooth Streaming to web environments and many Smart TVs and web-enabled connected devices. PlayReady also offers sophisticated rights management, enabling the pre-distribution of licenses, rental windows that expire licenses after a certain timeframe after they are first accessed, and offline viewing capabilities, which can be particularly appealing to users who want to watch content on planes or other situations where they don’t have reliable access to broadband internet.

Google Widevine

Google widevineGoogle’s Widevine system comes in two versions: Widevine Classic, and Widevine Modular. Widevine Classic has been End-of-Lifed by Google, meaning it will no longer receive new functionality. It requires a proprietary packaging format, and is rarely used outside of older Android devices (pre-4.4/Kitkat). It has little usage in the US, and is primarily seen in legacy devices in Asia.

Widevine Modular

Widevine Modular is Google’s successor to Widevine Classic. The Widevine Modular system is broadly supported today in Chrome web browsers and Android devices. Widevine Modular can be deployed on the web with MPEG-DASH with CENC, using the same renditions, encrypted with the same AES-128 in CTR mode, or CBC mode, and packaged in the same fragmented MP4 containers as Microsoft PlayReady, making them broadly compatible. The only difference in embedding process is the exchange of the keys made by a request to a different license server URL. There are no additional files that need to be stored on your origin to support this. Widevine also supports hardware security, which allows accelerated decryption, reducing CPU usage and enabling playback of Ultra High Definition content on devices that would otherwise be unable to do so.

Apple FairPlay

Apple FairplayApple’s choice of DRM technology is FairPlay. FairPlay provides many of the same advantages of other DRM offerings, and some additional degree of flexibility, but at the cost of a more complex implementation. FairPlay is only supported in Apple products, requires a direct relationship with Apple as a registered developer, and can only be used for streaming HLS video. FairPlay uses the AES-128 encryption algorithm in CBC mode, either in MPEG2 Transport Stream, or more recently, fragmented MP4 containers. This use of CBC mode has previously required either JIT encryption or a separate set of files on your storage to enable as they are incompatible with files encrypted with CTR mode. FairPlay also does not provide any of the advanced rights management that other technologies do out-of-the-box, such as licensing windows and offline capabilities, and functions for this must be built by your development team.

Legacy Systems

DRM has been around for some time, and as a result, there are legacy systems in the market that initially enabled these workflows, but have become deprecated and will soon disappear from the limited places that still use them. The most notable of these technologies are Microsoft’s Silverlight, which combined PlayReady and Smooth Streaming in a browser plugin to enable web playback, and was previously made popular by Netflix as their web DRM of choice. Adobe Access, implemented in Flash was another common legacy DRM system that has nearly disappeared from the market.

Open Systems

Open system, primarily in the form of HTML5 Media Source Extensions (MSE) and Encrypted Media Extensions (EME), are winning. Users, wary of malware, mandatory updates, bugs and security holes, are unwilling to install proprietary software and browser extension to support the playback of secured content. The adoption of fragmented MP4 and MPEG-DASH for playback by both Microsoft and Google means that these workflows can be significantly simplified, and users can access your content on their device of choice, without requiring replication of efforts to support them. The further support of CMAF conventions, Apple’s plan to support fragmented MP4, continues to reduce the need for replication in these workflows.

Implementing a DRM Workflow

DRM encryption may be implemented during two points in the workflow – during the encoding and packaging process or dynamically, just-in-time (JIT). JIT DRM advantages include added security with key rotation (e.g. rotating keys weekly or daily) and bandwidth savings, since you only need to keep one set of renditions on your storage. However, this approach adds complexity to the system, presenting another opportunity for failure, and leaves unencrypted files vulnerable to unauthorized access during transfer and storage. In addition, JIT encryption has ongoing costs associated with it, as the content must be encrypted again each time it is pulled. The advantages of JIT encryption will likely become irrelevant in the near future, as standardization reduces the need for the replication of files.

Bitmovin’s preferred method for implementing DRM is on the encode side. For details, please see our tutorials on setting up Google Widevine, Microsoft PlayReady, Apple FairPlay, and Multi-DRM systems.

On the playback side, the DRM workflow is initiated with the user requesting playback of a particular item of content. This causes the player to make a request to the DRM License Server, which is typically a proxy server that then checks with your servers to validate the entitlements for a given user. Once that request is validated, the License Server will return a key, enabling playback within the parameters that the user has been authorized for.

Note about Testing DRM Workflows: 

  • When testing your implementation, a few things are handy to keep in mind: it is perilous to attempt to test DRM in a Virtual Machine. Though VMs make it easy to develop for multiple environments, they have mixed support for DRM, as DRM requires hardware-level validation. Some VMs support this, some do not, and ensuring that this is properly configured is very challenging.
  • Another common mistake in testing a DRM workflow can also occur in the HDCP signal chain – many computers use monitors hooked up by DVI, which has less support for HDCP than HDMI, and may not be something you think of checking while testing.

Common Media Application Format (CMAF)

The last topic covered during the session was the Common Media Application Format, or CMAF, a new collection of standards that has the potential to reduce the resources and simplify the deployment of multimedia and DRM protected content.

The CMAF standard, which was initially brought about as a collaboration between Apple and Microsoft, specifies several technologies required to deliver content to users. The most notable of these for this discussion is the use of ISO fragmented MP4, or fMP4 container, which has separate boxes for each of the video and audio fragments, which can then be called from the manifest using byte-ranges or stored as separate segments. Apple announced support for fMP4 at WWDC 2016. Though they still require the use of HLS .m3u8 manifests to address these segments, a separate manifest has a much smaller storage footprint than a separate set of video files.

Another good news for distributors of DRM protected content has to do with the mode of encryption. Apple’s FairPlay DRM technology leverages AES-128 with the Cipher Block Chaining (CBC) mode of encryption, where the Initialization Vector, a variable used in the computation of the encrypted output, is generated from the previously encrypted data. Google’s and Microsoft’s implementations of AES-128 in their DRM systems, use Counter (CTR) mode, in which a non-repeating variable is used for this purpose. Recently though, Google has added support for CBC in Widevine, and Microsoft announced in April 2017 that they are adding support for CBC mode to PlayReady encrypted content. While the end result of this has yet to be seen in practice, we may very well be able to implement DRM with a single set of media files (though still two manifests) in the near future!

Conclusion

Content protection, especially DRM, is a highly complicated subject, with many aspects to consider from business and technical perspective, including cost, complexity, user experience, and of course, protection of the content. Recent developments in file format and encryption standards give something to be hopeful for: a prospect of a simplified and cost effective workflow to deliver protected content! Bitmovin maintains integrations with all major multi-DRM solution providers for easy and reliable implementation of premium content protection for publishers.

Test it out with a free trial account!

 

 

Appendix

DRM Support by Platform

Web Browsers

Mobile Platforms

OTT Streaming Devices

Connected TVs and Gaming Consoles

来源:网络


智能推荐

test quic bbr on ns3

 The network congestion control mechanism is the most important component in computer network. Ever since the Internet has experienced collapse[1], to work out solution to avoid network into cong...

Introduction on Using Hamcrest Unit Test Framework

 Hamcrest is a unit test framework, the assert function assertThat of hamcrest is more human readable comparing to the assert function of Junit, therefore, Junit4 has already adopted and integrat...

display:HDCP协议简述

传输数字内容时,容易受到未经授权的复制和拦截。保护​​内容已经成为视听内容传输中的重要因素。 2003年,英特尔开发了一种加密技术,称为高带宽数字内容保护(High-bandwidth Digital Content Protection:HDCP)协议,用于保护发送器(发送诸如蓝光播放器之类的视听内容)和接收器(如显示屏)之间的音频和视频数据。如果发送设备正在发送受保护的HDCP内容,则接收器还...

idea中maven install报错:test (default-test) on project webgis: There are test failures

1、如下图提示maven install报错test (default-test) on project webgis: There are test failures 2、该错误是因为项目中有测试类,测试代码时遇到错误停止编译,如下图测试类中引入org.junit.jupiter.api.Test包报错: 3、解决方式一 File -> Settings -> Build,Excec...

防坑指南【1】-Log4j中MDC的正确用法

投身IT,不是在踩坑路上,就是在往坑的路上。手握指南,犹如茫茫大海中,而不至于饿船毁人亡。 阅读全文: http://gitbook.cn/gitchat/activity/5e663433b2e56b0d65b51006 您还可以下载 CSDN 旗下精品原创内容社区 GitChat App ,阅读更多 GitChat 专享技术内容哦。...

猜你喜欢

Android中EditText(或TextView)中的InputType类型含义与如何定义

【背景】 经过一些Android中EditText方面的折腾: 【已解决】android中的EditText控件没有获得焦点但是输入法却弹出显示->Activity中不要默认就显示输入法 【暂未去解决】Android中EditText如何在失去焦点后让输入法消失 【已解决】Android中EditText点击获得焦点后无法显示输入法键盘 然后对于EditText(或TextView)中的In...

mysql数据库

一.mysql整体架构图 1、连接器(管理连接、权限验证) 连接器负责跟客户端建立连接、获取权限、维持和管理连接,数据库里面,长连接是指连接成功后,如果客户端持续有请求,则一直使用同一个连接。短连接则是指每次执行完很少的几次查询就断开连接,下次查询再重新建立一个。 建立连接的过程通常是比较复杂的,所以我建议你在使用中要尽量减少建立连接的动作,也就是尽量使用长连接。 但是全部使用长连接后,你可能会发...

pycharm如何高效导入和管理包

之前看许多人都推荐用anaconda,说是各种常用包都有啦如何如何,但其实呢用pycharm完全可以实现DIY自己需要的包,并且生成通用的虚拟环境。 步骤如下: File->Settings->Project Interpreter->设置->Add 点OK确认,之后就可以愉快地添加需要的包,并且在新工程里面也可以使用啦~!...

何为数字证书?

如果不了解非对称加密和数字证书,建议先去看下这两篇文章 何为非对称加密? 何为数字签名? 正常情况下,A向B索要B的public key B直接给A就行了 在不安全的情况如下: 后续的过程和何为数字签名?里的流程一样, 不同的是A以为自己的消息发给B了,并且数字签名什么的都完好 实际上却是和C在通信 为了证明自己收到的public key是B的 A要求B到"证书中心"(cert...

win10系统下安装Consul

一、了解 二、下载和安装 1、下载 2、安装 三、使用 一、了解 Consul 是一个支持多数据中心分布式高可用的服务发现和配置共享的服务软件。 默认端口号是:8500 二、下载和安装 1、下载 1)、百度搜索 consul,点开第一个。 2)、点击 Download下载 3)、根据自己的win版本下载,我的是 64bit 2、安装 把下载的文件解压出来,根据自己的情况选择路径。我把consul....

问答精选

Mixing apples and oranges :3 odoo8

I'm trying to send notification to employees, i created a computed many2many field to get the partners id and pass them to partner_ids field of the mail.wizard.invite model. here is my inherited class...

Seeking algo for text diff that detects and can group similar lines

I am in the process of writing a diff text tool to compare two similar source code files. There are many such "diff" tools around, but mine shall be a little improved: If it finds a set of l...

Using 3D objects in an iOS app

How would I go about adding a 3D object from Maya into an iOS app? For now, before it gets too complicated, I just want to add it in, no response to touch yet. Is there a tutorial about this? Thanks! ...

Using component area to show various content

I have a relatively simple task although I am just a beginner so it's difficult to proceed. I have a list of users on the left and a right panel to show that users info. The information about the user...

How to create numeric routes in ASP.NET Core MVC

I want to have a URL path pattern like this: Both first segment and the second segment are composed of integer values. In case this pattern is not met, I want routing to fallback to the default {contr...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答