Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
How to use gstreamer with Qt
GStreamer is a pipeline-based multimedia framework written in the C programming language with the type system based on GObject. GStreamer allows a programmer to create a variety of media-handling components, including simple audio playback, audio and video playback, recording, streaming and editing. The pipeline design serves as a base to create many types of multimedia applications such as video editors, streaming media broadcasters, and media players. Even if most used use cases are covered by Qt Mobility, for instance camera and video/audio player, the developers have still to use GStreamer for sme other use cases as live streaming.
Here it is a "hello world" gstreamer application which simply plays the video stream coming from the videotestsrc.
int main(int argc, char *argv)
QCoreApplication a(argc, argv);
GstElement *bin = gst_pipeline_new ("pipeline");
GstElement *testSrc = gst_element_factory_make("videotestsrc", "source");
GstElement *videoOut = gst_element_factory_make("autovideosink", "video out");
gst_bin_add_many(GST_BIN(bin), testSrc, videoOut, NULL);
gst_element_link_many(testSrc, videoOut, NULL);
Here tit is the project file needed to compile the code above
QT += core
QT -= gui
TARGET = untitled
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-0.10