SlideShare a Scribd company logo
Real-Time Media Stream Processing using Kurento
Juan Navarro Moreno
Kurento Software Developer
jnavarro@naevatec.com
github.com/j1elo
www.kurento.org
Overview – What is Kurento?
●
A server that simplifies creation of streaming applications.
●
Focused on processing of Audio/Video media streams.
●
Supporting WebRTC communications.
●
Simple workflow: input → process → output.
Kurento is an Open Source project.
Hosted on GitHub: https://github.com/Kurento
Overview – Why Kurento?
●
Abstracts compatibility issues between sender and receiver.
●
Manipulates or redistributes the streams.
●
Extracts information from the streams.
Input stream
Kurento
Media
Server
Output stream
Product-specific data
Eg.: FIWARE data-store
Overview – Why Kurento?
Examples:
●
Abstraction of incompatible
video codecs
●
Multi-point distribution of media
●
Processing / Storing media
Overview – Why Kurento?
Overview – How does Kurento work?
A server with two main components:
●
Endpoints: where data flows In/Out.
●
Filters: composable modules where data is processed or
transformed.
Media stream
Src
Sink Media stream
Input
Endpoint
Output
Endpoint
Overview – How does Kurento work?
Endpoints and Filters are linked together, mix-and-matched to form a
Pipeline.
Input
Endpoint
Src
Sink
Output
Endpoint
Src
Sink
Src
Sink
Src
Sink
Overview – How does Kurento work?
The server is controlled with an RPC API.
●
Client applications manipulate Endpoints and Filters through this API.
●
Ready-made client SDKs for Java, Node.js and in-browser JavaScript.
Components of a Real-World application:
●
Kurento Media Server
●
Client Application – usually a server too.
●
User Interface – common case is a web page.
Overview – How does Kurento work?
Getting technical
Component overview
Kurento Media Server (aka. “KMS”)
●
Core: Basic functionality and RPC API.
●
Elements: Endpoints used for input and
output of streams.
●
Filters: Implementation of all stream-
processing modules.
KMS Elements
Protocols and Codecs Media Repository
WebRtcEndpoint
RtpEndpoint
HttpEndpoint
PlayerEndpoint
RecorderEndpoint
KMS Elements
Different Endpoints for different needs:
●
WebRtcEndpoint – Full support of WebRTC standard.
•
Currently compatible with Chrome and Firefox (Safari and Edge are
work-in-progress).
•
All WebRTC lingo: SDP, (Trickle-)ICE, STUN, TURN, Google REMB.
●
RtpEndpoint – For RTP and SRTP streams.
•
Supports port auto-discovery as an alternative to ICE.
●
HttpEndpoint – Accepts GET/POST requests (eg. file uploading to KMS).
KMS Elements
Special Endpoints:
●
PlayerEndpoint – Retrieves content from either of the file system, HTTP
servers, or RTSP sources. Input-only.
●
RecorderEndpoint – Redirects streams to storage. Output-only.
KMS Filters
Process or transform data as it flows through filters.
●
Could be a simple transformation. Eg: Convert video to black and white.
●
Could be a complex task, involving external libraries. Eg: Apply
Computer Vision algorithms and extract features from the video.
●
Imagination is the limit.
KMS Filters
Computer Vision Generic filter
Zbar
FaceDetector
PlateDetector
GStreamerFilter
Pipelines
●
All elements get created and linked through specific RPC commands
from the Client Application.
●
As seen before, complex topologies are possible.
Pipelines
SinkSink
SRCSRC
SinkSink
SRCSRCSinkSink
SinkSinkSRCSRC
WebRtcEndpoint
AR Filter
RecorderEndpoint
HttpGetEndpoint
RtpEndpoint
MP4 fle stored
in media
repository
Web application
using HTML5
<video> tag
RTP full duplex
client video
phone
WebRTC full
duplex client
video application
SinkSink
Client Application
●
Implements or includes an RPC client.
●
Orchestrates the creation of the Pipeline, with Elements and Filters.
●
WebRtcEndpoint follows the standard way of configuration via SDP
Negotiation (SDP Offer/Answer Model).
•
The Client Application is in charge of passing around ICE Candidates.
●
RtpEndpoint also uses SDP for configuration, but no ICE.
●
Other Endpoints have custom RPC methods for configuration.
Client Application
●
Provides access to external sources such as FIWARE data-stores.
●
Proceeds with the rest of the business logic.
●
Kurento provides a FIWARE integration package for Java applications.
●
Also there are multiple example applications available.
Client Application
Application
Server
Application
Server
Media
Server
Media
ServerClientClient
Media
Negotiation
phase
11
Media channel
preparation
phase
(optional)
22
Media
exchange
phase
33
Specifc app logic
Pipeline
building
Pipeline
managed
media
SDP Ofer
(Mangled) SDP Ofer
SDP Answer(Mangled) SDP Answer
ICE Candidates
ICE Candidates
A closer look to some of the underlying technologies
A closer look – GStreamer media library
Kurento is powered under the hood by the GStreamer project:
https://gstreamer.freedesktop.org
GStreamer is in charge of all media handling:
●
Decoding / encoding of input / output video & audio.
●
Establishment of communication streams (eg. RTP Sessions).
●
Special interest: Agnostic bin.
A closer look – GStreamer Agnostic bin
Kurento abstracts codec compatibility issues between Endpoints.
●
Achieved through an “invisible” intermediate filter – ‘agnosticbin’.
●
Applies on-the-fly transcoding iff the codecs are not compatible.
WebRtcEndpoint WebRtcEndpoint
Agnostic media
adapter, “hidden”
behind every
connection
Agnostic media
adapter, “hidden”
behind every
connection
H.264VP8
SinkSink
SRCSRC
SinkSink
SRCSRC
A closer look – SDP Offer/Answer
●
The standard signaling format for WebRTC.
●
Used to configure codecs & advanced settings in WebRtcEndpoint and
RtpEndpoint.
●
SDP started simple but has grown to become a mess.
See: https://webrtchacks.com/sdp-anatomy/
(The problem is, the IETF RTCWEB working group was/is dominated by players from the SIP world who
wanted to re-use their existing code.)
A closer look – SDP Offer/Answer
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 9 RTP/AVPF 96
a=rtpmap:96 opus/48000/2
a=sendonly
a=direction:active
a=ssrc:445566 cname:user@example.com
m=video 9 RTP/AVPF 103
a=rtpmap:103 H264/90000
a=sendonly
a=direction:active
a=ssrc:112233 cname:user@example.com
v=0
o=- 372 372 IN IP4 192.168.1.15
s=Kurento Media Server
c=IN IP4 192.168.1.15
t=0 0
m=audio 41654 RTP/AVPF 96
a=rtpmap:96 opus/48000/2
a=recvonly
a=direction:passive
a=ssrc:3224 cname:user225@host-9b2
m=video 61134 RTP/AVPF 103
a=rtpmap:103 H264/90000
a=recvonly
a=direction:passive
a=ssrc:2717 cname:user225@host-9b2
SDP Offer to RtpEndpoint: SDP Answer from RtpEndpoint:
Application examples
A closer look – Application example: RTP Receiver
Kurento RTP Player is a recent addition to the Kurento Tutorials:
●
Receives an audio/video stream.
●
Redirects it and sends to a browser through WebRTC.
●
http://doc-kurento.readthedocs.io/en/latest/user/tutorials.html#rtp-receiver
RTP
producer
A closer look – Application example: RTP Player
void start(String browserSdpOffer)
{
// Create and link Endpoints
MediaPipeline pipeline = kurento.createMediaPipeline();
RtpEndpoint rtpEndpoint = new RtpEndpoint.Builder(pipeline).build();
WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build();
rtpEndpoint.connect(webRtcEndpoint);
// Configure the RtpEndpoint
String fakeSdpOffer = "...";
String kmsSdpAnswer = rtpEndpoint.processOffer(fakeSdpOffer);
String browserSdpAnswer = webRtcEndpoint.processOffer(browserSdpOffer);
webRtcEndpoint.gatherCandidates();
}
A closer look – Application example: Magic Mirror
●
Receives a video stream from a browser.
●
Applies Computer Vision to detect a face and overlay a picture.
●
Sends back the modified video to the same Endpoint it came from.
●
http://doc-kurento.readthedocs.io/en/latest/user/tutorials.html#webrtc-magic-mirror
A closer look – Application example: Magic Mirror
void start()
{
// Create and link Endpoints, Filters
MediaPipeline pipeline = kurento.createMediaPipeline();
WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build();
FaceOverlayFilter faceOverlayFilter =
new FaceOverlayFilter.Builder(pipeline).build();
faceOverlayFilter.setOverlayedImage("mario-hat.png");
webRtcEndpoint.connect(faceOverlayFilter);
faceOverlayFilter.connect(webRtcEndpoint);
webRtcEndpoint.gatherCandidates();
}
Closing & Questions
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
Juan Navarro Moreno
Kurento Software Developer
jnavarro@naevatec.com
github.com/j1elo
www.kurento.org

