Gstreamer example code doesn't work with vcpkg Gstreamer; can't create any element
Describe the bug When using gstreamer from vcpkg with cmake, no pipeline can be created because gstreamer is unable to construct any element. Example code from gstreamer's basic tutorial doesn't work, but it does work with the system installation of gstreamer (I'm on Linux) My guess is that it can't find any plugins whatsoever but I'm not very knowledgeable about gstreamer either
Environment
- OS: Arch Linux
- Compiler: GCC 13.2.1 20230801
To Reproduce Setup a project with vcpkg cloned into a subdirectory and bootstrapped there
CMakeLists.txt:
cmake_minimum_required(VERSION 3.20)
project(gstreamer-test)
find_package(PkgConfig REQUIRED)
pkg_check_modules(gstreamer-1.0 REQUIRED IMPORTED_TARGET gstreamer-1.0)
add_executable(test main.c)
target_link_libraries(test PkgConfig::gstreamer-1.0)
vcpkg.json:
{
"dependencies": [
"gstreamer"
]
}
main.c: any code from gstreamer's basic tutorials
Run cmake with appropriately set -DCMAKE_TOOLCHAIN_FILE, obviously
Expected behavior The code should work.
Failure logs
Obviously these are logs from gstreamer as there aren't any visible errors from vcpkg (I wouldn't be able to compile the program otherwise)
Output from the hello world example:
$ GST_DEBUG=2 ./test
0:00:00.000650393 541967 0x555b092cf6d0 WARN GST_REGISTRY gstregistrybinary.c:551:gst_registry_binary_check_magic: Binary registry magic version is different : 1.3.0 != 1.23.90
0:00:00.001519358 541967 0x555b092cf6d0 ERROR GST_PIPELINE subprojects/gstreamer/gst/parse/grammar.y:570:gst_parse_element_make: no element "playbin"
(test:541967): GStreamer-CRITICAL **: 23:23:43.518: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
(test:541967): GStreamer-CRITICAL **: 23:23:43.518: gst_element_get_bus: assertion 'GST_IS_ELEMENT (element)' failed
(test:541967): GStreamer-CRITICAL **: 23:23:43.518: gst_bus_timed_pop_filtered: assertion 'GST_IS_BUS (bus)' failed
zsh: segmentation fault (core dumped) GST_DEBUG=2 ./test
Output from the manual hello world example:
$ GST_DEBUG=2 ./test
0:00:00.000639124 550754 0x568d6a9236d0 WARN GST_REGISTRY gstregistrybinary.c:551:gst_registry_binary_check_magic: Binary registry magic version is different : 1.3.0 != 1.23.90
0:00:00.001522758 550754 0x568d6a9236d0 WARN GST_ELEMENT_FACTORY gstelementfactory.c:765:gst_element_factory_make_valist: no such element factory "videotestsrc"!
0:00:00.001529478 550754 0x568d6a9236d0 WARN GST_ELEMENT_FACTORY gstelementfactory.c:765:gst_element_factory_make_valist: no such element factory "autovideosink"!
Not all elements could be created.
I have reproduced this problem locally, I will locate the problem and try to fix it.