ofxGstreamer Windows Howto


#1

Hi all,

I found it quite difficult to get ofxGstreamer to run in Windows 7, Visual Studio 2015. Although now that it works the steps seem quite logical, I decided to share my insight, as it might save someone else some time.

1) Windows - install gstreamer.

  • You get the installers here. You will need the base installer (like gstreamer-1.0-x86-1.6.4.msi) and the devel installer (like gstreamer-1.0-devel-x86-1.6.4.msi). For 64bit you need the appropriate ones (x86_64).
  • I used Version 1.6.4. as 1.7.1 crashed on my system when decoding h264. But (installer!) it is easy to install and uninstall in case you want to try another version.
  • please install the complete package, otherwise it might not work later on with openFrameworks.
  • On my system the installer wanted to use the second disk for the installation path. To prevent confusion I suggest to change this: In the installer click “custom” and validate the path. If neccessary change it to default (C:\gstreamer). You can then go back and click “complete”.

You then have installed gstreamer on your system. The installer took care of the path variable. You can try if it works by opening a command prompt and typing sth. like “gst-play-1.0 YOURMOVIE.mp4”.

2) openFrameworks- use gstreamer in a vs project.

There is an addon “ofxGStreamer” (Thanks Arturo!). It is a bit of a special case, as it has no source code. It provides a make configuration (addon_config.mk) and an example code to call the player in a project. There is no use to include the addon in vs as vs does not respect the make configuration of the addon. So to use the addon, we do not have to include it in our project as we are used to. Instead we have to check in addon_config.mk what has to be done - and then do this manually in vs.
So open addon_config.mk and check for the section “vs”.

  • ADDON_INCLUDES: Add the paths found here to project properties / C++ / Additional include directories.
    I had problems with system PATH variables, so I resolved the paths, getting something like (for 32bit*):

    C:\gstreamer\1.0\x86\include;
    C:\gstreamer\1.0\x86\include\gstreamer-1.0;
    C:\gstreamer\1.0\x86\include\glib-2.0;
    C:\gstreamer\1.0\x86\lib\glib-2.0\include;
    C:\gstreamer\1.0\x86\lib\gstreamer-1.0\include;
    %(AdditionalIncludeDirectories)

  • ADDON_SOURCES: Add the files noted here to your project by right-clicking the src-Folder, then Add / existing Item.

  • ADDON_LIBS: Add the Add the files found here to project properties / Linker / Input / Additional Dependencies. Again I resolved the paths for I had problems with system PATH variables. You can seperate path and files, leading to something like:

project properties / Linker / General/ Additional Library Directories

C:\gstreamer\1.0\x86\lib;
%(AdditionalLibraryDirectories)

project properties / Linker / Input / Additional Dependencies

gstreamer-1.0.lib;
gstapp-1.0.lib;
gstvideo-1.0.lib;
gstbase-1.0.lib;
gstnet-1.0.lib;
gstaudio-1.0.lib;
gio-2.0.lib;
pangowin32-1.0.lib;
pangocairo-1.0.lib;
gdk_pixbuf-2.0.lib;
pango-1.0.lib;
cairo.lib;
gobject-2.0.lib;
gmodule-2.0.lib;
gthread-2.0.lib;
ffi.lib;intl.lib;
glib-2.0.lib;
%(AdditionalDependencies)

Note that the examples above are on my system. Of course you might have additional settings.

3) .dll trouble

When runnig the program I had multiple errors connected to libstdc+±6.dll. This llibrary might be present multiple times on your system. And you need the correct one to be used. There is multiple solutions to this, but this is another, quite big, topic. The only solution that worked failsafe for me, was to include the correct dll in the bin folder of my openFrameworks app. You find it in C:\gstreamer\1.0\x86\bin (for 32bit*).

4) bit trouble / .dll trouble #2
I had some problems with 32 and 64 bit version of the same App. It probably is wise to decide and then stick to one. If you mingle you might get problems with dlls for the wonrg version being still in cache and stuff. Check if PATH variable has included the path for your gstreamer binaries If should be one of the following and it should be the correct one, according to if you chose 32bit or 64bit.

C:\gstreamer\1.0\x86_64\bin;
C:\gstreamer\1.0\x86\bin;

*for 64 bit you just use the folder gstreamer\1.0\x86_64 instead of gstreamer\1.0\x86. And of course you have to have the 64bit version of gstreamer and gstreamer-devel installed.

have a good day!
oe


#2

thanks for the write up. just to add that with the nightly builds or even using the project generator from the nightly builds it should be able to correctly parse the addon_config.mk of this addon without manually doing all the steps