Slide 1

Slide 1 text

Building a Video Encoding Pipeline at The New York Times Streaming Media West, 2016

Slide 2

Slide 2 text

Maxwell Dayvson Da Silva Sr. Director of Engineering http://github.com/dayvson http://twitter.com/dayvson http://dayvson.me

Slide 3

Slide 3 text

Flávio Ribeiro Sr. Software Engineer http://github.com/flavioribeiro http://twitter.com/flavioribeiro http://flavioribeiro.com

Slide 4

Slide 4 text

First, a little bit of history

Slide 5

Slide 5 text

The Architecture of the old system Video CMS (StoryLog) NYTimes CMS (Scoop) Internal Encoding Cluster Internal Storage CDN

Slide 6

Slide 6 text

The flaws

Slide 7

Slide 7 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders 3. Unstable transcoding 4. Hard to scale 5. Two CMSs are required to publish a video.

Slide 8

Slide 8 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders (hard to maintain) 3. 4. Unstable transcoding (proprietary software) 5. Hard to scale (cluster in-house) 43380_1_saudi-documentary_wg_720p.mp4

Slide 9

Slide 9 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders (hard to maintain) 3. Unstable transcoding (proprietary software) 4. Hard to scale (cluster in-house) 43380_1_saudi-documentary_wg_720p.mp4 Production ID

Slide 10

Slide 10 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders (hard to maintain) 3. Unstable transcoding (proprietary software) 4. Hard to scale (cluster in-house) 5. 43380_1_saudi-documentary_wg_720p.mp4 Version

Slide 11

Slide 11 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders (hard to maintain) 3. Unstable transcoding (proprietary software) 4. Hard to scale (cluster in-house) 43380_1_saudi-documentary_wg_720p.mp4 Slug

Slide 12

Slide 12 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders (hard to maintain) 3. Unstable transcoding (proprietary software) 4. 5. Hard to scale (cluster in-house) 43380_1_saudi-documentary_wg_720p.mp4 Resolution

Slide 13

Slide 13 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders 3. Unstable transcoding 4. Hard to scale 5. Two CMS to publish a video

Slide 14

Slide 14 text

The Flaws 1. Filenames 2. Several watch folders 3. U 4. Hard to scale (cluster in-house)

Slide 15

Slide 15 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders 3. Unstable transcoding 4. Hard to scale 5. Two CMS to publish a video

Slide 16

Slide 16 text

The Flaws

Slide 17

Slide 17 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders 3. Unstable transcoding 4. Hard to scale 5. Two CMS to publish a video

Slide 18

Slide 18 text

Number of videos published per year.

Slide 19

Slide 19 text

The Flaws 1. The whole process relies on a filename 2. Several watch folders 3. Unstable transcoding 4. Hard to scale 5. Two CMSs to publish a video

Slide 20

Slide 20 text

The challenges

Slide 21

Slide 21 text

The Challenges 1. Fast encoding. News Clips are very time sensitive 2. Scalability 3. Reliability 4. Company-wide video transcoding solution 5. High-quality transcoding ○ 360°, Drone footage, Live Action

Slide 22

Slide 22 text

The solution

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

The Video Pipeline Distribution API Acquisition API Transcoding API Storage Media Factory Client Media Factory API CDN Database

Slide 25

Slide 25 text

Media Factory Client Distribution API Acquisition API Transcoding API Storage Media Factory Client Media Factory API Database CDN

Slide 26

Slide 26 text

Media Factory Client 1. EcmaScript 6 Library 2. Upload Files from Browser to S3 ○ http://github.com/TTLabs/EvaporateJS 3. Trigger Jobs on Media Factory API 4. Used by other teams

Slide 27

Slide 27 text

Acquisition API Distribution API Acquisition API Transcoding API Storage Media Factory Client Database Media Factory API CDN

Slide 28

Slide 28 text

Acquisition API 1. Back-end integration to upload files ○ External partners 2. Plan to support resumable uploads

Slide 29

Slide 29 text

Database Media Factory Client Storage Media Factory API Distribution API CDN Acquisition API Transcoding API Media Factory API

Slide 30

Slide 30 text

Media Factory API 1. All NYTimes business logics ○ Interact with our internal APIs ○ Define which presets will be used based on job type (Standard, 360) ○ http://github.com/nytimes/video-presets

Slide 31

Slide 31 text

Transcoding API Distribution API Acquisition API Transcoding API Storage Media Factory Client Media Factory API CDN Database

Slide 32

Slide 32 text

Transcoding API 1. Integration with multiple encoding cloud services 2. Reliability & Scalability 3. Define a common Job specification 4. Define a common Preset specification

Slide 33

Slide 33 text

Transcoding API - Job Example { "provider": "elastictranscoder", "source": "s3://somebucket/folder/my_video.mov", "streamingParams": { "playlistFileName": "hls/playlist.m3u8", "segmentDuration": 5, "protocol": "hls" } "outputs": [ {"preset": "720p_mp4", "fileName": "my_video_720p.mp4"}, {"preset": "1080p_mp4", "fileName": "my_video_1080p.mp4"}, {"preset": "256p_hls", "fileName": "hls/my_video_480p.m3u8"}, {"preset": "480p_hls", "fileName": "hls/my_video_480p.m3u8"}, {"preset": "720p_hls", "fileName": "hls/my_video_720p.m3u8"}, {"preset": "1080p_hls", "fileName": "hls/my_video_1080p.m3u8"}, {"preset": "2160p_hls", "fileName": "hls/my_video_2160p.m3u8"} ] }

Slide 34

Slide 34 text

Transcoding API - Preset Example "providers": ["elastictranscoder", "elementalconductor", "encodingcom", "zencoder"], "preset": { "name": "sample_preset", "description": "This is an example preset", "container": "mp4", "profile": "Main", "profileLevel": "3.1", "rateControl": "VBR", "video": { "height": "720", "width": "1080", "codec": "h264", "bitrate": "1000000", "gopSize": "90", "gopMode": "fixed", "interlaceMode": "progressive" }, "audio": { "codec": "aac", "bitrate": "64000" }

Slide 35

Slide 35 text

Transcoding API 1. Integration with multiple encoding cloud services 2. Reliability & Scalability 3. Define a common Job specification 4. Define a common Preset specification 5. http://nyti.ms/mediafactory

Slide 36

Slide 36 text

The Distribution API Database Media Factory API Distribution API Acquisition API Media Factory Client Transcoding API Storage CDN

Slide 37

Slide 37 text

Distribution API 1. Fast file transfer leveraging Aspera protocol 2. Plan to support distribution to our partners ○ Youtube, Facebook, other partners 3. Plan to support to multiple CDNs

Slide 38

Slide 38 text

Just a recap! Distribution API Acquisition API Transcoding API Storage Media Factory Client Media Factory API CDN Database

Slide 39

Slide 39 text

Future 1. Video Quality ○ Classify into groups ○ VMAF, Reingest on the Media Factory API 2. Open Source ○ Distribution API ○ Acquisition API 3. Snickers (http://github.com/snickers/snickers)

Slide 40

Slide 40 text

We’re hiring nyti.ms/technology @NYTDevs | developers.nytimes.com

Slide 41

Slide 41 text

Stay updated open.blogs.nytimes.com @NYTDevs | developers.nytimes.com

Slide 42

Slide 42 text

Connect with us on Slack! http://video-dev.org @NYTDevs | developers.nytimes.com

Slide 43

Slide 43 text

Thank you! { , } /flavioribeiro { , } /dayvson