Hello everybody,
J'essaye de faire une application QT integrant Gstreamer et tout ca sur .........windows (7 pour mon cas)
J'ai donc télécharger et installer les packages 1.6.3 (normal et dev) de Gstreamer pour windows.
Gstreamer tout seul fonctionne sans problème. La commande gst-launch-1.0.exe videotestsrc pattern=0 ! autovideosink m'affiche bien une superbe mire.
Maintenant j'essaye de mettre ca dans Qt . (5.4.1 mingw)
Pour fixer les problemes de link ( __gxx_personality_v0) j'ai du virer stdc++.lib,libstdc++.la, and libstdc++.dll du repertoire Gstreamer.
Mon Code Qt integrant Gstreamer compile alors sans problème et se lance. Par contre au moment de faire un play de Gstreamer j'ai l'erreur suivante : "no element "videotestsrc"".
Voici mon .pro :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| #-------------------------------------------------
#
# Project created by QtCreator 2016-01-19T10:06:45
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QtGstreamerPlayer
TEMPLATE = app
win32 {
CONFIG(debug, debug|release): message("QT_CONFIG= debug")
else: message("QT_CONFIG= release")
}
CONFIG(debug, debug|release){
DESTDIR = ${OUT_PWD}/bin/
}
CONFIG(release, debug|release){
DESTDIR = ${OUT_PWD}/bin/
}
#message("Dest DIR= ${DESTDIR}")
INCLUDEPATH += c:/gstreamer/1.0/x86/include \
C:/gstreamer/1.0/x86/lib/gstreamer-1.0/include \
c:/gstreamer/1.0/x86/include/gstreamer-1.0 \
c:/gstreamer/1.0/x86/include/glib-2.0\
c:/gstreamer/1.0/x86/include/glib-2.0/glib \
c:/gstreamer/1.0/x86/lib/glib-2.0/include
LIBS += -Lc:/gstreamer/1.0/x86/lib
LIBS += -lglib-2.0 -lwinpthread -lgstreamer-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0
CONFIG += c:/gstreamer/1.0/x86/lib/pkgconfig
SOURCES += main.cpp\
qtgstreamerplayer.cpp
HEADERS += qtgstreamerplayer.h
FORMS += qtgstreamerplayer.ui |
et mon source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| #include "qtgstreamerplayer.h"
#include <QApplication>
#include <QGuiApplication>
#include <gst/gst.h>
#include "QDebug"
int main(int argc, char *argv[])
{
#if 1
QGuiApplication app(argc, argv);
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
putenv("GST_DEBUG=6");
// putenv("GST_PLUGIN_PATH_1_0=E:\\sdk\\gstreamer\\1.0\\x86_64\\lib\\gstreamer-1.0\\");
// putenv("GST_PLUGIN_PATH=E:\\sdk\\gstreamer\\1.0\\x86_64\\lib\\gstreamer-1.0\\");
putenv("GST_PLUGIN_PATH_1_0=C:\\gstreamer\\1.0\\x86\\lib\\gstreamer-1.0\\");
putenv("GST_PLUGIN_PATH=C:\\gstreamer\\1.0\\x86\\lib\\gstreamer-1.0\\");
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Build the pipeline */
GError *Gerror = NULL;
//pipeline = gst_parse_launch ("ksvideosrc device-index=0 ! autovideosink", &Gerror); // Windows OS specific
//gst-launch-1.0.exe videotestsrc pattern=0 ! autovideosink
pipeline = gst_parse_launch("videotestsrc pattern=0 ! autovideosink", &Gerror);
QString str(Gerror->message);
qDebug() << "gst_parse_launch error: " << str;
if (!pipeline) {
qDebug() << "pipeline empty error = " << str;
exit (1);
}
if (!str.isEmpty())
{
qDebug() << "gst_parse_launch error: " << str;
exit (1);
}
/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, (GstMessageType)(GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
/* Free resources */
if (msg != NULL)
gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return app.exec();
#else
QApplication a(argc, argv);
QtGstreamerPlayer w;
w.show();
return a.exec();
#endif
} |
J'ai plusieurs Warning lors du gst_init de dll qui veulent pas se loader. Je ne sais pas si c'est important et je ne comprends pas pourquoi elles ne veulent pas se loader alors que d'autre se chargent sans problème.
GStreamer-WARNING **: Failed to load plugin 'C:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstvideoconvert.dll': 'C:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstvideoconvert.dll': The specified module could not be found.
Si quelqu'un a une idée ce serait sympa.
Merci
Partager