vulkan_decode
Module for UltraGrid software that implements video decoding of H.264 coding format using Vulkan Video.
A H.264 decoder I made as my bachelor’s thesis (text is in Czech, link is HERE). ‘vulkan_decode’ is structured as a module for UltraGrid - software tool for low latency and high-quality video network transmissions. It’s using Vulkan Video API for hardware accelerated decoding. Module is programmed in C, same as majority of UltraGrid.
This project (thesis) was pretty hardcore sice I only had half a year to program the module and write the text. I also had no knowledge about video coding, H.264 coding format, UltraGrid, Vulkan or Vulkan Video beforehand. To not make it too easy, Vulkan actually wants you to parse majority of H.264 bitstream data yourself and also wants you to manually manage reference frames. Output frames are in NV12 format, which is not supported in UltraGrid, so the module needs to manually convert them to I4201. But in the end it all works, even though there are few limitations mentioned below.
I think vulkan_decode module is an interesting achievment as there were only 3 other open source projects2 that used Vulkan Video for decoding at that time. You can find my fork of UltraGrid with vulkan_decode implementation HERE.
Technical aspects
- Decodes H.264 video only.
- The only supported subsampling is 4:2:0 (Vulkan limitation).
- Works reliably only with high video profile.
- Smoothly decodes 720p@100fps or 1080p@30fps – higher resolutions or fps are possible, but might not get decoded properly in time3.
- Should work on all major platforms. However you need to have GPU and driver that supports Vulkan Video.
Video Demo
This module really needs hardware accelerated conversion of formats, which would dramatically boost it’s performance and allow it to decode high-res and/or high-framerate video streams. Since I had only like 4 days left to write the whole text of the thesis, I decided to skip this important optimization.
Not sure if I will ever work on this again. Maybe if I would get contacted by the UltraGrid development team.
-
Thanks to lack of time I had to make this conversion happen on CPU. That makes it the biggest bottleneck of the whole decoding process. ↩︎
-
WickedEngine, Lynne’s ffmpeg branch, NVIDIA’s Vulkan Video samples. ↩︎
-
Sadly there was not enough time to implement performance optimizations. ↩︎