recording and media manipulation of webrtc streams

37

Upload: luis-lopez

Post on 02-Jul-2015

904 views

Category:

Internet


3 download

DESCRIPTION

This presentation introduces Kurento technologies to developers at the WebRTC Conference & Expo 2014 in San Jose. It focuses on Kurento Client APIs and on its capabilities for recording and manipulating the audio and video streams in WebRTC sessions.

TRANSCRIPT

Page 1: Recording and media manipulation of WebRTC streams
Page 2: Recording and media manipulation of WebRTC streams

Developing WebRTC applications with advanced media processing

Luis Lopez

[email protected]

www.kurento.org

Page 3: Recording and media manipulation of WebRTC streams

WebRTC infrastructures: at the heart of the long tail

Peer-to-Peer WebRTC Application (without media infrastructure)

WebRTC video stream

WebRTC Application based on media infrastructure

media infrastructure

Page 4: Recording and media manipulation of WebRTC streams

WebRTC media servers: the simplest WebRTC infrastructure

• Media server– Monolithic software

– Based on shared memory

– Scales well vertically

– Can’t scale horizontally

• Media server vendors– Software vendors

– Hardware vendors

Page 5: Recording and media manipulation of WebRTC streams

WebRTC media server vendors

Page 6: Recording and media manipulation of WebRTC streams

Common functions of WebRTC media serversTranscoding media server

VP8 H.264

MCU/SFU media server

Recording media server

Page 7: Recording and media manipulation of WebRTC streams

Evolution of media servers: functionalityWhat common WebRTC Media Servers do:• Transcoding• MCU• Recording

What future MediaServers will do:• Flexible processing• Augmented reality• Blending• Mixing• Analyzing• Etc.

Media ishere

Media goesthere

TranscodingMCU/SFURecording

Current media servers

Media ishere

Rich Mediagoes there

Future media servers

Media Events

Transcoding, MCU/SFU,Recording,

Enrich,Augment, Analyze,

Combine,Transform,Adapt, …

ContextContent

Commands

Page 8: Recording and media manipulation of WebRTC streams

Why is this important?

Implicit augmentationwith external knowledge

Explicit augmentationwith target information

Why do you communicate? To see other’s face?

WebRTC convergence with TelcoWhy don’t converge with Content?

Page 9: Recording and media manipulation of WebRTC streams

Kurento Media Server: an open source software WebRTC media server

SendReceiveAnalyze

AugmentEnrich

TransformTranscode

RecordProcess

Replicate

MediaSource

MediaSink

KMS

JavaAPI

JavaScriptAPI

Otherlanguages

Applications define the processingof streams getting through KMS

Page 10: Recording and media manipulation of WebRTC streams

What does Kurento mean?

Page 11: Recording and media manipulation of WebRTC streams

Kurento History

2012

•Kurento goes open source LGPL v2.1. Professional services provided by Naevatec(startup)

June’13

•1M€ of investment for providing multimedia capabilities to FI-WARE

Dec’13

•Kurento Featured at WebRTC Expo (Paris)

Feb’14

•3.3M€ of investment for making Kurento an elastic cloud platform (NUBOMEDIA)

April’14

•Kurento featured at IMS World Conference (Barcelone)

July’14

•Kurento featured at DevCon5 (New York)

Sep’14

•500K€ of investment for maintenance of Kurento FI-WARE APIs

Page 12: Recording and media manipulation of WebRTC streams

Kurento Client API

Sink

SRC Sink

SRC

SRC

Sink

Sink

Media Element

• Provides a specific media

functionality

› Send/receive media

› Process media

› Transform media

• Exchange media through

› Sources

› Sinks

Media pipeline

• Chain of media elements

implementing the desired media

logic.

• The Media API provides the

capability of creating media

pipelines by joining media

elements of the toolbox

Media Element

Sin

k

SRC

Page 13: Recording and media manipulation of WebRTC streams

Creating applications: the Lego game

Protocols&Codecs

ComputerVision

AugmentedReality

Mul sensoryMul media

MediaRepository

IPTVIntegra on

GroupCommunica ons

Sink%

H pEndpoint

Sink%

SRC%

RtpEndpoint

SRC$

DataChannelEndpoint

Sink%

SRC%

WebRtcEndpoint

Sink%

SRC%

BarCodeReader

Sink%

SRC%

PointerTracker

Sink%

SRC%

FaceDetector

Sink%

SRC%

FaceOverlay

Sink%

SRC%

ChromaFilter

Sink%

SRC%

HeartRateBlender

Sink%

RecorderEndpoint

SRC$

PlayerEndpoint

Sink%

CdnUpload

Sink%

IPTVConnector Mixer

Sink

SRC Sink

SRC

Sink

SRC

Sink

Sink

Application 2

Sink

SRC

Sink

SRC

SinkSink

SRC

Sink

Application 3

Sink

SRC

SRC

Sink

SRC Sink

SinkSRC

Application 1

Toolbox of media elements

Page 14: Recording and media manipulation of WebRTC streams

Architecting a Kurento application

Page 15: Recording and media manipulation of WebRTC streams

Ready?

