KhronosGroup / KhronosGroup/Vulkan-Video-Samples
[BUG] Demuxer behavior if FFmpeg is not found
- Dominant language
- C++
- Stars
- 41
- Forks
- 17
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 9
Description
## Describe the bug
If libswscale is not found, the build reports FFmpeg not found.
libswscale is optional, if it is not available, FFmpeg should still be found.
Additionally, when FFmpeg is **not** found, decoding fails for both: debug and release builds in different ways.
See Observed Behavior for details.
## Setup
- OS: Ubuntu 24.04.4 LTS
- GPU: NVIDIA GeForce RTX 4060 Ti
- Driver Version: Mesa 26.1.0-devel (git-055aec542e)
- Sample Application: decoder
- Sample Application Version: v0.4.2
## Expected Behavior
The libswscale library is optional, if it is not found in the system, FFmpeg should still be found.
If FFmpeg is not found, and no codec is specified, release and debug builds should fail with a proper error.
## Observed Behavior
The first noticeable problem is the warning when cmake is executed.
```
-- Could NOT find FFmpeg (missing: SWSCALE_LIBRARY)
CMake Warning at CMakeLists.txt:132 (message):
Can't find libavcodec, libavformat, or libavutil on Linux!
CMake Warning at CMakeLists.txt:137 (message):
FFMPEG demuxing is not going to be supported.
```
If the decoder is used, the behavior is different for release and debug builds.
### Debug build
```
vk-video-dec-test: $VVS_DIR/vk_video_decoder/libs/VkDecoderUtils/VideoStreamDemuxer.cpp:42: static VkResult
VideoStreamDemuxer::Create(const char*, VkVideoCodecOperationFlagBitsKHR, bool, int32_t, int32_t, int32_t,
VkSharedBaseObj&): Assertion `codecType != VK_VIDEO_CODEC_OPERATION_NONE_KHR' failed.
Aborted (core dumped)
```
### Release build
```
ERROR: Found physical device with name: NVIDIA GeForce RTX 4060 Ti, vendor ID: 10de, and device ID: 2803 NOT having the required
queue families!
Video decode queue family not supported by hardware/driver
```
## Steps to Reproduce
- System with FFmpeg support but libswscale not installed.
- Run the decoder tests using the test framework.
Contributor guide
Research direction
Start with CMakeLists.txt around lines 132 and 137 to inspect how FFmpeg and optional libswscale are detected, then read VideoStreamDemuxer.cpp around line 42 for the missing-codec path. Run the decoder tests using the test framework in both debug and release builds. Done means libswscale absence does not hide FFmpeg, and missing FFmpeg produces a proper error in both configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100