the future is video - o'reilly mediaassets.en.oreilly.com/1/event/13/the future is video...

61
The Future Is Video Jonathan Conway vzaar.com 1

Upload: trankhuong

Post on 11-Aug-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

The Future Is VideoJonathan Conway

vzaar.com

1

Page 2: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Who Am I?

2

Page 3: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

3

Page 4: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

4

Page 5: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

5

My little blog at http://www.jaikoo.com. And yes I registered jaikoo.com in 2001, years before the jaiku guys came along.

Page 6: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

jaikoo / noodlesinmysandals

6

Page 7: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Boring!

7

Page 8: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Why Video?

8

Page 10: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

MTV

10

Page 12: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

12

YouTube came along and took the video industry by storm. User generated/submitted content exploded on the web.

Page 13: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

13

Suddenly everyone could become a star! *does jazz hands*

Page 14: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

14

Brother Bobby dramatically increased his sales by utilising video in his eBay auctions. Video strengthens trust and enriches the sales experience, especially for high priced goods.

Page 15: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

15

Everyones now realised that adding video to a website can increase user retention and participation

Page 16: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

http://flickr.com/photos/akahige/126473337/

16

YouPorn has become one of the most trafficked sites on the net. Their traffic stats have been growing exponentially. It seems porn and video really does sell especially when it’s user generated/submitted

Page 17: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Options?

17

Page 18: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Commercial

• Zencoder - Self hosted or Pay per encode

• Encoding.com

• Sesame Vault

• Hey! Watch

• vzaar

• YouTube

18

Page 19: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Avoid the pain!

• Time

• Cost

• Re-inventing the wheel

19

Page 20: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

supporting video codecs is teh suck

20

I once wasted a couple of days trying to hunt down a video codec problem related to a codec that hadn’t been used since 2001 by a now defunct web cam manufacturer.

Page 21: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Roll Your Own

21

Page 22: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Merb / Ramaze

22

Page 23: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

“Apart from thread safety, they’re

lightweight and perfect for resource intensive

apps”23

Yep, I know Rails 2.2 is thread safe but you really don’t need all the extra baggage for a light weight application that accepts uploads. You’re able to utilize limited resource far better by using Merb or Ramaze.

Page 24: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

24

Previous setup:Expensive F5’s distributing sticky sessions to a group of Merbs. Costly and pushes more resource requirements onto the Uploader apps/Merb’s because of the high CPU requirements of the Merb upload progress plugin. Ruby uses a lot of CPU for parsing MIME boundaries.

Page 25: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

FAIL

25

Page 26: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Nginx upload progress module

http://wiki.codemongers.com/NginxHttpUploadProgressModule

26

Page 27: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

27

No sticky sessions required now. Cheaper to scale thanks to Nginx.

Page 28: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Messaging

28

Page 29: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Queues

• Build your own - Use a database?

• ActiveMQ

• Starling

• Beanstalk

• RabbitMQ

29

Page 30: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Build your own

• OK for small to medium traffic

• No special skills required

• Infrastructure is already there

30

Page 31: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Build your own

• Re-inventing the wheel

• Activerecord based queues suck. That is all.

• Scaling the database... Boring

• Golden pneumatic drill

31

Page 32: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

ActiveMQ

• Tried and tested

• Rails/Ruby support

• STOMP adaptors

• Persistent

32

Page 33: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

ActiveMQ

• Can be slow(er) compared to others

• Looses messages?

• Quite fat

33

I noticed ActiveMQ to ‘loose’ message under high load.

Page 34: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Beanstalk

• Ruby support and bindings for other languages

• Its fast! Bloody fast!

• Proven in high transaction environments

• 35 million transactions a month at Reevoo, 10 instances of Beanstalked, 100% uptime.

34

Page 35: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Beanstalk

• Not clusterable? But it’s fast enough.

• Non persistent queues.

35

Page 36: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Starling

• Nothing to learn, it’s Memcache API.

• It’s Ruby so nothing else to install.

• Persistent queues.

36

Page 37: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Starling

• Performance is average. Slows down after a while.

37

Page 38: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

RabbitMQ

• Easy to install

• Persistent queues

• Clusterable

• It’s built on Erlang. It’s designed for messaging.

• Fast!

38

Page 39: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

RabbitMQ

• It’s Erlang?

39

Although I love Erlang, some people don’t like having mixed language environments.

Page 40: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

AMQPAman Gupta

git://github.com/tmm1/amqp.git

40

Kick ass Event Machine based AMQP client

Page 41: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Encoders

41

Page 42: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

RVideohttp://rvideo.rubyforge.org

42

Page 43: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

• Inspect video properties

• Execute encoding “recipes” via FFmpeg, Mencoder et al

• Encoding progress

• Letterboxing

43

Page 44: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Use a Supervisor daemon to herd the

encoders

44

Page 45: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Dedicated

• More bang per buck in the short term

• Hard to scale

• Expensive in the long term

45

Page 46: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Cloud

• Can be expensive in the short term

• Cheaper in the long term

• Dynamically resize your encoding nodes

46

Page 47: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

47

Page 48: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

It’s all in the API

• Joyent, EY, GoGrid, FlexiScale limited or no API.

• They’re ‘ticket’ based clouds

• AWS on the other hand allows you to dynamically grab and release resources as required.

48

FlexiScale aka FlexiFail has been experiencing a large number of stability problems. Engine Yard is apparently close to releasing an API, though I don’t know how comprehensive this will be.

Page 49: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

• Right Scale

• Scalr

• Pool party

• Eucalyptus

Managing your cloud

49

Eucalyptus is interesting because it’s trying to provide an abstraction layer not just for EC2 but for any cloud that supports an API. One to look out for in the future.

Page 50: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Storage and Content Delivery

50

Page 51: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Pay Akamai / Limelight

51

Page 52: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

The problem

• Storage is painful to manage (if you ignore ZFS for the minute)

• It’s expensive to continually buy/host more disks

• Need to get video files as geographically close to the client as possible

52

Page 53: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Solution

• Amazon S3 (again)

• S3 storage is cheap, bandwidth is expensive

• It’s had downtime though

• Limited geographic caching

53

Page 54: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Poor Mans CDN

• Based on an idea from Wordpress.com, but with edge caching.

• More resilient to S3 outages

• Can be cheap in the short term

• Joyent has a 10TB data party w00t!

54

Page 55: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

55

Page 56: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

I’m in yer Merbs checking out your

hawtness

56

Page 58: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Open Source

58

Page 59: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

Pandahttp://github.com/newbamboo/panda/tree/master

59

Page 60: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

• Uses RVideo, S3, SimpleDB, EC2

• REST based

• SimpleDB as the queue/data store

• Used at Amnesty

60

Page 61: The Future Is Video - O'Reilly Mediaassets.en.oreilly.com/1/event/13/The Future is Video Presentation.pdf · 12 YouTube came along and took the video industry by storm. User generated/submitted

http://www.protectthehuman.com/

61

Panda’s been successfully deployed on this site. Go check it out, it rocks!