Page 16: Recording and media manipulation of WebRTC streams

Installing Kurento

• The doc– http://www.kurento.org/docs/current/installation_guide.html

• The video– https://www.youtube.com/watch?v=RGdDpyZAPus

• In shortsudo add-apt-repository ppa:kurento/kurento

wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -

sudo apt-get update

sudo apt-get install kurento-media-server

Page 17: Recording and media manipulation of WebRTC streams

Get a Kurento cloud instance for free

• FI-WARE (http://www.fi-ware.org)– Funded through European Commission research programmes

– PaaS cloud infrastructure offering a bunch of capabilities and enablers for the “Future Internet”

– You can get money developing WebRTC applications with Kurento and FI-WARE• http://www.fi-ware.org/accelerators/

• How to get a Kurento instance in FIWARE in 5 minutes– https://www.youtube.com/watch?v=lFM12pXeWu8

Page 18: Recording and media manipulation of WebRTC streams

Kurento “Hello World”

Page 19: Recording and media manipulation of WebRTC streams

Source & demo

https://github.com/Kurento/kurento-tutorial-js/tree/master/kurento-hello-world

Page 20: Recording and media manipulation of WebRTC streams

Recording and playing

Media Pipeline

WebRTCStreaming

Sin

kSR

C

Sin

k

Mediato

file or URI

Media Pipeline

WebRTCStreaming

Sin

kSR

C

Mediafrom

file or URI

SRC

WebRtcEndpoint

WebRtcEndpoint

RecorderEndpoint

PlayerEndpoint

Page 21: Recording and media manipulation of WebRTC streams

Source codekurentoClient.create("MediaPipeline", function(error, p) {

if(error) return onError(error);

pipeline = p;

pipeline.create("WebRtcEndpoint", function(error, webRtc){

if(error) return onError(error);

pipeline.create(”RecorderEndpoint”, function(error, recorder){

if(error) return onError(error);

webRtc.connect(recorder, function(error){

if(error) return onError(error);

webRtc.connect(webRtc, function(error){

if(error) return onError(error);

webRtc.processOffer(sdpOffer, …

if(error) return onError(error);

webRtcPeer.processSdpAnswer(sdpAnswer);

});

});

});

});

});

Page 22: Recording and media manipulation of WebRTC streams

I don’t like callbacks

From that code structureto this code structure

Page 23: Recording and media manipulation of WebRTC streams

Second try … generators

• https://github.com/Kurento/kurento-tutorial-js/tree/master/kurento-hello-world-recorder-generator

• Transactions very soon …

– By end Q4’14

Page 24: Recording and media manipulation of WebRTC streams

Advanced media processing

Page 25: Recording and media manipulation of WebRTC streams

Source & demo

• https://github.com/Kurento/kurento-tutorial-js/tree/master/kurento-magic-mirror

Page 26: Recording and media manipulation of WebRTC streams

Create your own filter: working with Kurento external modules

WebRTCStreaming

Sin

kSR

C

WebRtcEndpoint

Sin

k

SRC

ArMarkerDetector

Page 27: Recording and media manipulation of WebRTC streams

Source & demo

• https://github.com/Kurento/kurento-tutorial-js/tree/master/kurento-alvar

Page 28: Recording and media manipulation of WebRTC streams

Putting it altogether: calls with recording and filtering

Page 29: Recording and media manipulation of WebRTC streams

Source & demo: let’s switch to Java for fun

• https://github.com/Kurento/kurento-tutorial-java/tree/master/kurento-one2one-call-advanced

Page 30: Recording and media manipulation of WebRTC streams

Bonus: going beyond the media server vision

WebRTC Application based on media infrastructure

WebRTC Cloud

Page 31: Recording and media manipulation of WebRTC streams

WebRTC cloud infrastructures

PaaSIaaS SaaSProvider- Computing resourcesDeveloper- Installation- Administration- Security- Application logic

Provider- Development API

Developer- Application logic

Provider- Service

Developer- Nothing to do

Page 32: Recording and media manipulation of WebRTC streams

Multimedia PaaS: scalability types

Number of concurrent sessions

Nu

mb

er o

f u

sers

per

ses

sio

n

WebRTC PaaS Phone system

TV Broadcasting

CDNs

Media Serverbased Services

“RTC calls”

“Media serverRTC”

“Broadcasting Non-RTC”

“Beyond RTC calls”

Page 33: Recording and media manipulation of WebRTC streams

The scalability problem in call clouds

CallCallCall Call CallCall

CallCallCall Call CallCall

CallCallCall Call CallCall

Page 34: Recording and media manipulation of WebRTC streams

The scalability problem beyond call clouds

Media stream

On

e to

MA

NY

Page 35: Recording and media manipulation of WebRTC streams

WebRTC services beyond the call model

Users in call Monitoring users

Users can dynamically change their role

Page 36: Recording and media manipulation of WebRTC streams

Nubomedia: Kurento as an elastic media server

Load%Balancer%Func. on%

IaaS%Cloud%Manager%

Applica. on%Server%Func. on%

Broker%Func. on%

Media%Server%Func. on%

Cloud%Orchestrator%