gpu-video v0.5.0: near-native speeds and macOS support
The post contains release notes for gpu-video v0.5.0, a library for hardware video encoding and decoding, and explains how the speed gains, API changes and VideoToolbox support were achieved. On Vulkan Video[1] targets, decoding is 68% to 164% faster and encoding is 13% to 69% faster, depending on the card and scenario, which the author says puts it in the same range as APIs provided by GPU vendors.
The main encoding change is that the submitting thread no longer waits for each GPU job to finish before sending the next one. The new API is asynchronous: the user passes a callback[2] that receives finished frames or bitstream chunks. Extra input images let copies and encodes run at the same time, which gives full pipelining[3] and about 98% hardware encoder utilization. The decoder has received only the first of these improvements so far.
Benchmarks were run three times each and the median was taken; high-quality encoding on AMD is the one case not comparable with vendor APIs. The library spawns its own thread to wait for operations and run their callbacks, and the authors were still choosing how that thread should wait for both a GPU signal and the user's thread. The third main topic is VideoToolbox[4], which the post calls an Apple API for video, but no details about its features are given.
Read the original smelter.devDiscussion
Sources
-
Software Mansion
gpu-video v0.5.0: what we did to achieve near-native speeds and macOS support




