SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
A Practical Guide to
Building WebRTC Apps
Ben Strong
ben@vline.com
https://vline.com
@vlineinc
vLine
10/09/2013
8/2011
My Background with WebRTC
Founded vLine in early 2011 to
build tools and infrastructure for
WebRTC
EDGE LOCATIONS ON 5 CONTINENTS
Global Infrastructure
Developer SDKs
Built what was probably the first
WebRTC App
8/2013
vLine
vLine 3
Topics
1. Making Mobile Work Well
2.Choosing a Strategy for Multi-Party Conferencing
3. UI Considerations
vLine 4
Mobile: What is Possible?
[DEMO]
vLine 5
Mobile: The Basics
Android
• Works in Chrome 29+ and
Firefox 24+
• Google Maintains Java
PeerConnection APIs
• Works pretty well
iOS
• Not supported in any browser
(thanks to Apple’s browser
engine policies)
• Google Maintains Obj-C APIs
• Voice works well
• Video can be made to work well
(this will get easier)
vLine 6
Android: Browser vs. Native
Browser Pros Native App Pros
• Re-use app built for desktop
browsers.
• Supports the most powerful
part of WebRTC: Links
• Push notifications!!!
• Other native APIs like address
book and background services
• Easier to tune for particular
devices
• Slightly better performance
vLine 7
Android: Browser vs Native
Our Answer: Both
• Make your web app work well
on mobile, so that users without
native app have low-friction
experience
• Run the same app in PhoneGap
with push notifications, address
book integration, etc.
vLine 8
Mobile: Video Quality
• Mobile devices are less powerful
than laptops and desktops
(duh)
• Wide range of capabilities among
mobile devices
(smaller gap between high-end devices and low-end
laptops than between low-end and high-end mobile
devices)
• WebRTC methods for adapting to
device capabilities don’t work well
(yet)
vLine 9
Mobile: How WebRTC Adapts
Two Methods:
• Video Adapter reduces encode
resolution if CPU is overloaded
• Remote Bitrate Estimator tells
other side to reduce encode
bitrate if decoder isn’t keeping
up
Problems
• Only kick in after quality is visibly
degraded
• Encoder and decoder compete for
CPU, with unpredictable interactions
• Result is often bitrates of 50kbps on
devices and networks that could
support much better.
vLine 10
Mobile: Device Adaptation
The unfortunate reality
You’ll get much better results by imposing
limits on resolution, framerate, and bitrate
than by relying on the built-in adaptation
methods.
vLine 11
Device Adaptation: The Knobs
Framerate and resolution are controlled by MediaConstraints passed to
getUserMedia().
function getStream(width, height, framerate) {
var constraints = {
video: {
mandatory:{
minWidth:width,
maxWidth:width,
maxFramerate:framerate
}
}
};
navigator.webkitGetUserMedia(constraints, onStream1, onFailure);
}
Note: On Chrome, if another LocalMediaStream is active, the constraints will not
take effect. Stop all other streams first!
vLine 12
Device Adaptation: The Knobs
Max bitrate and quantization set by adding VP8 fmtp parameters to SDP
(Chrome only)
...
a=rtpmap:100 VP8/9000
a=fmtp:100 x-google-max-bitrate=700; x-google-max-quantization=20
...
vLine 13
Mobile: Choosing Parameters
Two Strategies:
1. If at least one party is on mobile, set very low limits on resolution,
framerate, and bitrate (e.g., 320x240 at 15fps and 400kbps)
2. Detect device capabilities, signal them to peers, and adapt encoding
parameters appropriately
• Set encoding parameters to minimum of what the local device can
encode and the remote device can decode
vLine 14
Mobile: Choosing Parameters
Detecting Device Capabilities
1. For native apps, Android and iOS APIs will give you fine-grained
capabilities
2. For browser-based apps, run a javascript benchmark
• Run it once in a single web worker.
• Run it in parallel on 4 web workers.
• Infer CPU clock rate and number of cores.
3. Never encode at a higher resolution than the remote device’s screen!
15
Mass-Market Telepresence
With HDMI outputs, 1080p-capable
hardware codecs, and support for
bluetooth conference mics, Android
devices make the perfect embedded
telepresence systems, starting at $100 per
room.
A Mobile Bonus
HP Slate 21 - $400
Tegra 4 processor and 21”
screen. Perfect on a desktop or
wall-mounted in a small
conference room.
Galaxy NX - $1600
Exnyos-5 Octa processor plus
APS-C sensor. Mount it on a
wall and plug in TV for a room
system with broadcast-quality
video.
HDMI Dongle - $50
Rk3188 processor. Plug in a
USB camera and a TV for a
1080p capable room system.
Note 10 - $500
Exnyos-5 Octa processor. Put it
on a conference table and plug
in a wall-mounted TV and USB
camera to power a larger room.
vLine 16
Multi-Party: Two Strategies
Mesh Topology Star Topology
vLine 17
Multi-Party: What is Possible?
[DEMO]
vLine 18
Multi-Party: Mesh Topology
Mesh Pros
• No server (simpler and cheaper
infrastructure)
Mesh Cons
• More complex session management
• Only scales to about 4 participants
• Poor results on mobile devices
(which are often hard-pressed to
support a single peer)
vLine 19
Multi-Party: Star Topology
Star Pros
• Less processing and network
load on clients
• Higher quality on low-end
devices
• Potentially unlimited number of
participants.
• Good place to record, do
speaker detection, etc.
Star Cons
• Have to run lots of servers (complex
and expensive)
• For fast machines on fast network
connections, may be worse quality
(mostly remedied with geo-
distributed servers)
vLine 20
Multi-Party: Star Topology
How the Star Topology Works
• All clients connect to central server (usually called MCU or Media
Router)
• Clients encode and send one stream. MCU fans it out.
vLine 21
Multi-Party: Star Topology
MCU/Router Strategies
• Mix/composite once and re-encode a single stream for each client
(best quality. lowest load on client. very little flexibility on client. high
load on server)
• Re-encode each stream for each client (high quality. lots of flexibility
on client. more load on client. very high load on server)
• Restrict bandwidth, resolution, framerate, to lowest common
denominator and just forward (low load, potentially poor quality)
• Advanced strategies: temporal scaling and simulcast
vLine 22
Multi-Party: Star Topology
Mixed approach is probably best
• Send two streams to server from each client (low and high res)
• For small differences, adapt to lowest-common denominator and
forward.
• For large differences, re-encode.
• Use temporal scaling to fine-tune (if you control the encoder)
vLine 23
UI Considerations
For Video, Bigger is Better
• Use full window
• Encourage full-screen (especially on mobile)
• HD is best of all, but make sure devices on both ends can handle the
CPU load, or you’ll get a worse experience.
vLine 24
UI Considerations
No one notices the GetUserMedia permissions UI!
• Show an arrow to point at it and don’t let them do anything else
before accepting
• Be aware:
• In Chrome, button positions vary by platform.
• Firefox is different
• On Android Phone devices, buttons are at bottom.
vLine 25
UI Considerations
Feedback for states and errors
• If you have a mute button, make it obvious when you're muted
• Give the user feedback that you are trying to connect (or reconnect)
• If a session ends, distinguish between the other party hanging up
and losing connection
• Use stats api to detect poor network conditions and provide
feedback. User can then do something about it (e.g., move closer to
wifi access point)
• If video bitrate stays at 50kbps, encourage (or force) user to switch
to voice only

Contenu connexe

Tendances

Microsoft Windows Server 2012 R2 Hyper V server overview
Microsoft Windows Server 2012 R2 Hyper V server overviewMicrosoft Windows Server 2012 R2 Hyper V server overview
Microsoft Windows Server 2012 R2 Hyper V server overviewaboobakar sanjar
 
Approbation
ApprobationApprobation
Approbationmedfaye
 
[AIX] RDX Device Backup Guide
[AIX] RDX Device Backup Guide[AIX] RDX Device Backup Guide
[AIX] RDX Device Backup GuideCheolHee Han
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataMarketingArrowECS_CZ
 
내가써본 nGrinder-SpringCamp 2015
내가써본 nGrinder-SpringCamp 2015내가써본 nGrinder-SpringCamp 2015
내가써본 nGrinder-SpringCamp 2015Lim SungHyun
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDLorenzo Miniero
 
V mware horizon 6 knowledge transfer
V mware horizon 6 knowledge transferV mware horizon 6 knowledge transfer
V mware horizon 6 knowledge transfersolarisyougood
 
An introduction to configuring Domino for Docker
An introduction to configuring Domino for DockerAn introduction to configuring Domino for Docker
An introduction to configuring Domino for DockerGabriella Davis
 
An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema Mydbops
 
Reporting Large Environment Zabbix Database
Reporting Large Environment Zabbix DatabaseReporting Large Environment Zabbix Database
Reporting Large Environment Zabbix DatabaseAlain Ganuchaud
 
Alphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm
 
Sw 100 fr docker conteneurisation des applications
Sw 100 fr docker conteneurisation des applicationsSw 100 fr docker conteneurisation des applications
Sw 100 fr docker conteneurisation des applicationsStephane Woillez
 
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...Amazon Web Services Korea
 
Semi-Supervised Learning In An Adversarial Environment
Semi-Supervised Learning In An Adversarial EnvironmentSemi-Supervised Learning In An Adversarial Environment
Semi-Supervised Learning In An Adversarial EnvironmentDataWorks Summit
 

Tendances (20)

Podman rootless containers
Podman rootless containersPodman rootless containers
Podman rootless containers
 
Microsoft Windows Server 2012 R2 Hyper V server overview
Microsoft Windows Server 2012 R2 Hyper V server overviewMicrosoft Windows Server 2012 R2 Hyper V server overview
Microsoft Windows Server 2012 R2 Hyper V server overview
 
OpenStack Glance
OpenStack GlanceOpenStack Glance
OpenStack Glance
 
Sniffing via dsniff
Sniffing via dsniffSniffing via dsniff
Sniffing via dsniff
 
Approbation
ApprobationApprobation
Approbation
 
[AIX] RDX Device Backup Guide
[AIX] RDX Device Backup Guide[AIX] RDX Device Backup Guide
[AIX] RDX Device Backup Guide
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on Exadata
 
Docker
DockerDocker
Docker
 
내가써본 nGrinder-SpringCamp 2015
내가써본 nGrinder-SpringCamp 2015내가써본 nGrinder-SpringCamp 2015
내가써본 nGrinder-SpringCamp 2015
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
 
V mware horizon 6 knowledge transfer
V mware horizon 6 knowledge transferV mware horizon 6 knowledge transfer
V mware horizon 6 knowledge transfer
 
An introduction to configuring Domino for Docker
An introduction to configuring Domino for DockerAn introduction to configuring Domino for Docker
An introduction to configuring Domino for Docker
 
An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Reporting Large Environment Zabbix Database
Reporting Large Environment Zabbix DatabaseReporting Large Environment Zabbix Database
Reporting Large Environment Zabbix Database
 
Alphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBox
 
Zabbix
ZabbixZabbix
Zabbix
 
Sw 100 fr docker conteneurisation des applications
Sw 100 fr docker conteneurisation des applicationsSw 100 fr docker conteneurisation des applications
Sw 100 fr docker conteneurisation des applications
 
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
 
Semi-Supervised Learning In An Adversarial Environment
Semi-Supervised Learning In An Adversarial EnvironmentSemi-Supervised Learning In An Adversarial Environment
Semi-Supervised Learning In An Adversarial Environment
 

En vedette

Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialTsahi Levent-levi
 
Server-side WebRTC Infrastructure
Server-side WebRTC InfrastructureServer-side WebRTC Infrastructure
Server-side WebRTC InfrastructureDialogic Inc.
 
To Build or Not to Build Your WebRTC Infrastructure
To Build or Not to Build Your WebRTC InfrastructureTo Build or Not to Build Your WebRTC Infrastructure
To Build or Not to Build Your WebRTC InfrastructureTsahi Levent-levi
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptMichele Di Salvatore
 
WebRTC with Java
WebRTC with JavaWebRTC with Java
WebRTC with Javaamithap07
 
WebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google FranceWebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google FranceArnaud BUDKIEWICZ
 
Elixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistérioElixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistérioAlex Ferreira
 
Hackeando sua aplicaçao php na pratica
Hackeando sua aplicaçao php na pratica Hackeando sua aplicaçao php na pratica
Hackeando sua aplicaçao php na pratica Cyrille Grandval
 
FUTURA - An Exploratory Study
FUTURA - An Exploratory StudyFUTURA - An Exploratory Study
FUTURA - An Exploratory Studywitthaus
 
WebRTC infrastructures in the large (with experiences on real cloud deployments)
WebRTC infrastructures in the large (with experiences on real cloud deployments)WebRTC infrastructures in the large (with experiences on real cloud deployments)
WebRTC infrastructures in the large (with experiences on real cloud deployments)Luis Lopez
 
WebRTC Overview
WebRTC OverviewWebRTC Overview
WebRTC OverviewArin Sime
 
Comunicação em tempo real com WebRTC e PHP
Comunicação em tempo real com WebRTC e PHPComunicação em tempo real com WebRTC e PHP
Comunicação em tempo real com WebRTC e PHPMichael Douglas
 

En vedette (20)

Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
 
WebRTC
WebRTCWebRTC
WebRTC
 
Server-side WebRTC Infrastructure
Server-side WebRTC InfrastructureServer-side WebRTC Infrastructure
Server-side WebRTC Infrastructure
 
Python, WebRTC and You
Python, WebRTC and YouPython, WebRTC and You
Python, WebRTC and You
 
To Build or Not to Build Your WebRTC Infrastructure
To Build or Not to Build Your WebRTC InfrastructureTo Build or Not to Build Your WebRTC Infrastructure
To Build or Not to Build Your WebRTC Infrastructure
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascript
 
WebRTC with Java
WebRTC with JavaWebRTC with Java
WebRTC with Java
 
WebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google FranceWebRTC Paris Meetup @ Google France
WebRTC Paris Meetup @ Google France
 
Stun turn poc_pilot
Stun turn poc_pilotStun turn poc_pilot
Stun turn poc_pilot
 
Beyond the MCU
Beyond the MCUBeyond the MCU
Beyond the MCU
 
Elixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistérioElixir - o que existe atrás do mistério
Elixir - o que existe atrás do mistério
 
Ramu droid
Ramu droidRamu droid
Ramu droid
 
WebRTC
WebRTCWebRTC
WebRTC
 
Hackeando sua aplicaçao php na pratica
Hackeando sua aplicaçao php na pratica Hackeando sua aplicaçao php na pratica
Hackeando sua aplicaçao php na pratica
 
FUTURA - An Exploratory Study
FUTURA - An Exploratory StudyFUTURA - An Exploratory Study
FUTURA - An Exploratory Study
 
WebRTC infrastructures in the large (with experiences on real cloud deployments)
WebRTC infrastructures in the large (with experiences on real cloud deployments)WebRTC infrastructures in the large (with experiences on real cloud deployments)
WebRTC infrastructures in the large (with experiences on real cloud deployments)
 
WebRTC Overview
WebRTC OverviewWebRTC Overview
WebRTC Overview
 
overview-peerconnection-lifetime
overview-peerconnection-lifetimeoverview-peerconnection-lifetime
overview-peerconnection-lifetime
 
Comunicação em tempo real com WebRTC e PHP
Comunicação em tempo real com WebRTC e PHPComunicação em tempo real com WebRTC e PHP
Comunicação em tempo real com WebRTC e PHP
 
Webrtc
WebrtcWebrtc
Webrtc
 

Similaire à A Practical Guide to WebRTC

Mersive Solstice Appliance
Mersive Solstice ApplianceMersive Solstice Appliance
Mersive Solstice AppliancePaul Richards
 
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...Alan Quayle
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical Jimmin Kurichiyil
 
Virtual STB / Cloud UI Streaming revisited
Virtual STB / Cloud UI Streaming revisitedVirtual STB / Cloud UI Streaming revisited
Virtual STB / Cloud UI Streaming revisitedDr. Randolph Nikutta
 
