Preparing ubuntu for gstreamer 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)";
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 Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question