More Related Content

PDF
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE
 
PDF
FIWARE Tech Summit - Stream Processing with Kurento Media Server
FIWARE
 
PPTX
P4 to OpenDataPlane Compiler - BUD17-304
Linaro
 
PDF
LF_DPDK17_Lagopus Router
LF_DPDK
 
PDF
Learn more about the tremendous value Open Data Plane brings to NFV
Ghodhbane Mohamed Amine
 
PDF
LAS16-201: ART JIT in Android N
Linaro
 
PDF
Host Data Plane Acceleration: SmartNIC Deployment Models
Netronome
 
PDF
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE
 
FIWARE Tech Summit - Stream Processing with Kurento Media Server
FIWARE
 
P4 to OpenDataPlane Compiler - BUD17-304
Linaro
 
LF_DPDK17_Lagopus Router
LF_DPDK
 
Learn more about the tremendous value Open Data Plane brings to NFV
Ghodhbane Mohamed Amine
 
LAS16-201: ART JIT in Android N
Linaro
 
Host Data Plane Acceleration: SmartNIC Deployment Models
Netronome
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 

What's hot (20)

PDF
SFO15-102:ODP Project Update
Linaro
 
PDF
HKG15-110: ODP Project Update
Linaro
 
PDF
LCU14 310- Cisco ODP v2
Linaro
 
PDF
LAS16-305: Smart City Big Data Visualization on 96Boards
Linaro
 
PDF
HKG15-301: OVS implemented via ODP & vendor SDKs
Linaro
 
PDF
LAS16-207: Bus scaling QoS
Linaro
 
PDF
LCA14: LCA14-209: ODP Project Update
Linaro
 
PPTX
LAS16-106: GNU Toolchain Development Lifecycle
Linaro
 
PDF
Whitebox Switches Deployment Experience
APNIC
 
PPTX
G rpc talk with intel (3)
Intel
 
PDF
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
Linaro
 
PDF
LAS16-TR03: Upstreaming 201
Linaro
 
PDF
LAS16-200: SCMI - System Management and Control Interface
Linaro
 
PDF
ODP Presentation LinuxCon NA 2014
Michael Christofferson
 
PDF
LAS16-109: LAS16-109: The status quo and the future of 96Boards
Linaro
 
PDF
Programmable data plane at terabit speeds
Barefoot Networks
 
PPTX
DMA Survival Guide
Kernel TLV
 
PDF
Enabling Applications to Exploit SmartNICs and FPGAs
inside-BigData.com
 
PDF
LAS16-209: Finished and Upcoming Projects in LMG
Linaro
 
PDF
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
Linaro
 
SFO15-102:ODP Project Update
Linaro
 
HKG15-110: ODP Project Update
Linaro
 
