How to build Gstreamer from sources on Ubuntu?

    When developing  real-time streaming applications using Gstreamer I prefer to build library from sources, than install from official Ubuntu repositories via apt-get. Also building Gstreamer from sources gives you more flexibility and there are a lot of bug fixes, features in latest versions.

     Ordered list of packages to build:   

      For Gstreamer installation from sources I created simple script BUILD-GSTREAMER.SH. Launch in terminal:

      Also next links could be useful for advanced cases:

Steps

#1. Install gstreamer

     Dependencies

#2. Install gst-plugins-base

     Dependencies

#3. Install gst-plugins-good

     Dependencies

#4. Install gst-libav

     Dependencies

#5. Install gst-plugins-bad

     Dependencies

#6. Install gst-plugins-ugly

     Dependencies

#7. Install gst-python

     Dependencies

     Test gst-python     

     If no error messages, than gst-python working correctly, otherwise read next “Usage Tips”

 Usage Tips

     How to use Gstreamer-Python in virtual environment?

     How to fix “Plugin not registered”?

Locate GI_PATH:

For example:

Locate GST_PYTHON_PATH:

  • Find path to gst-python (from which you’ve built gstreamer for python).
  • Check GST_PYTHON_PATH/gi/overrides has next files (Gst.py, GstPbutils.py, _gi_gst.la, _gi_gst.cpython-*m-*-linux-gnu.so)

Copy files from GST_PYTHON_PATH/gi/overrides to GI_PATH/overrides. For example:

Installation Tips

#1. Enable Orc

    Orc accelerates code and makes more efficient data processing (read more). Most of gstreamer plugins (gst-plugins-bad, gst-plugins-ugly, gst-libav) use Orc under the hood. To build Orc from sources use

    Check also this official doc for Orc installation

    Or install with sudo

#2. Failed to load plugin

*Solution

#3. Enable/disable Gtk-docs

#6. Check available flags for lib configuration

Hope everything works fine. Leave questions, problems in comments, I’ll try to find solutions and update this post 😉

Add a Comment

Your email address will not be published. Required fields are marked *