Using Gstreamer with Python2.6 in Windows XP – Pt. 1 Introduction and Installation

(Original post from 31.10.2011)

The three reasons why I feel it useful to compile my experiences with GStreamer under Windows XP, although I am not a good programmer, are as follows.

  1. There isn’t much information on how to effectively install GStreamer bindings with Python2.6 and I ran into some wonderfully confusing problems
  2. All the examples I found, were written for Linux. This caused me some problems for example in terms of knowing which “sink” to use (we’ll get to that I am sure) as they are very different from Linux to Windows
  3. The majority of examples use “pygtk” as the library to make the GUI. While I have nothing against Pygtk, I am used to wxpython in particular, and I would like to have examples without any GUI in general. Kind of a minimal example.

I will try and link to tutorials and information as I go along and quote their code, just in case, the site gets taken down sometime or something like that. The reason, I want to use GStreamer is because I want to write an audio tool for my roleplaying group that can play several audio files at the same time (mp3, ogg or wav) while being cross platform (Windows and Linux, but mostly Windows). As mentioned, the examples in Linux were plenty, Windows less so. I wrote one of those before, so all the functionality around it is already present, but the library didn’t quite cut it for me. There were irresolvable issues with it.

Installation
Let’s start with the installation, which has been quite the charmer for me. NOTE: This for an installation of Gstreamer with bindings to Python2.6.

I tried it with cygwin, as well, because I had so many problems with the “standard” way, but that just led to even more frustration. Mostly because I do not know how to use cygwin properly, I am sure.

Anyhow, go to the following website:

http://code.google.com/p/ossbuild/

and download and install “GStreamer-WinBuilds-GPL-x86.msi” & “GStreamer-WinBuilds-SDK-GPL-x86.msi”

Good, now comes the part that took me the best part of two days to figure out. The SDK installation does not install the bindings directly into your Python installation. I had to do that manually.
I went to:

..\OSSBuild\GStreamer\v0.10.6\sdk\bindings\python\v2.6\lib\site-packages

In your Gstreamer installation and copied and pasted the contents into the following folder in my Python2.6 installation

..\Python26\Lib\site-packages

If you would start an interpreter now, you could import pygst no problem, BUT (there is always a but) not the module “gst”. This was rather vexing. I finally, after about two days of feeling like an idiot, looked at the contents I copied and pasted. There you find a folder named “gst-0.10” and inside that folder was a folder called “gst”. By moving that folder directly into site-packages, I was finally able to import gst in my python interpreter.

There you go, you can now use Gstreamer together with Python2.6.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s