FFmpeg Merges Implicit DRM Synchronization For Vulkan

Written by Michael Larabel in Multimedia on 23 September 2024 at 06:20 AM EDT. 9 Comments
MULTIMEDIA
Following Vulkan Video H.264/H.265 video encoder support being merged into the FFmpeg library, the latest improvement for this open-source multimedia API when leveraging Vulkan is implicit DRM synchronization.

FFmpeg developer Lynne who has been leading much of the Vulkan work into FFmpeg merged this implicit DRM synchronization support for the Vulkan hardware context code.

Lynne explained in the commit adding the implicit sync support:
"hwcontext_vulkan: add support for implicit DRM synchronization

More recent kernel versions allow for users to extract a sync_file handle from a DMA-BUF, which can then be imported into Vulkan as a binary semaphore.

This finally allows for synchronization between Vulkan and DMA-BUF images, such as those from screen capture software, or VAAPI, avoiding any corruption artifacts.

This is done fully asynchronously, where we use the kernel's given binary semaphores as a dependency to increment the image's usual VkSemaphores we allocate. The old imported binary semaphores are cleaned up after execution as usual.

In the future, hwcontext_drm should receive support for explicitly synchronized images as well, which would make the synchronization more robust and portable."

Synchronization between Vulkan and DMA-BUF images will be a delight for many. These latest improvements are in FFmpeg Git ahead of the project's next release.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week