SlideShare a Scribd company logo
GStreamer support in WebKit.
What’s new?
Philippe Normand <philn@igalia.com>
1
Talk outline
1. Brief introduction about WebKit
2. Current integration of GStreamer in WebKit
3. Next generation video rendering with GstGL
4. Adaptive streaming with Media Source Extensions
5. Protected content playback with Encrypted Media Extensions
6. WebRTC: are we there yet?
2
Brief introduction about WebKit
3
WebKit: web content rendering
● Originally a KHTML fork started by Apple in 2005
● Contributions from other big companies: Samsung, Intel, Adobe, Canon, …
● Forked by Google in 2012: Blink
● Ports maintained upstream: Mac, GTK, EFL, Windows
● Downstream ports:
○ QtWebKit: deprecated, replaced by QtWebEngine (powered by Blink)
○ WebKitForWayland: tight integration with modern graphics APIs. Soon upstream!
4
WebKit’s building blocks
● WTF: utility/commodity classes
● JavaScriptCore engine
● WebCore: internal library transforming HTML to render layers
○ DOM management, HTML5 specification implementations
○ platform integration for network support, graphics rendering, multimedia, etc…
● WebKit2: high level API and multi-process architecture
○ WebProcess running most of WebCore
○ NetworkProcess managing resources loading
○ UIProcess: graphical rendering in a widget
○ Widget Toolkit public API for GTK+, EFL, etc
5
Current integration of GStreamer
in WebKit
6
<audio> and <video> HTML5 elements
● Media player based on playbin
● One source element for reading data over HTTP(S) with WebCore’s
network resource loader
● Dedicated video sink for rendering to a video layer
● Basic hardware acceleration support (GLTextureUploadMeta)
● Audio/Video/Text tracks integration
● Trick modes, frame-accurate seeking, on-disk buffering
● Codec installer support
7
WebAudio
● Use-case: sound samples control. Examples: games, music production
apps.
GStreamer backend:
● One decoder pipeline to inject audio from files/memory into WebCore’s
WebAudio framework
● One pipeline for playback of generated audio samples
● Integration with Media player to inject <video>/<audio> audio samples into
WebAudio.
8
Next generation video rendering with GstGL
9
Current approach: WebCore’s internal sink
● Allocation query management and handling of the various Meta
negotiations
● Currently only supports GLTextureUploadMeta
● Passes video frames to the player using a signal
=> Basically a Video AppSink
10
New approach using glimagesink
● Handles all the exotic Meta negotiation and allocation for us
● Handles texture conversions and zero-copy within playbin
● Passes textures to WebKit for rendering using the client-draw signal
● Double-buffering within the MediaPlayer and passes textures directly to
layer compositor
● Hardware acceleration and zero-copy support for free
● Reduced code maintenance in the long term!
11
Adaptive streaming: MSE
Media Source Extensions
12
Media Source Extensions
● Allows full control of the web-app on the media content
○ JavaScript feeds data blocks to the player
○ → Buffered ranges available for playback
○ Web-app is aware of the playback lifecycle and of the streams embedded in the media
● Use-cases:
○ Adaptive streaming (example: DASH), needed for YouTube 2015 conformance
○ Time shifting live streams
○ Rich UI showing buffering/bitrate statistics
○ ...
13
How it works
● JavaScript API:
○ MediaPlayer: Associated to <video> tag, configured with a MediaSource
○ MediaSource: Aggregates all the streams of a particular video
○ SourceBuffer:
■ Feedable data source for a particular stream (audio, video, text)
■ Aware of buffered time ranges (Samples)
○ Track: Exposes metadata, can get Samples from the SourceBuffer
● GStreamer implementation:
○ One “append” pipeline per SourceBuffer → generate Samples → stored in the MSE layer
○ One playback pipeline → getting Samples from the MSE layer
14
“Append” Pipeline
typefind qtdemux appsinkappsrc
● Works independently of the player state
● Work in progress: multiple demuxed streams per raw data stream
● Work in progress: better demuxer reconfiguration (caps changes) support
Raw data appended
to a SourceBuffer in
the MSE layer
demuxed samples
to audio/video/text track
in the MSE layer
15
playbin
WebKitMediaSrc
Playback Pipeline - playbin-based
16
appsrc
inputselector
parser bin
appsrc
decodebin
inputselector
playsink
Stream 1
Stream N
Video
Audio
Samples
from track
in the MSE
layer
Samples
from track
in the MSE
layer
parser bin
Protected content playback: EME
Encrypted Media Extensions
17
Encrypted Media Extensions use-case
● Initial spec from Netflix, Microsoft and Google. Apple also involved.
● Implemented in Chrome, Safari, Edge
● Decryption algorithms not mandated by the spec
● Protected content playback:
1. Decryption key negotiation: need-key HTML media event
2. Key acquisition from a license server (CDM interface)
3. Media content decryption
4. Secure video rendering (Protected access to raw video frames)
18
GStreamer’s protection event signaling
1. Demuxer detects encrypted content (ex: pssh box, PIFF UUID box).
2. Demuxer sends protection GstEvent(s).
3. Demuxer exposes protection system in src pad caps.
4. Decodebin hooks up a decryptor element supporting those caps before the
parser and decoder
No upstream decryptor implementation provided. Only signaling.
19
Decryption workflow in WebKit
20
MediaPlayerPrivate
DecryptorDemuxer
Protection event
need-key
waits...
OOB event
decryption
Key negotiation
element message
key / session
“Secure” video rendering - ugly approach
● Main requirement: protection of raw video frames from user-space/main
memory
● glimagesink and webkit videosink don’t comply
● Usual hack in a surprising amount of downstream WebKit forks:
○ render a transparent area instead of the actual video
○ defer video rendering to a separate player / process
○ rendering in a “under-layer”
○ ⇒ integration with CSS/WebGL/Canvas lost
○ ⇒ bad scrolling support
● Not acceptable for WebKit upstream
21
“Secure” video rendering with OP-TEE
● Open Portable Trusted Execution Environment on ARM’s TrustZone
● Decryption performed in OP-TEE OS
● Video4Linux2 mem-to-mem support
● DMA-BUF fds exchange between decoder and renderer
22
WebRTC: are we there yet?
23
Getting there!
● OpenWebRTC is maturing
● Ericsson / Centricular / Igalia / Temasys http://www.webrtcinwebkit.org
● PeerConnection backend improving a lot, video calls now possible!
● DataChannel support also prototyped
● Soon in WebKitGTK upstream
24
Questions?
25

More Related Content

PDF
Petri Niemi Qt Web Kit
PDF
WebKit and GStreamer
PDF
Multimedia in WebKitGtk+, past/present/future
PDF
Efficient multimedia support in QtWebKit on Raspberry Pi (GStreamer Conferenc...
PDF
WebKit, HTML5 media and GStreamer on multiple platforms
PDF
GStreamer-VAAPI: Hardware-accelerated encoding and decoding on Intel hardware...
PDF
Reaching the multimedia web from embedded platforms with WPEWebkit
PDF
Ewebkit basic (Web rendering enging of EFL)
Petri Niemi Qt Web Kit
WebKit and GStreamer
Multimedia in WebKitGtk+, past/present/future
Efficient multimedia support in QtWebKit on Raspberry Pi (GStreamer Conferenc...
WebKit, HTML5 media and GStreamer on multiple platforms
GStreamer-VAAPI: Hardware-accelerated encoding and decoding on Intel hardware...
Reaching the multimedia web from embedded platforms with WPEWebkit
Ewebkit basic (Web rendering enging of EFL)

What's hot (19)

PDF
WebKit2 And You (GUADEC 2013)
PDF
Introduction to QtWebKit
PDF
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
PDF
WebKitGtk+ Project
PDF
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
PDF
Contributions to an open source project: Igalia and the Chromium project
PDF
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
ODP
How to use WebKitGtk+
PDF
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
PDF
Developments in the Qt WebKit Integration
PDF
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
PDF
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
PDF
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
ODP
Deploying and managing gluster using ovirt - fudcon2015
PDF
Google Kubernetes Engine (GKE) deep dive
PDF
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
PDF
Kubernetes 1.12 Update and Container Security with Liz Rice
PDF
OSDC 2019 | KubeVirt: Converge IT infrastructure into one single Kubernetes p...
PDF
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
WebKit2 And You (GUADEC 2013)
Introduction to QtWebKit
WPEWebKit, the WebKit port for embedded platforms (Linaro Connect San Diego 2...
WebKitGtk+ Project
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
Contributions to an open source project: Igalia and the Chromium project
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
How to use WebKitGtk+
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
Developments in the Qt WebKit Integration
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Deploying and managing gluster using ovirt - fudcon2015
Google Kubernetes Engine (GKE) deep dive
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
Kubernetes 1.12 Update and Container Security with Liz Rice
OSDC 2019 | KubeVirt: Converge IT infrastructure into one single Kubernetes p...
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
Ad

Similar to GStreamer support in WebKit. what’s new? (20)

PDF
WebKit and GStreamer (GStreamer Conference 2013)
PDF
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
PDF
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
PDF
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
PDF
WebCodecs in WebKit With GStreamer!
PDF
Add the power of the Web to your embedded devices with WPE WebKit
PPTX
WebRTC Browsers n Stacks Implementation differences
PDF
WebRTC in WPE/GTK Ports: Current status and challenges
PDF
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
PDF
Paris Video Tech #2 - Presentation by Jean-Yves Avenard
PPTX
Putting the 'web' into webRTC
PDF
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
PDF
HTML5 multimedia - where we are, where we're going
PDF
[1C5]Lessons from developing a web browser for raspberry pi
PPTX
Streaming video to html
PDF
HTML5 Multimedia: where we are, where we're going
PPTX
Streaming Media West 2017 - HTML5 Workshop
PDF
SME 2017 - HTML5 workshop
PPTX
Mm sys 2013-demo
PDF
WebKit-powered HTML overlays in your pipeline with GstWPE (GStreamer Conferen...
WebKit and GStreamer (GStreamer Conference 2013)
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
WebCodecs in WebKit With GStreamer!
Add the power of the Web to your embedded devices with WPE WebKit
WebRTC Browsers n Stacks Implementation differences
WebRTC in WPE/GTK Ports: Current status and challenges
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
Paris Video Tech #2 - Presentation by Jean-Yves Avenard
Putting the 'web' into webRTC
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
HTML5 multimedia - where we are, where we're going
[1C5]Lessons from developing a web browser for raspberry pi
Streaming video to html
HTML5 Multimedia: where we are, where we're going
Streaming Media West 2017 - HTML5 Workshop
SME 2017 - HTML5 workshop
Mm sys 2013-demo
WebKit-powered HTML overlays in your pipeline with GstWPE (GStreamer Conferen...
Ad

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?

GStreamer support in WebKit. what’s new?

  • 1. GStreamer support in WebKit. What’s new? Philippe Normand <philn@igalia.com> 1
  • 2. Talk outline 1. Brief introduction about WebKit 2. Current integration of GStreamer in WebKit 3. Next generation video rendering with GstGL 4. Adaptive streaming with Media Source Extensions 5. Protected content playback with Encrypted Media Extensions 6. WebRTC: are we there yet? 2
  • 4. WebKit: web content rendering ● Originally a KHTML fork started by Apple in 2005 ● Contributions from other big companies: Samsung, Intel, Adobe, Canon, … ● Forked by Google in 2012: Blink ● Ports maintained upstream: Mac, GTK, EFL, Windows ● Downstream ports: ○ QtWebKit: deprecated, replaced by QtWebEngine (powered by Blink) ○ WebKitForWayland: tight integration with modern graphics APIs. Soon upstream! 4
  • 5. WebKit’s building blocks ● WTF: utility/commodity classes ● JavaScriptCore engine ● WebCore: internal library transforming HTML to render layers ○ DOM management, HTML5 specification implementations ○ platform integration for network support, graphics rendering, multimedia, etc… ● WebKit2: high level API and multi-process architecture ○ WebProcess running most of WebCore ○ NetworkProcess managing resources loading ○ UIProcess: graphical rendering in a widget ○ Widget Toolkit public API for GTK+, EFL, etc 5
  • 6. Current integration of GStreamer in WebKit 6
  • 7. <audio> and <video> HTML5 elements ● Media player based on playbin ● One source element for reading data over HTTP(S) with WebCore’s network resource loader ● Dedicated video sink for rendering to a video layer ● Basic hardware acceleration support (GLTextureUploadMeta) ● Audio/Video/Text tracks integration ● Trick modes, frame-accurate seeking, on-disk buffering ● Codec installer support 7
  • 8. WebAudio ● Use-case: sound samples control. Examples: games, music production apps. GStreamer backend: ● One decoder pipeline to inject audio from files/memory into WebCore’s WebAudio framework ● One pipeline for playback of generated audio samples ● Integration with Media player to inject <video>/<audio> audio samples into WebAudio. 8
  • 9. Next generation video rendering with GstGL 9
  • 10. Current approach: WebCore’s internal sink ● Allocation query management and handling of the various Meta negotiations ● Currently only supports GLTextureUploadMeta ● Passes video frames to the player using a signal => Basically a Video AppSink 10
  • 11. New approach using glimagesink ● Handles all the exotic Meta negotiation and allocation for us ● Handles texture conversions and zero-copy within playbin ● Passes textures to WebKit for rendering using the client-draw signal ● Double-buffering within the MediaPlayer and passes textures directly to layer compositor ● Hardware acceleration and zero-copy support for free ● Reduced code maintenance in the long term! 11
  • 12. Adaptive streaming: MSE Media Source Extensions 12
  • 13. Media Source Extensions ● Allows full control of the web-app on the media content ○ JavaScript feeds data blocks to the player ○ → Buffered ranges available for playback ○ Web-app is aware of the playback lifecycle and of the streams embedded in the media ● Use-cases: ○ Adaptive streaming (example: DASH), needed for YouTube 2015 conformance ○ Time shifting live streams ○ Rich UI showing buffering/bitrate statistics ○ ... 13
  • 14. How it works ● JavaScript API: ○ MediaPlayer: Associated to <video> tag, configured with a MediaSource ○ MediaSource: Aggregates all the streams of a particular video ○ SourceBuffer: ■ Feedable data source for a particular stream (audio, video, text) ■ Aware of buffered time ranges (Samples) ○ Track: Exposes metadata, can get Samples from the SourceBuffer ● GStreamer implementation: ○ One “append” pipeline per SourceBuffer → generate Samples → stored in the MSE layer ○ One playback pipeline → getting Samples from the MSE layer 14
  • 15. “Append” Pipeline typefind qtdemux appsinkappsrc ● Works independently of the player state ● Work in progress: multiple demuxed streams per raw data stream ● Work in progress: better demuxer reconfiguration (caps changes) support Raw data appended to a SourceBuffer in the MSE layer demuxed samples to audio/video/text track in the MSE layer 15
  • 16. playbin WebKitMediaSrc Playback Pipeline - playbin-based 16 appsrc inputselector parser bin appsrc decodebin inputselector playsink Stream 1 Stream N Video Audio Samples from track in the MSE layer Samples from track in the MSE layer parser bin
  • 17. Protected content playback: EME Encrypted Media Extensions 17
  • 18. Encrypted Media Extensions use-case ● Initial spec from Netflix, Microsoft and Google. Apple also involved. ● Implemented in Chrome, Safari, Edge ● Decryption algorithms not mandated by the spec ● Protected content playback: 1. Decryption key negotiation: need-key HTML media event 2. Key acquisition from a license server (CDM interface) 3. Media content decryption 4. Secure video rendering (Protected access to raw video frames) 18
  • 19. GStreamer’s protection event signaling 1. Demuxer detects encrypted content (ex: pssh box, PIFF UUID box). 2. Demuxer sends protection GstEvent(s). 3. Demuxer exposes protection system in src pad caps. 4. Decodebin hooks up a decryptor element supporting those caps before the parser and decoder No upstream decryptor implementation provided. Only signaling. 19
  • 20. Decryption workflow in WebKit 20 MediaPlayerPrivate DecryptorDemuxer Protection event need-key waits... OOB event decryption Key negotiation element message key / session
  • 21. “Secure” video rendering - ugly approach ● Main requirement: protection of raw video frames from user-space/main memory ● glimagesink and webkit videosink don’t comply ● Usual hack in a surprising amount of downstream WebKit forks: ○ render a transparent area instead of the actual video ○ defer video rendering to a separate player / process ○ rendering in a “under-layer” ○ ⇒ integration with CSS/WebGL/Canvas lost ○ ⇒ bad scrolling support ● Not acceptable for WebKit upstream 21
  • 22. “Secure” video rendering with OP-TEE ● Open Portable Trusted Execution Environment on ARM’s TrustZone ● Decryption performed in OP-TEE OS ● Video4Linux2 mem-to-mem support ● DMA-BUF fds exchange between decoder and renderer 22
  • 23. WebRTC: are we there yet? 23
  • 24. Getting there! ● OpenWebRTC is maturing ● Ericsson / Centricular / Igalia / Temasys http://www.webrtcinwebkit.org ● PeerConnection backend improving a lot, video calls now possible! ● DataChannel support also prototyped ● Soon in WebKitGTK upstream 24