Repository navigation
fix(linux): skip h264_vulkan when the device has no H.264 encode queue - #1485
Conversation
ffmpeg 8.1 segfaults while cleaning up a h264_vulkan encoder that failed with "Encoding of h264 is not supported by this device", so the ladder never reached libopenh264 (#1340). Ask Vulkan for an H.264 encode queue family before avcodec_open2 and skip the rung when there is none.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Refs #1340
Problem. On Ubuntu 24.04, libva 2.20 makes the encoder ladder skip VA-API, so it tries
h264_vulkan. When the GPU advertises Vulkan video encode but has no H.264 encode queue (AMD Carrizo in @PyVoyager's report), ffmpeg 8.1 logs "Encoding of h264 is not supported by this device" and segfaults while freeing the half-built encoder. The helper dies before reaching libopenh264.Fix. After creating the Vulkan device, ask Vulkan for a queue family with
VK_QUEUE_VIDEO_ENCODE_BIT_KHRand H.264 encode. That is the same lookup ffmpeg makes. If there is none, the rung is skipped with a readable reason andavcodec_open2is never called. No Vulkan headers needed: only the first four pointer fields ofAVVulkanDeviceContextare read.Measured on a Vivobook (Ubuntu 24.04, libva 2.20, Radeon 610M, Mesa 25.2.8),
ladder_encodes_a_playable_mp4:5d89de10…).vulkan unavailable: the Vulkan device has no H.264 encode queue, then software selected.cargo test --releasein pipewire-capture: 104 passed.Not reproduced: the Carrizo segfault itself, for lack of that GPU.
🤖 Generated with Claude Code
Summary by CodeRabbit