A couple of GSVideo tips   7 comments

GSVideo is a Processing library I have been working on for almost four years now (!). It improves video support in Processing by using GStreamer as the underlying multimedia toolkit. The latest release is 1.0.0 and it should be used exclusively with Processing 1.x (the alpha releases of Processing 2.0 already include a simplified version of GSVideo as the built-in video library). Two problems users typically face with GSVideo and about which I receive emails from time to time, are (1) using GSVideo in Eclipse, and (2) exporting GSVideo applications from the Processing environment. So I put together in this post a couple of tips that might be useful in these situations.

GSVideo in Eclipse

The main difficult here is to tell GSVideo where to look for the GStreamer native library files. This is an issue only on Windows and OSX, since GStreamer often comes pre-installed in Linux and can be easily accessed by any application. The recommended thing to do in this case is to copy the gsvideo jar files and the gstreamer library files into a folder inside the Eclipse project, which is libs in the example below:

These files are included in the GSVideo zip package, in the library subfolder. Once copied inside the Eclipse project, the jars need to be added into the build path, along with the core.jar and any other jars used by the application. A sample Eclipse project configured in this way is available here as a zip file, and already comes with the gstreamer native libraries for OSX.

Exporting GSVideo applications

When exporting from the PDE sketches that use GSVideo, the resulting applications won’t work because Processing (1.5) won’t copy the required GStreamer native libraries into the application folder. Again, this is a problem only on Windows and OSX, since on Linux the exported application will be able to use the system copy of GStreamer. The solution is to copy the GStreamer files manually, from the library location into the application folder.

For Windows:

On OSX, the package contents needs to be opened first with Finder, and the navigate to Contents/Resources/Java, where the gstreamer folder from GSVideo/library should be copied into:

Copying data files

If the GSVideo application uses video files for playback, then they need to be manually copied to a new data folder inside the exported application folder. The reason for this is that GSVideo cannot load the video files that are automatically placed by Processing inside the application’s jar file in the lib folder.

Some further discussion about these issue in the Processing forum.

About these ads

Posted February 23, 2012 by ac in Programming

Tagged with , , ,

7 responses to “A couple of GSVideo tips

Subscribe to comments with RSS.

  1. Thanks a lot! This is great stuff, and very useful. If possible could you look at my update on StackOverflow? http://stackoverflow.com/questions/19451315/trouble-advancing-and-redrawing-mpeg2-frames-processing2-gsvideo1-0-osx10-8-5 ?

    I have a gst-launch pipeline that works on Ubuntu, but I cannot seem to get GSPipeline show anything but a gray box. Also I don’t know how to run gst-launch on OSX given it’s only installed in the local folder according to these instruction, and does not seem to have any of the plugins.

    Cheers!

  2. Hi , thanks for these great libraries . I’m new to processing and trying to do a project with GSvideo . I was trying to play a video with alpha channels which finally I succeeded! :) but the next step in my project is I want to show the webcam feed behind the video with alpha channels. the problem I’m facing now is that when I use GLGRAPHICS in my size() function the webcam feed framerate drops significantly . I researched and there was only one answer to add hint(ENABLE_OPENGL_4X_SMOOTH) after my size() function , which didn’t help. I’ll appreciate if you can help me with this.
    thanks so much

  3. Hi, I’m trying to make an application that exports a video with the help of GSVideo when you run it.
    Whenever I export a jar I get an exception when I run it though:

    “Exception in thread “Animation Thread” java.lang.UnsatisfiedLinkError: Unable to load library ‘gstreamer-0.10′: dlopen(libgstreamer-0.10.dylib, 9): image not found”

    I tried it with the method described here, I tried the preconfigured Eclipse project, but no luck.
    I am working on OS X 10.9.

    Any help would be much appreciated!

    • Hi, can you run the project from Eclipse? For the exported jar, one alternative could be to put the gstreamer libs in some hard-coded location (say /home/user/libs/gstreamer) and then set that location inside the app with the GSVideo.localGStreamerPath variable (see comment in the setup() method of the sample project).

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

Follow

Get every new post delivered to your Inbox.

Join 55 other followers

%d bloggers like this: