Home » Multimedia » Installing GStreamer on Linux for application development

Installing GStreamer on Linux for application development

GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.

In this post will we list the packages you will require to install on your ubuntu machine to get started with gstreamer application development.

$ sudo apt-get install gstreamer-tools
$ sudo apt-get install gstreamer0.10-plugins-good
$ sudo apt-get install libgstreamer0.10-dev

Now, lets execute simple gstreamer init program as below,

$ vim hello_gstinit.c
#include <stdio.h>
#include <gst/gst.h>

int main (int argc, char *argv[]) {
    const gchar *nano_str;
    guint major, minor, micro, nano;

    gst_init (&argc, &argv);

    gst_version (&major, &minor, &micro, &nano);

    if (nano == 1)
        nano_str = "(CVS)";
    else if (nano == 2)
        nano_str = "(Prerelease)";
    else
        nano_str = "";

    printf ("This program is linked against GStreamer %d.%d.%d %s\n", major, minor, micro, nano_str);

return 0;
}
$ gcc -o hello_gstinit hello_gstinit.c -I /usr/include/gstreamer-0.10/ -I /usr/include/glib-2.0/ -I /usr/lib/i386-linux-gnu/glib-2.0/include/ -I /usr/include/libxml2/ -lgstreamer-0.10

Now, if everything is well, you will get an executable as, hello_gstinit which if you run as below, might show something like below,

$ ./hello_gstinit
This program is linked against GStreamer 0.10.36

If there are some packages already installed on your PC and you get some of below errors, you can resolve this as per solutions mentioned below,

ERROR: pipeline could not be constructed: no element “v4l2src”

Solution : 

$ sudo apt-get install gstreamer0.10-plugins-good

ERROR: fatal error: gst/gst.h: No such file or directory

Solution:

$ sudo apt-get install libgstreamer0.10-dev

Reference : https://gstreamer.freedesktop.org/


Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment