SlideShare a Scribd company logo
A Vulkan Video Encoder
from Mesa to GStreamer
Hyunjun Ko / Stéphane Cerveau
2024-01-06
1
2
Agenda
1. Vulkan Video
2. Mesa - driver
3. GStreamer - application
4. Demos
3
Vulkan Video
Stateless codecs using GPU hardware acceleration
Supported codecs: H.264, H.265, AV1
Closer integration with Graphics and Displays.
Cross-platform and vendor-neutral low-level HW state(-
less) video codecs API
Each driver can operate differently depending on its
capabilities with a common API.
4
Vulkan Video Timeline
March 2018: TSG was created and driven by IHVs such
as AMD/Intel/Nvidia and open source operators
April 2021: including
the Video Decode and Encode extensions
January 2023: Video Extensions for Accelerated H.264
and H.265 Decode
December 2023: Khronos Vulkan Video
Extensions for Accelerated H.264 and H.265 Encode
Provisional extensions released
released
finalized
5
Encoding basics
6
Vulkan Video Encoding
7
The status of
Vulkan Video Encoder Support
in Mesa project
8
Contents
What is Mesa?
History of Vulkan Video development in Mesa
Drivers supporting Vulkan Video in Mesa
Development of Vulkan Video Encoding on Intel GPUs
Challenges
Plan
9
What is Mesa?
Began as an open source implementation of the
OpenGL.
Now actively implementing Vulkan specification on
various GPUs.
Intel, AMD, Qualcomm Adreno(R/E), Raspberry PI, etc..
Contributors: Igalia, Intel, Google, Collabora, Mesa
community.
https://mesa3d.org/
https://gitlab.freedesktop.org/mesa/mesa
10
History of Vulkan Video development in
Mesa
Dave Airlie started in 2022 on AMD and Intel GPU(RADV
and ANV)
With on FFmpeg.
Igalia joined on GStreamer later.
Hyunjun joined in 2023, started working on Intel
GPU(ANV)
So Dave fully dedicated to AMD GPU(RADV).
Dave's blog post
Lynne
11
The status of Vulkan Video development
in Mesa
Implemented and landed decoder first for h264 and
h265.
Now MR for h264/5 encoding are almost ready.
ANV H264 MR #20782
ANV H265 MR #22202
RADV H264/265 MR #20388
RADV MR
ANV Branch
12
Drivers supporting Vulkan
Video in Mesa
GPU H264 dec H265 dec H264 enc H265 enc
Intel(ANV) O O WIP WIP
AMD (RADV) O O Ready Ready
13
Working on Intel GPUs (1)
Dived into Intel Vulkan driver(ANV) in 2023.
Started working on H265 decoding first.
Tons of documents and source code of Intel VAAPI
drivers.
Exhausted to learn lots of Video commands.
But better than nothing :)
14
Working on Intel GPUs (2)
H265 Encoding Sequnce
15
Working on Intel GPUs (3)
Complete each command very carefully.
Otherwise you got a GPU hang or even whole system
down.
When you get a GPU hang and don't see any clue.
Dumping whole video commands encoding a frame(by
VAAPI Driver) into a file.
Compare to commands that you created
16
Working on Intel GPUs (4)
Thanks to the existing infrastrutures of ANV
Easy to handle memories and images.
Thanks to ANV maintainers.
They actively reviewed relevant merge requests.
17
Co-working with
Applications
GStreamer, VK CTS, FFMpeg...
Each uses different parameters and makes it find bugs
easily.
Different resolution, profile, SPS, PPS parameters.
18
Challenges
GPU hang.
Not enough useful tools to investigate.
Lots of generations of Intel GPUs.
Different commands, parameters, memory size,
alignment, etc...
19
Plan 2024
Land h264/h265 encoding support.
AV1 support.
Support other GPUs?
20
a 20-year-old framework for streaming media
applications.
Black boxes interconnection system
Native, multiplatform, highly-optimized framework
21
GStreamer pipeline
22
Vulkan Video support
Follow
Vulkan H.264 decoder in December 2023
Vulkan H.264/H.265 encoder .
Vulkan Video Status
merged
under review
23
State machine
24
Challenges
25
Cross platform API
Hardware crashes, Thanks Validation Layers!
Exact behavior varies by hardware vendor
Rate control and quality issues
26
Synchronization
Major issues with both decoder and encoder
Old memories from Vulkanised 2023, green screen...
Rework of GStreamer state machine with memory
barriers, fences.
GstVulkanOperation to handle commands
synchronization.
27
DPB management
Understand the correct use of Begin and Encode
reference slots.
Need to declare the reference within Begin command
and use it during the Encode command.
Various crashes in drivers not detected by the Validation
Layers when the standard H.26x parameters (SPS, slice
header) were not filled properly.
Vulkan reference slots management.
28
Vulkan tooling
Validation Layers:
Help validate we understand the specifications correctly
Do not prevent a misconfiguration of the std parameters
Mesa drivers helped to understand driver's pitfalls when
VL was clear.
GFXReconstruct, VK_LAYER_LUNARG_api_dump layer.
CTS: Help with a reference design reviewed by IHVs.
29
Demos
30
Questions ?
31
Thanks
Join us!
https://www.igalia.com/jobs
32
33