Horizon view technical deep dive
Horizon view   technical deep diveHorizon view   technical deep dive
Horizon view technical deep diveMurugesan Arumugam
 
EasyNet_Systems_Catalog(Ver3.02)_lowres
EasyNet_Systems_Catalog(Ver3.02)_lowresEasyNet_Systems_Catalog(Ver3.02)_lowres
EasyNet_Systems_Catalog(Ver3.02)_lowresEddie Y. Lee
 
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...VMworld
 
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)DevGAMM Conference
 
7 reasons why video conferencing world will never
7 reasons why video conferencing world will never7 reasons why video conferencing world will never
7 reasons why video conferencing world will neverTrueConf
 
Kranky Geek WebRTC 2015 - What's next for WebRTC?
Kranky Geek WebRTC 2015 - What's next for WebRTC?Kranky Geek WebRTC 2015 - What's next for WebRTC?
Kranky Geek WebRTC 2015 - What's next for WebRTC?Kranky Geek
 
Navigating the Mobile maze
Navigating the Mobile mazeNavigating the Mobile maze
Navigating the Mobile mazePraveen Bohra
 
Exor 2015 complete catalog
Exor 2015 complete catalogExor 2015 complete catalog
Exor 2015 complete catalogElectromate
 
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...TrueConf
 
Монетизация сетевой инфраструктуры
Монетизация сетевой инфраструктурыМонетизация сетевой инфраструктуры
Монетизация сетевой инфраструктурыBAKOTECH
 
About Voddler, our streaming technology Vnet and accelerating video-on-demand...
About Voddler, our streaming technology Vnet and accelerating video-on-demand...About Voddler, our streaming technology Vnet and accelerating video-on-demand...
About Voddler, our streaming technology Vnet and accelerating video-on-demand...Anders Sjöman
 
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...mfrancis
 

Similaire à A Practical Guide to WebRTC (20)

Vid ovation tv-iptv-business-enterprise
Vid ovation tv-iptv-business-enterpriseVid ovation tv-iptv-business-enterprise
Vid ovation tv-iptv-business-enterprise
 
Mersive Solstice Appliance
Mersive Solstice ApplianceMersive Solstice Appliance
Mersive Solstice Appliance
 
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...
How to Architect your WebRTC application, Alberto Gonzalez and Arin Sime, Web...
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical
 
Virtual STB / Cloud UI Streaming revisited
Virtual STB / Cloud UI Streaming revisitedVirtual STB / Cloud UI Streaming revisited
Virtual STB / Cloud UI Streaming revisited
 
Horizon view technical deep dive
Horizon view   technical deep diveHorizon view   technical deep dive
Horizon view technical deep dive
 
Voice browser
Voice browserVoice browser
Voice browser
 
EasyNet_Systems_Catalog(Ver3.02)_lowres
EasyNet_Systems_Catalog(Ver3.02)_lowresEasyNet_Systems_Catalog(Ver3.02)_lowres
EasyNet_Systems_Catalog(Ver3.02)_lowres
 
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...
VMworld 2016: Advances in Remote Display Protocol Technology with VMware Blas...
 
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)
HMS Core Game Solution- create the immersive game world / Fei Tong (Huawei)
 
7 reasons why video conferencing world will never
7 reasons why video conferencing world will never7 reasons why video conferencing world will never
7 reasons why video conferencing world will never
 
Kranky Geek WebRTC 2015 - What's next for WebRTC?
Kranky Geek WebRTC 2015 - What's next for WebRTC?Kranky Geek WebRTC 2015 - What's next for WebRTC?
Kranky Geek WebRTC 2015 - What's next for WebRTC?
 
Navigating the Mobile maze
Navigating the Mobile mazeNavigating the Mobile maze
Navigating the Mobile maze
 
Exor 2015 complete catalog
Exor 2015 complete catalogExor 2015 complete catalog
Exor 2015 complete catalog
 
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...
Video + Konferecja Polska 2014. Sześć najważniejszych koncepcji związanych z ...
 