LCU14 310- Cisco ODP v2
Linaro
 
LAS16-305: Smart City Big Data Visualization on 96Boards
Linaro
 
HKG15-301: OVS implemented via ODP & vendor SDKs
Linaro
 
LAS16-207: Bus scaling QoS
Linaro
 
LCA14: LCA14-209: ODP Project Update
Linaro
 
LAS16-106: GNU Toolchain Development Lifecycle
Linaro
 
Whitebox Switches Deployment Experience
APNIC
 
G rpc talk with intel (3)
Intel
 
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
Linaro
 
LAS16-TR03: Upstreaming 201
Linaro
 
LAS16-200: SCMI - System Management and Control Interface
Linaro
 
ODP Presentation LinuxCon NA 2014
Michael Christofferson
 
LAS16-109: LAS16-109: The status quo and the future of 96Boards
Linaro
 
Programmable data plane at terabit speeds
Barefoot Networks
 
DMA Survival Guide
Kernel TLV
 
Enabling Applications to Exploit SmartNICs and FPGAs
inside-BigData.com
 
LAS16-209: Finished and Upcoming Projects in LMG
Linaro
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
Linaro
 
Ad

Similar to FIWARE Global Summit - Real-time Media Stream Processing Using Kurento (20)

PDF
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE
 
PPTX
Kurento - FI-WARE Bootcamp
Ivan Gracia
 
PPTX
Recording and media manipulation of WebRTC streams
Luis Lopez
 
PDF
Kurento cpmx
Ivan Gracia
 
PPTX
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Luis Lopez
 
PPTX
The future of multimedia communications and services: Kurento and it's role
Luis Lopez
 
PDF
Developing applications with Kurento
Luis Lopez
 
PPTX
Kurento: a media server architecture and API for WebRTC
Luis Lopez
 
PPTX
Developing rich multimedia applications with FI-WARE.
Luis Lopez
 
PPTX
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Luis Lopez
 
PPTX
kurento-nubomedia-first-steps-v1
Luis Lopez
 
PDF
WebRTC Real time media P2P, Server, Infrastructure, and Platform
Ryan Jespersen
 
PPTX
Kurento FIWARE
Ivan Gracia
 
PDF
Implementing a WebRTC endpoint in GStreamer: challenges, problems and perspec...
Luis Lopez
 
PPTX
Nubomedia IETF96 hackthon - Kurento
Ivan Gracia
 
PDF
20 Years of Streaming in 20 Minutes
Alpen-Adria-Universität
 
PPTX
Advanced Kurento Real Time Media Stream Processing
FIWARE
 
PPTX
Nubomedia: the cloud infrastructure for WebRTC and IMS multimedia real-time c...
Luis Lopez
 
PPTX
FOSDEM 2016 - Creating rich WebRTC Applications with Kurento
Luis Lopez
 
PDF
WebRTC Infrastructure the Hard Parts: Media
Dialogic Inc.
 
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE
 
Kurento - FI-WARE Bootcamp
Ivan Gracia
 
Recording and media manipulation of WebRTC streams
Luis Lopez
 
Kurento cpmx
Ivan Gracia
 
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Luis Lopez
 
The future of multimedia communications and services: Kurento and it's role
Luis Lopez
 
Developing applications with Kurento
Luis Lopez
 
Kurento: a media server architecture and API for WebRTC
Luis Lopez
 
Developing rich multimedia applications with FI-WARE.
Luis Lopez
 
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Luis Lopez
 
kurento-nubomedia-first-steps-v1
Luis Lopez
 
WebRTC Real time media P2P, Server, Infrastructure, and Platform
Ryan Jespersen
 
Kurento FIWARE
Ivan Gracia
 
Implementing a WebRTC endpoint in GStreamer: challenges, problems and perspec...
Luis Lopez
 
Nubomedia IETF96 hackthon - Kurento
Ivan Gracia
 
20 Years of Streaming in 20 Minutes
Alpen-Adria-Universität
 
Advanced Kurento Real Time Media Stream Processing
FIWARE
 
Nubomedia: the cloud infrastructure for WebRTC and IMS multimedia real-time c...
Luis Lopez
 
FOSDEM 2016 - Creating rich WebRTC Applications with Kurento
Luis Lopez
 
WebRTC Infrastructure the Hard Parts: Media
Dialogic Inc.
 
Ad

More from FIWARE (20)

PPTX
Behm_Herne_NeMo_akt.pptx
FIWARE
 
PDF
Katharina Hogrebe Herne Digital Days.pdf
FIWARE
 
PPTX
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
FIWARE
 
PPTX
Behm_Herne_NeMo.pptx
FIWARE
 
PPTX
Evangelists + iHubs Promo Slides.pptx
FIWARE
 
PPTX
Lukas Künzel Smart City Operating System.pptx
FIWARE
 
PPTX
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
FIWARE
 
PPTX
Dennis Wendland_The i4Trust Collaboration Programme.pptx
FIWARE
 
PPTX
Ulrich Ahle_FIWARE.pptx
FIWARE
 
PPTX
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
FIWARE
 
PDF
Water Quality - Lukas Kuenzel.pdf
FIWARE
 
PPTX
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
FIWARE
 
PPTX
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FIWARE
 
PPTX
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
FIWARE
 
PPTX
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
FIWARE
 
PDF
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
FIWARE
 
PDF
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FIWARE
 
PPTX
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
FIWARE
 
PPTX
WE_LoRaWAN _ IoT.pptx
FIWARE
 
PPTX
EU Opp_Clara Pezuela - German chapter.pptx
FIWARE
 
Behm_Herne_NeMo_akt.pptx
FIWARE
 
Katharina Hogrebe Herne Digital Days.pdf
FIWARE
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
FIWARE
 
Behm_Herne_NeMo.pptx
FIWARE
 
Evangelists + iHubs Promo Slides.pptx
FIWARE
 
Lukas Künzel Smart City Operating System.pptx
FIWARE
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
FIWARE
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
FIWARE
 
Ulrich Ahle_FIWARE.pptx
FIWARE
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
FIWARE
 
Water Quality - Lukas Kuenzel.pdf
FIWARE
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
FIWARE
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FIWARE
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
FIWARE
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
FIWARE
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
FIWARE
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FIWARE
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
FIWARE
 
WE_LoRaWAN _ IoT.pptx
FIWARE
 
EU Opp_Clara Pezuela - German chapter.pptx
FIWARE
 

Recently uploaded (20)

PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Doc9.....................................
SofiaCollazos
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Software Development Methodologies in 2025
KodekX
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 