More Related Content

PDF
Vulkan Video is Open: Application showcase
PDF
Vulkan Video in GStreamer
PDF
GST Vulkan Video: 2024 edition
PDF
Status of the Vulkan Video ecosystem – XDC 2023
PDF
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
PPSX
10. GPU - Video Card (Display, Graphics, VGA)
PDF
AV1: the next generation video codec
PDF
Vulkan Video is Open: Application showcase
Vulkan Video in GStreamer
GST Vulkan Video: 2024 edition
Status of the Vulkan Video ecosystem – XDC 2023
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
10. GPU - Video Card (Display, Graphics, VGA)
AV1: the next generation video codec

Similar to Implementing a Vulkan Video Encoder From Mesa to GStreamer (20)

PDF
Embedded Recipes 2019 - Making embedded graphics less special
PDF
MOVED: RDK/WPE Port on DB410C - SFO17-206
PDF
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
PDF
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
PDF
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
PDF
Linxu conj2016 96boards
PDF
GstVA: Present, past and future
PDF
IWOCL 2025 Write Once, Deploy Many – 3D Rendering With SYCL Cross-Vendor Supp...
PDF
CUDA by Example : Getting Started : Notes
PDF
Reaching the multimedia web from embedded platforms with WPEWebkit
PPT
Google tv
PDF
DCC Labs Company Presentation
PDF
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
PPTX
Video cards
PDF
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
PDF
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
PDF
DRIVE PX 2
PPTX
Windows7: Video Improvements
PDF
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
PDF
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
Embedded Recipes 2019 - Making embedded graphics less special
MOVED: RDK/WPE Port on DB410C - SFO17-206
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
Linxu conj2016 96boards
GstVA: Present, past and future
IWOCL 2025 Write Once, Deploy Many – 3D Rendering With SYCL Cross-Vendor Supp...
CUDA by Example : Getting Started : Notes
Reaching the multimedia web from embedded platforms with WPEWebkit
Google tv
DCC Labs Company Presentation
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
Video cards
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DRIVE PX 2
Windows7: Video Improvements
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
Ad

More from Igalia (20)

PDF
Life of a Kernel Bug Fix
PDF
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
PDF
Advancing WebDriver BiDi support in WebKit
PDF
Jumping Over the Garden Wall - WPE WebKit on Android
PDF
Collective Funding, Governance and Prioritiation of Browser Engine Projects
PDF
Don't let your motivation go, save time with kworkflow
PDF
Solving the world’s (localization) problems
PDF
The Whippet Embeddable Garbage Collection Library
PDF
Nobody asks "How is JavaScript?"
PDF
Getting more juice out from your Raspberry Pi GPU
PDF
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
PDF
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
PDF
CSS :has() Unlimited Power
PDF
Device-Generated Commands in Vulkan
PDF
Current state of Lavapipe: Mesa's software renderer for Vulkan
PDF
Scheme on WebAssembly: It is happening!
PDF
EBC - A new backend compiler for etnaviv
PDF
RISC-V LLVM State of the Union
PDF
Device-Generated Commands in Vulkan
PDF
Downstream challenges
Life of a Kernel Bug Fix
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
Advancing WebDriver BiDi support in WebKit
Jumping Over the Garden Wall - WPE WebKit on Android
Collective Funding, Governance and Prioritiation of Browser Engine Projects
Don't let your motivation go, save time with kworkflow
Solving the world’s (localization) problems
The Whippet Embeddable Garbage Collection Library
Nobody asks "How is JavaScript?"
Getting more juice out from your Raspberry Pi GPU
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
CSS :has() Unlimited Power
Device-Generated Commands in Vulkan
Current state of Lavapipe: Mesa's software renderer for Vulkan
Scheme on WebAssembly: It is happening!
EBC - A new backend compiler for etnaviv
RISC-V LLVM State of the Union
Device-Generated Commands in Vulkan
Downstream challenges
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Spectroscopy.pptx food analysis technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectroscopy.pptx food analysis technology
Assigned Numbers - 2025 - Bluetooth® Document
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
A comparative analysis of optical character recognition models for extracting...
NewMind AI Weekly Chronicles - August'25-Week II
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine Learning_overview_presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Implementing a Vulkan Video Encoder From Mesa to GStreamer

  • 1. A Vulkan Video Encoder from Mesa to GStreamer Hyunjun Ko / Stéphane Cerveau 2024-01-06 1
  • 2. 2
  • 3. Agenda 1. Vulkan Video 2. Mesa - driver 3. GStreamer - application 4. Demos 3
  • 4. Vulkan Video Stateless codecs using GPU hardware acceleration Supported codecs: H.264, H.265, AV1 Closer integration with Graphics and Displays. Cross-platform and vendor-neutral low-level HW state(- less) video codecs API Each driver can operate differently depending on its capabilities with a common API. 4
  • 5. Vulkan Video Timeline March 2018: TSG was created and driven by IHVs such as AMD/Intel/Nvidia and open source operators April 2021: including the Video Decode and Encode extensions January 2023: Video Extensions for Accelerated H.264 and H.265 Decode December 2023: Khronos Vulkan Video Extensions for Accelerated H.264 and H.265 Encode Provisional extensions released released finalized 5
  • 8. The status of Vulkan Video Encoder Support in Mesa project 8
  • 9. Contents What is Mesa? History of Vulkan Video development in Mesa Drivers supporting Vulkan Video in Mesa Development of Vulkan Video Encoding on Intel GPUs Challenges Plan 9
  • 10. What is Mesa? Began as an open source implementation of the OpenGL. Now actively implementing Vulkan specification on various GPUs. Intel, AMD, Qualcomm Adreno(R/E), Raspberry PI, etc.. Contributors: Igalia, Intel, Google, Collabora, Mesa community. https://mesa3d.org/ https://gitlab.freedesktop.org/mesa/mesa 10
  • 11. History of Vulkan Video development in Mesa Dave Airlie started in 2022 on AMD and Intel GPU(RADV and ANV) With on FFmpeg. Igalia joined on GStreamer later. Hyunjun joined in 2023, started working on Intel GPU(ANV) So Dave fully dedicated to AMD GPU(RADV). Dave's blog post Lynne 11
  • 12. The status of Vulkan Video development in Mesa Implemented and landed decoder first for h264 and h265. Now MR for h264/5 encoding are almost ready. ANV H264 MR #20782 ANV H265 MR #22202 RADV H264/265 MR #20388 RADV MR ANV Branch 12
  • 13. Drivers supporting Vulkan Video in Mesa GPU H264 dec H265 dec H264 enc H265 enc Intel(ANV) O O WIP WIP AMD (RADV) O O Ready Ready 13
  • 14. Working on Intel GPUs (1) Dived into Intel Vulkan driver(ANV) in 2023. Started working on H265 decoding first. Tons of documents and source code of Intel VAAPI drivers. Exhausted to learn lots of Video commands. But better than nothing :) 14
  • 15. Working on Intel GPUs (2) H265 Encoding Sequnce 15
  • 16. Working on Intel GPUs (3) Complete each command very carefully. Otherwise you got a GPU hang or even whole system down. When you get a GPU hang and don't see any clue. Dumping whole video commands encoding a frame(by VAAPI Driver) into a file. Compare to commands that you created 16
  • 17. Working on Intel GPUs (4) Thanks to the existing infrastrutures of ANV Easy to handle memories and images. Thanks to ANV maintainers. They actively reviewed relevant merge requests. 17
  • 18. Co-working with Applications GStreamer, VK CTS, FFMpeg... Each uses different parameters and makes it find bugs easily. Different resolution, profile, SPS, PPS parameters. 18
  • 19. Challenges GPU hang. Not enough useful tools to investigate. Lots of generations of Intel GPUs. Different commands, parameters, memory size, alignment, etc... 19
  • 20. Plan 2024 Land h264/h265 encoding support. AV1 support. Support other GPUs? 20
  • 21. a 20-year-old framework for streaming media applications. Black boxes interconnection system Native, multiplatform, highly-optimized framework 21
  • 23. Vulkan Video support Follow Vulkan H.264 decoder in December 2023 Vulkan H.264/H.265 encoder . Vulkan Video Status merged under review 23
  • 26. Cross platform API Hardware crashes, Thanks Validation Layers! Exact behavior varies by hardware vendor Rate control and quality issues 26
  • 27. Synchronization Major issues with both decoder and encoder Old memories from Vulkanised 2023, green screen... Rework of GStreamer state machine with memory barriers, fences. GstVulkanOperation to handle commands synchronization. 27
  • 28. DPB management Understand the correct use of Begin and Encode reference slots. Need to declare the reference within Begin command and use it during the Encode command. Various crashes in drivers not detected by the Validation Layers when the standard H.26x parameters (SPS, slice header) were not filled properly. Vulkan reference slots management. 28
  • 29. Vulkan tooling Validation Layers: Help validate we understand the specifications correctly Do not prevent a misconfiguration of the std parameters Mesa drivers helped to understand driver's pitfalls when VL was clear. GFXReconstruct, VK_LAYER_LUNARG_api_dump layer. CTS: Help with a reference design reviewed by IHVs. 29
  • 33. 33