Preparing ubuntu for gstreamer development

Post Free Ads for Agri, Solar, Eco products

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)";
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 :

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply