Skip to content

Commit

Permalink
Merge branch 'master' into copyedit-chs
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromoreira authored Jul 15, 2017
2 parents e36c582 + 4e826cc commit d3dbc40
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 9 deletions.
66 changes: 60 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ cd digital_video_introduction
All the **hands-on should be performed from the folder you cloned** this repository. For the **jupyter examples** you must start the server `./s/start_jupyter.sh` and copy the URL and use it in your browser.

# Changelog

* added DRM system
* released version 1.0.0
* added simplified Chinese translation

# Index

- [Intro](#intro)
Expand Down Expand Up @@ -123,9 +129,9 @@ Finally, we can define a **video** as a **succession of *n* frames** in **time**

![video](/i/video.png "video")

The number of bits per second needed to show a video is its **bit rate**.
The number of bits per second needed to show a video is its **bit rate**.

> bit rate = width * height * * bit depth * frames per second
> bit rate = width * height * * bit depth * frames per second
For example, a video with 30 frames per second, 24 bits per pixel, resolution of 480x240 will need **82,944,000 bits per second** or 82.944 Mbps (30x480x240x24) if we don't employ any kind of compression.

Expand Down Expand Up @@ -233,7 +239,7 @@ These schemas are known as subsampling systems and are expressed as a 3 part rat

> An exception to this exists with 4:1:0, which provides a single chroma sample within each `4 x 4` block of luma resolution.
Common schemes used in modern codecs are: **4:4:4** *(no subsampling)***, **4:2:2, 4:1:1, 4:2:0, 4:1:0 and 3:1:1**.
Common schemes used in modern codecs are: **4:4:4** *(no subsampling)***, **4:2:2, 4:1:1, 4:2:0, 4:1:0 and 3:1:1**.

> **YCbCr 4:2:0 merge**
>
Expand Down Expand Up @@ -731,11 +737,60 @@ HEVC has bigger and more **partitions** (and **sub-partitions**) options than AV

## Content protection

We can use **a simple token system** to protect the content. The user without a token tries to request a video and the CDN forbids her or him while a user with a valid token can play the content, it works pretty similarly to most of the web authentication systems.

![token protection](/i/token_protection.png "token_protection")

The sole use of this token system still allows a user to download a video and distribute it. Then the **DRM (digital rights management)** systems can be used to try to avoid this.

![drm](/i/drm.png "drm")

[TODO]
In real life production systems, people often use both techniques to provide authorization and authentication.

### DRM
#### Main systems

* FPS - [**FairPlay Streaming**](https://developer.apple.com/streaming/fps/)
* PR - [**PlayReady**](https://www.microsoft.com/playready/)
* WV - [**Widevine**](http://www.widevine.com/)


#### What?

DRM means Digital rights management, it's a way **to provide copyright protection for digital media**, for instance, digital video and audio. Although it's used in many places [it's not universally accepted](https://en.wikipedia.org/wiki/Digital_rights_management#DRM-free_works).

#### Why?

Content creator (mostly studios) want to protect its intelectual property against copy to prevent unauthorized redistribution of digital media.

#### How?

We're going to describe an abstract and generic form of DRM in a very simplified way.

Given a **content C1** (i.e. an hls or dash video streaming), with a **player P1** (i.e. shaka-clappr, exo-player or ios) in a **device D1** (i.e. a smartphone, TV, tablet or desktop/notebook) using a **DRM system DRM1** (widevine, playready or FairPlay).

The content C1 is encrypted with a **symmetric-key K1** from the system DRM1, generating the **encrypted content C'1**.

![drm general flow](/i/drm_general_flow.jpeg "drm general flow")

The player P1, of a device D1, has two keys (asymmetric), a **private key PRK1** (this key is protected<sup>1</sup> and only known by **D1**) and a **public key PUK1**.

> **<sup>1</sup>protected**: this protection can be **via hardware**, for instance, this key can be stored inside a special (read-only) chip that works like [a black-box](https://en.wikipedia.org/wiki/Black_box) to provide decryption, or **by software** (less safe), the DRM system provides means to know which type of protection a given device has.

When the **player P1 wants to play** the **content C'1**, it needs to deal with the **DRM system DRM1**, giving its public key **PUK1**. The DRM system DRM1 returns the **key K1 encrypted** with the client''s public key **PUK1**. In theory, this response is something that **only D1 is capable of decrypting**.

`K1P1D1 = enc(K1, PUK1)`

**P1** uses its DRM local system (it could be a [SOC](https://en.wikipedia.org/wiki/System_on_a_chip), a specialized hardware or software), this system is **able to decrypt** the content using its private key PRK1, it can decrypt **the symmetric-key K1 from the K1P1D1** and **play C'1**. At best case, the keys are not exposed through RAM.

```
K1 = dec(K1P1D1, PRK1)
P1.play(dec(C'1, K1))
```

![drm decoder flow](/i/drm_decoder_flow.jpeg "drm decoder flow")

# How to use jupyter

Expand Down Expand Up @@ -790,7 +845,7 @@ Software:

Non-ITU Codecs:

* https://aomedia.googlesource.com/
* https://aomedia.googlesource.com/
* https://github.com/webmproject/libvpx/tree/master/vp9
* https://people.xiph.org/~xiphmont/demo/daala/demo1.shtml
* https://people.xiph.org/~jm/daala/revisiting/
Expand Down Expand Up @@ -868,4 +923,3 @@ Miscellaneous:
* https://www.youtube.com/watch?v=LFXN9PiOGtY
* https://www.youtube.com/watch?v=Lto-ajuqW3w&list=PLzH6n4zXuckpKAj1_88VS-8Z6yn9zX_P6
* https://www.youtube.com/watch?v=LWxu4rkZBLw

Binary file added i/drm_decoder_flow.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added i/drm_general_flow.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions simplified-chinese/README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ cd digital_video_introduction
* 发行版本 1.0.0
* 新增中文翻译

# 更新日志

* 添加 DRM 系统
* 发布版本 1.0.0
* 添加简体中文翻译

# 目录

- [介绍](#介绍)
Expand Down Expand Up @@ -95,8 +101,10 @@ cd digital_video_introduction
>
> ![NES palette](/i/nes-color-palette.png "NES palette")

例如以下几张图片。第一张包含所有颜色平面。剩下的分别是红、绿、蓝色平面(显示为灰调)(译注:颜色强度高的地方显示为亮色,强度低为暗色)。


![RGB channels intensity](/i/rgb_channels_intensity.png "RGB channels intensity")

我们可以看到,对于最终的成像,红色平面对强度的贡献更多(三个平面最亮的是红色平面),蓝色平面(最后一张图片)的贡献大多只在马里奥的眼睛和他衣服的一部分。所有颜色平面对马里奥的胡子(最暗的部分)均贡献较少。
Expand Down Expand Up @@ -747,7 +755,6 @@ HEVC 比 AVC 有更大和更多的**分区**(和**子分区**)选项,更
* PR - [**PlayReady**](https://www.microsoft.com/playready/)
* WV - [**Widevine**](http://www.widevine.com/)


#### 是什么

DRM 指的是数字版权管理,是一种**为数字媒体提供版权保护**的方法,例如数字视频和音频。尽管用在了很多场合,但它并[没有被普遍接受](https://en.wikipedia.org/wiki/Digital_rights_management#DRM-free_works).
Expand Down Expand Up @@ -776,11 +783,11 @@ DRM 指的是数字版权管理,是一种**为数字媒体提供版权保护**

**P1** 使用它的本地 DRM 系统(这可以使用 [SoC](https://zh.wikipedia.org/wiki/系统芯片) ,一个专门的硬件和软件,这个系统可以使用它的私钥 PRK1 用来**解密**内容,它可以解密被加密过的**K1P1D1 的对称密钥 K1**。理想情况下,密钥不会被导出到内存以外的地方。

```
```
K1 = dec(K1P1D1, PRK1)
P1.play(dec(C'1, K1))
```
```

![DRM 解码流程](/i/drm_decoder_flow.jpeg "DRM 解码流程")

Expand Down

0 comments on commit d3dbc40

Please sign in to comment.