Здесь вы можете найти проект qt для воспроизведения проблемы
Мне нужно использовать gstreamer внутри Qt / Qml приложения.Я установил gstreamer-1.0-devel-x86_64-1.14.3 и gstreamer-1.0-x86_64-1.14.3
По какой-то причине GST_PLUGIN_PATH не установлено.Я установил его сам с помощью putenv()
.
Я получил много предупреждений, см. Ниже первые,
(gstreamer-test.exe:8540): GStreamer-WARNING **: Failed to load plugin 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgsta52dec.dll': 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgsta52dec.dll': The specified module could not be found.
(gstreamer-test.exe:8540): GStreamer-WARNING **: Failed to load plugin 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstaccurip.dll': 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstaccurip.dll': The specified module could not be found.
(gstreamer-test.exe:8540): GStreamer-WARNING **: Failed to load plugin 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstadder.dll': 'C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstadder.dll': The specified module could not be found.
В коде я пытаюсь сделать несколько GstElement
,
/* Create gstreamer elements */
GstElement *pipeline, *source, *demuxer, *decoder, *conv, *sink;
pipeline = gst_pipeline_new ("audio-player");
source = gst_element_factory_make ("filesrc", "file-source");
demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer");
decoder = gst_element_factory_make ("vorbisdec", "vorbis-decoder");
conv = gst_element_factory_make ("audioconvert", "converter");
sink = gst_element_factory_make ("autoaudiosink", "audio-output");
тогда я проверяю для каждого GstElement
, были ли они хорошо сложены.Результат show,
source == nullptr
demuxer == nullptr
decoder == nullptr
conv == nullptr
, например, в случае source
означает, что factoryname
filesrc
не был найден.
, но gst-inspect-1.0.exe
нашел его как showснимок экрана, ![enter image description here](https://i.stack.imgur.com/vD7Pc.png)
и тем временем работа factoryname
autoaudiosink
.
, чтобы закончить, я получил несколько критических сообщений,
(gstreamer-test.exe:8540): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
(gstreamer-test.exe:8540): GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed
(gstreamer-test.exe:8540): GStreamer-CRITICAL **: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed
(gstreamer-test.exe:8540): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed
понятия не имею, почему я их получил ...
примечание: поскольку qt-gstreamer не поддерживается, я не пробовал.