Cloud gaming
Cloud gamingCloud gaming
Cloud gaming
 
Монетизация сетевой инфраструктуры
Монетизация сетевой инфраструктурыМонетизация сетевой инфраструктуры
Монетизация сетевой инфраструктуры
 
About Voddler, our streaming technology Vnet and accelerating video-on-demand...
About Voddler, our streaming technology Vnet and accelerating video-on-demand...About Voddler, our streaming technology Vnet and accelerating video-on-demand...
About Voddler, our streaming technology Vnet and accelerating video-on-demand...
 
SJNC13.pptx
SJNC13.pptxSJNC13.pptx
SJNC13.pptx
 
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...
Making the Home Gateway an Operator Control Point - Andreas Sayegh, Deutsche ...
 

Dernier

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Dernier (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

A Practical Guide to WebRTC

  • 1. A Practical Guide to Building WebRTC Apps Ben Strong ben@vline.com https://vline.com @vlineinc vLine 10/09/2013
  • 2. 8/2011 My Background with WebRTC Founded vLine in early 2011 to build tools and infrastructure for WebRTC EDGE LOCATIONS ON 5 CONTINENTS Global Infrastructure Developer SDKs Built what was probably the first WebRTC App 8/2013 vLine
  • 3. vLine 3 Topics 1. Making Mobile Work Well 2.Choosing a Strategy for Multi-Party Conferencing 3. UI Considerations
  • 4. vLine 4 Mobile: What is Possible? [DEMO]
  • 5. vLine 5 Mobile: The Basics Android • Works in Chrome 29+ and Firefox 24+ • Google Maintains Java PeerConnection APIs • Works pretty well iOS • Not supported in any browser (thanks to Apple’s browser engine policies) • Google Maintains Obj-C APIs • Voice works well • Video can be made to work well (this will get easier)
  • 6. vLine 6 Android: Browser vs. Native Browser Pros Native App Pros • Re-use app built for desktop browsers. • Supports the most powerful part of WebRTC: Links • Push notifications!!! • Other native APIs like address book and background services • Easier to tune for particular devices • Slightly better performance
  • 7. vLine 7 Android: Browser vs Native Our Answer: Both • Make your web app work well on mobile, so that users without native app have low-friction experience • Run the same app in PhoneGap with push notifications, address book integration, etc.
  • 8. vLine 8 Mobile: Video Quality • Mobile devices are less powerful than laptops and desktops (duh) • Wide range of capabilities among mobile devices (smaller gap between high-end devices and low-end laptops than between low-end and high-end mobile devices) • WebRTC methods for adapting to device capabilities don’t work well (yet)
  • 9. vLine 9 Mobile: How WebRTC Adapts Two Methods: • Video Adapter reduces encode resolution if CPU is overloaded • Remote Bitrate Estimator tells other side to reduce encode bitrate if decoder isn’t keeping up Problems • Only kick in after quality is visibly degraded • Encoder and decoder compete for CPU, with unpredictable interactions • Result is often bitrates of 50kbps on devices and networks that could support much better.
  • 10. vLine 10 Mobile: Device Adaptation The unfortunate reality You’ll get much better results by imposing limits on resolution, framerate, and bitrate than by relying on the built-in adaptation methods.
  • 11. vLine 11 Device Adaptation: The Knobs Framerate and resolution are controlled by MediaConstraints passed to getUserMedia(). function getStream(width, height, framerate) { var constraints = { video: { mandatory:{ minWidth:width, maxWidth:width, maxFramerate:framerate } } }; navigator.webkitGetUserMedia(constraints, onStream1, onFailure); } Note: On Chrome, if another LocalMediaStream is active, the constraints will not take effect. Stop all other streams first!
  • 12. vLine 12 Device Adaptation: The Knobs Max bitrate and quantization set by adding VP8 fmtp parameters to SDP (Chrome only) ... a=rtpmap:100 VP8/9000 a=fmtp:100 x-google-max-bitrate=700; x-google-max-quantization=20 ...
  • 13. vLine 13 Mobile: Choosing Parameters Two Strategies: 1. If at least one party is on mobile, set very low limits on resolution, framerate, and bitrate (e.g., 320x240 at 15fps and 400kbps) 2. Detect device capabilities, signal them to peers, and adapt encoding parameters appropriately • Set encoding parameters to minimum of what the local device can encode and the remote device can decode
  • 14. vLine 14 Mobile: Choosing Parameters Detecting Device Capabilities 1. For native apps, Android and iOS APIs will give you fine-grained capabilities 2. For browser-based apps, run a javascript benchmark • Run it once in a single web worker. • Run it in parallel on 4 web workers. • Infer CPU clock rate and number of cores. 3. Never encode at a higher resolution than the remote device’s screen!
  • 15. 15 Mass-Market Telepresence With HDMI outputs, 1080p-capable hardware codecs, and support for bluetooth conference mics, Android devices make the perfect embedded telepresence systems, starting at $100 per room. A Mobile Bonus HP Slate 21 - $400 Tegra 4 processor and 21” screen. Perfect on a desktop or wall-mounted in a small conference room. Galaxy NX - $1600 Exnyos-5 Octa processor plus APS-C sensor. Mount it on a wall and plug in TV for a room system with broadcast-quality video. HDMI Dongle - $50 Rk3188 processor. Plug in a USB camera and a TV for a 1080p capable room system. Note 10 - $500 Exnyos-5 Octa processor. Put it on a conference table and plug in a wall-mounted TV and USB camera to power a larger room.
  • 16. vLine 16 Multi-Party: Two Strategies Mesh Topology Star Topology
  • 17. vLine 17 Multi-Party: What is Possible? [DEMO]
  • 18. vLine 18 Multi-Party: Mesh Topology Mesh Pros • No server (simpler and cheaper infrastructure) Mesh Cons • More complex session management • Only scales to about 4 participants • Poor results on mobile devices (which are often hard-pressed to support a single peer)
  • 19. vLine 19 Multi-Party: Star Topology Star Pros • Less processing and network load on clients • Higher quality on low-end devices • Potentially unlimited number of participants. • Good place to record, do speaker detection, etc. Star Cons • Have to run lots of servers (complex and expensive) • For fast machines on fast network connections, may be worse quality (mostly remedied with geo- distributed servers)
  • 20. vLine 20 Multi-Party: Star Topology How the Star Topology Works • All clients connect to central server (usually called MCU or Media Router) • Clients encode and send one stream. MCU fans it out.
  • 21. vLine 21 Multi-Party: Star Topology MCU/Router Strategies • Mix/composite once and re-encode a single stream for each client (best quality. lowest load on client. very little flexibility on client. high load on server) • Re-encode each stream for each client (high quality. lots of flexibility on client. more load on client. very high load on server) • Restrict bandwidth, resolution, framerate, to lowest common denominator and just forward (low load, potentially poor quality) • Advanced strategies: temporal scaling and simulcast
  • 22. vLine 22 Multi-Party: Star Topology Mixed approach is probably best • Send two streams to server from each client (low and high res) • For small differences, adapt to lowest-common denominator and forward. • For large differences, re-encode. • Use temporal scaling to fine-tune (if you control the encoder)
  • 23. vLine 23 UI Considerations For Video, Bigger is Better • Use full window • Encourage full-screen (especially on mobile) • HD is best of all, but make sure devices on both ends can handle the CPU load, or you’ll get a worse experience.
  • 24. vLine 24 UI Considerations No one notices the GetUserMedia permissions UI! • Show an arrow to point at it and don’t let them do anything else before accepting • Be aware: • In Chrome, button positions vary by platform. • Firefox is different • On Android Phone devices, buttons are at bottom.
  • 25. vLine 25 UI Considerations Feedback for states and errors • If you have a mute button, make it obvious when you're muted • Give the user feedback that you are trying to connect (or reconnect) • If a session ends, distinguish between the other party hanging up and losing connection • Use stats api to detect poor network conditions and provide feedback. User can then do something about it (e.g., move closer to wifi access point) • If video bitrate stays at 50kbps, encourage (or force) user to switch to voice only