FIWARE Global Summit - Real-time Media Stream Processing Using Kurento

  • 1. Real-Time Media Stream Processing using Kurento Juan Navarro Moreno Kurento Software Developer [email protected] github.com/j1elo www.kurento.org
  • 2. Overview – What is Kurento? ● A server that simplifies creation of streaming applications. ● Focused on processing of Audio/Video media streams. ● Supporting WebRTC communications. ● Simple workflow: input → process → output. Kurento is an Open Source project. Hosted on GitHub: https://github.com/Kurento
  • 3. Overview – Why Kurento? ● Abstracts compatibility issues between sender and receiver. ● Manipulates or redistributes the streams. ● Extracts information from the streams. Input stream Kurento Media Server Output stream Product-specific data Eg.: FIWARE data-store
  • 4. Overview – Why Kurento? Examples: ● Abstraction of incompatible video codecs ● Multi-point distribution of media ● Processing / Storing media
  • 5. Overview – Why Kurento?
  • 6. Overview – How does Kurento work? A server with two main components: ● Endpoints: where data flows In/Out. ● Filters: composable modules where data is processed or transformed. Media stream Src Sink Media stream Input Endpoint Output Endpoint
  • 7. Overview – How does Kurento work? Endpoints and Filters are linked together, mix-and-matched to form a Pipeline. Input Endpoint Src Sink Output Endpoint Src Sink Src Sink Src Sink
  • 8. Overview – How does Kurento work? The server is controlled with an RPC API. ● Client applications manipulate Endpoints and Filters through this API. ● Ready-made client SDKs for Java, Node.js and in-browser JavaScript. Components of a Real-World application: ● Kurento Media Server ● Client Application – usually a server too. ● User Interface – common case is a web page.
  • 9. Overview – How does Kurento work?
  • 11. Component overview Kurento Media Server (aka. “KMS”) ● Core: Basic functionality and RPC API. ● Elements: Endpoints used for input and output of streams. ● Filters: Implementation of all stream- processing modules.
  • 12. KMS Elements Protocols and Codecs Media Repository WebRtcEndpoint RtpEndpoint HttpEndpoint PlayerEndpoint RecorderEndpoint
  • 13. KMS Elements Different Endpoints for different needs: ● WebRtcEndpoint – Full support of WebRTC standard. • Currently compatible with Chrome and Firefox (Safari and Edge are work-in-progress). • All WebRTC lingo: SDP, (Trickle-)ICE, STUN, TURN, Google REMB. ● RtpEndpoint – For RTP and SRTP streams. • Supports port auto-discovery as an alternative to ICE. ● HttpEndpoint – Accepts GET/POST requests (eg. file uploading to KMS).
  • 14. KMS Elements Special Endpoints: ● PlayerEndpoint – Retrieves content from either of the file system, HTTP servers, or RTSP sources. Input-only. ● RecorderEndpoint – Redirects streams to storage. Output-only.
  • 15. KMS Filters Process or transform data as it flows through filters. ● Could be a simple transformation. Eg: Convert video to black and white. ● Could be a complex task, involving external libraries. Eg: Apply Computer Vision algorithms and extract features from the video. ● Imagination is the limit.
  • 16. KMS Filters Computer Vision Generic filter Zbar FaceDetector PlateDetector GStreamerFilter
  • 17. Pipelines ● All elements get created and linked through specific RPC commands from the Client Application. ● As seen before, complex topologies are possible.
  • 18. Pipelines SinkSink SRCSRC SinkSink SRCSRCSinkSink SinkSinkSRCSRC WebRtcEndpoint AR Filter RecorderEndpoint HttpGetEndpoint RtpEndpoint MP4 fle stored in media repository Web application using HTML5 <video> tag RTP full duplex client video phone WebRTC full duplex client video application SinkSink
  • 19. Client Application ● Implements or includes an RPC client. ● Orchestrates the creation of the Pipeline, with Elements and Filters. ● WebRtcEndpoint follows the standard way of configuration via SDP Negotiation (SDP Offer/Answer Model). • The Client Application is in charge of passing around ICE Candidates. ● RtpEndpoint also uses SDP for configuration, but no ICE. ● Other Endpoints have custom RPC methods for configuration.
  • 20. Client Application ● Provides access to external sources such as FIWARE data-stores. ● Proceeds with the rest of the business logic. ● Kurento provides a FIWARE integration package for Java applications. ● Also there are multiple example applications available.
  • 21. Client Application Application Server Application Server Media Server Media ServerClientClient Media Negotiation phase 11 Media channel preparation phase (optional) 22 Media exchange phase 33 Specifc app logic Pipeline building Pipeline managed media SDP Ofer (Mangled) SDP Ofer SDP Answer(Mangled) SDP Answer ICE Candidates ICE Candidates
  • 22. A closer look to some of the underlying technologies
  • 23. A closer look – GStreamer media library Kurento is powered under the hood by the GStreamer project: https://gstreamer.freedesktop.org GStreamer is in charge of all media handling: ● Decoding / encoding of input / output video & audio. ● Establishment of communication streams (eg. RTP Sessions). ● Special interest: Agnostic bin.
  • 24. A closer look – GStreamer Agnostic bin Kurento abstracts codec compatibility issues between Endpoints. ● Achieved through an “invisible” intermediate filter – ‘agnosticbin’. ● Applies on-the-fly transcoding iff the codecs are not compatible. WebRtcEndpoint WebRtcEndpoint Agnostic media adapter, “hidden” behind every connection Agnostic media adapter, “hidden” behind every connection H.264VP8 SinkSink SRCSRC SinkSink SRCSRC
  • 25. A closer look – SDP Offer/Answer ● The standard signaling format for WebRTC. ● Used to configure codecs & advanced settings in WebRtcEndpoint and RtpEndpoint. ● SDP started simple but has grown to become a mess. See: https://webrtchacks.com/sdp-anatomy/ (The problem is, the IETF RTCWEB working group was/is dominated by players from the SIP world who wanted to re-use their existing code.)
  • 26. A closer look – SDP Offer/Answer v=0 o=- 0 0 IN IP4 127.0.0.1 s=- c=IN IP4 127.0.0.1 t=0 0 m=audio 9 RTP/AVPF 96 a=rtpmap:96 opus/48000/2 a=sendonly a=direction:active a=ssrc:445566 cname:[email protected] m=video 9 RTP/AVPF 103 a=rtpmap:103 H264/90000 a=sendonly a=direction:active a=ssrc:112233 cname:[email protected] v=0 o=- 372 372 IN IP4 192.168.1.15 s=Kurento Media Server c=IN IP4 192.168.1.15 t=0 0 m=audio 41654 RTP/AVPF 96 a=rtpmap:96 opus/48000/2 a=recvonly a=direction:passive a=ssrc:3224 cname:user225@host-9b2 m=video 61134 RTP/AVPF 103 a=rtpmap:103 H264/90000 a=recvonly a=direction:passive a=ssrc:2717 cname:user225@host-9b2 SDP Offer to RtpEndpoint: SDP Answer from RtpEndpoint:
  • 28. A closer look – Application example: RTP Receiver Kurento RTP Player is a recent addition to the Kurento Tutorials: ● Receives an audio/video stream. ● Redirects it and sends to a browser through WebRTC. ● http://doc-kurento.readthedocs.io/en/latest/user/tutorials.html#rtp-receiver RTP producer
  • 29. A closer look – Application example: RTP Player void start(String browserSdpOffer) { // Create and link Endpoints MediaPipeline pipeline = kurento.createMediaPipeline(); RtpEndpoint rtpEndpoint = new RtpEndpoint.Builder(pipeline).build(); WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build(); rtpEndpoint.connect(webRtcEndpoint); // Configure the RtpEndpoint String fakeSdpOffer = "..."; String kmsSdpAnswer = rtpEndpoint.processOffer(fakeSdpOffer); String browserSdpAnswer = webRtcEndpoint.processOffer(browserSdpOffer); webRtcEndpoint.gatherCandidates(); }
  • 30. A closer look – Application example: Magic Mirror ● Receives a video stream from a browser. ● Applies Computer Vision to detect a face and overlay a picture. ● Sends back the modified video to the same Endpoint it came from. ● http://doc-kurento.readthedocs.io/en/latest/user/tutorials.html#webrtc-magic-mirror
  • 31. A closer look – Application example: Magic Mirror void start() { // Create and link Endpoints, Filters MediaPipeline pipeline = kurento.createMediaPipeline(); WebRtcEndpoint webRtcEndpoint = new WebRtcEndpoint.Builder(pipeline).build(); FaceOverlayFilter faceOverlayFilter = new FaceOverlayFilter.Builder(pipeline).build(); faceOverlayFilter.setOverlayedImage("mario-hat.png"); webRtcEndpoint.connect(faceOverlayFilter); faceOverlayFilter.connect(webRtcEndpoint); webRtcEndpoint.gatherCandidates(); }
  • 33. Thank you! http://fiware.org Follow @FIWARE on Twitter Juan Navarro Moreno Kurento Software Developer [email protected] github.com/j1elo www.kurento.org