New GSVideo with better OSX support   23 comments

With release 0.4.6 of GSVideo (download here) users on Mac and Windows don’t need to do any extra install, since the gstreamer binaries are included inside the library package itself (Mac version uses the gstreamer binaries that are bundled with the current nightly build of songbird 1.1) . Version 0.4.5 on Windows already had this advantage, but it also presented a number of bugs that probably made it somewhat useless (most notably, gsvideo wouldn’t not be work when installed in a path containing spaces), and the included version of gstreamer had some library dependency issues. GSVideo 0.4.6 solved these two problems.

So, this version should greatly simplify the use of gsvideo on both platforms. However, there is one caveat on OSX: it requires to set the DYLD_LIBRARY_PATH environmental variable in order to work properly. Because of this, Processing needs to be started from the terminal using the following series of commands:

> cd /Applications/Processing.app/Contents/MacOS
> export DYLD_LIBRARY_PATH=/Users/username/Documents/Processing/libraries/gsvideo/library/
> ./JavaApplicationStub

This assumes that GSVideo was installed in /Users/username/Documents/Processing/libraries. Clearly, this is not optimal and I’m currently looking for a workaround. I wanted to release the library anyways so people can start testing it on Mac.

Update (thanks to Chandler McWilliams): DYLD_LIBRARY_PATH can also be set permanently by editing the ~/.MacOSX/environment.plist file (more info here). The other big advantage of this approach is that Processing can be run normally from the GUI. The file gstreamerOSX-readme.rtf included with the release in sourceforge contains an example of environment.plist. But please be careful when following this method, since you can break other applications (and even the whole system) when modifying the environment.plist file (specially if typos are introduced in it). Create a backup of your environment.plist file if it already exists before making any changes, and don’t replace its entire contents with the sample I posted on sourceforge example, just add the DYLD_LIBRARY_PATH variable. Hopefully, this hack won’t be needed in the future as we find a better way to install gsvideo on OSX.

Advertisements

Posted January 29, 2009 by ac in Programming

Tagged with , , , , ,

23 responses to “New GSVideo with better OSX support

Subscribe to comments with RSS.

  1. hi , i have a problem with the GSvideo capture fonction :GSCapture

    i would like to make motion capture and to start i’ve tryed the GettingStartedCapture example and it make me a beautifull error :

    Exception in thread “Animation Thread” java.lang.UnsatisfiedLinkError: can’t load library avcodec-51 (avcodec-51|libavcodec-51|libavcodec-51-0) with -Djna.library.path=C:/Program Files/processing-1.0.1/libraries/gsvideo/library\gstreamer\base. Last error:java.lang.UnsatisfiedLinkError: Unable to load library ‘libavcodec-51-0’: Le module spécifié est introuvable.

    at codeanticode.gsvideo.JnaLibLoaderChain.loadLibrary(JnaLibLoaderChain.java:200)
    at codeanticode.gsvideo.JnaLibLoaderChain.load(JnaLibLoaderChain.java:167)
    at codeanticode.gsvideo.JnaLibLoaderChain.preLoadLibs(JnaLibLoaderChain.java:129)
    at codeanticode.gsvideo.JnaLibLoaderChain.getInstance(JnaLibLoaderChain.java:226)
    at codeanticode.gsvideo.GSVideo.init(GSVideo.java:55)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:143)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:131)
    at GettingStartedCapture.setup(GettingStartedCapture.java:33)
    at processing.core.PApplet.handleDraw(PApplet.java:1383)
    at processing.core.PApplet.run(PApplet.java:1311)
    at java.lang.Thread.run(Unknown Source)

    i guess there is something with the avcodec-51.dll

    also i tryed other example with camera capture and always the same error

    the GSMovie give the same error

    i have installed evrything like you recommend , also installed GLGraphics library and progpuklt library

    i have a nvidia 8700m GT also …

    i guess gstreamer gone wrong , i don’t know …

    plz help :)

  2. i’m running under win xp sp3 and i’ve tried the version 4.0 of the gsvideo library and it nearly work , i guess the problem come from the integration of the gstreamer , and i guess the avcodec-51 is for linux …

  3. Hello, I have been testing gsvideo 0.4.6 on a very similar configuration to yours (win XP SP3) and the ffmpeg libraries (avcodec, etc) load fine.

    What zip package are you using? Only gsvideo-0.4.6-win.zip will work, gsvideo-0.4.6.zip doesn’t include the windows gstreamer binaries.

  4. Supreme props for this! The mac os x features are great–but as a linux user I am simply thrilled to be able to play around with video in processing now! This stuff is mind-blowing! Great work and thanks so much!

  5. You welcome! Many thanks for your feedback and compliments. In fact, the Linux version of GSVideo is the simplest to maintain: everything just works out of the box since gstreamer is pre-installed in most, if not all, modern Linux distros. Unfortunately, the situation is not as easy on Windows or Mac, and I have spent the last couple of months just trying to make the installation somewhat simpler on Windows and OSX :-(

  6. Hi !
    I’m testing on OSX 10.4.11 with the Movie Loop example and I get this error:

    jar:file:/Users/liina/Documents/Processing/libraries/gsvideo/library/gsvideo.jar!/codeanticode/gsvideo/LibraryPath.class
    jna.library.path: /Users/liina/Documents/Processing/libraries/gsvideo/library
    java.library.path: :/Users/liina/Documents/Processing/libraries/gsvideo/library:/Users/liina/Documents/Processing/libraries/gsvideo/library/./JavaApplicationStub:/Applications/Processing.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    DYLD_LIBRARY_PATH after = /Users/liina/Documents/Processing/libraries/gsvideo/library/./JavaApplicationStub
    DYLD_LIBRARY_PATH before = null
    Trying to load library file intl-0
    Trying to load library file intl
    Loaded library intl succesfully!
    Trying to load library file oil-0.3-0
    Trying to load library file oil-0.3

    Exception in thread “Animation Thread” java.lang.UnsatisfiedLinkError: can’t load library oil-0.3 (oil-0.3|liboil-0.3|liboil-0.3-0) with -Djna.library.path=/Users/liina/Documents/Processing/libraries/gsvideo/library. Last error:java.lang.UnsatisfiedLinkError: Unable to load library ‘oil-0.3’: dlopen(/Users/liina/Documents/Processing/libraries/gsvideo/library/liboil-0.3.dylib, 1): Library not loaded: libintl.dylib
    Referenced from: /Users/liina/Documents/Processing/libraries/gsvideo/library/liboil-0.3.dylib
    Reason: image not found
    at codeanticode.gsvideo.JnaLibLoaderChain.loadLibrary(JnaLibLoaderChain.java:198)
    at codeanticode.gsvideo.JnaLibLoaderChain.load(JnaLibLoaderChain.java:165)
    at codeanticode.gsvideo.JnaLibLoaderChain.preLoadLibs(JnaLibLoaderChain.java:127)
    at codeanticode.gsvideo.JnaLibLoaderChain.getInstance(JnaLibLoaderChain.java:224)
    at codeanticode.gsvideo.GSVideo.init(GSVideo.java:94)
    at codeanticode.gsvideo.GSMovie.(GSMovie.java:69)
    at codeanticode.gsvideo.GSMovie.(GSMovie.java:49)
    at Loop.setup(Loop.java:36)
    at processing.core.PApplet.handleDraw(PApplet.java:1383)
    at processing.core.PApplet.run(PApplet.java:1311)
    at java.lang.Thread.run(Thread.java:613)

    I think it might have something to do with the .plist file and DYLD_LIBRARY_PATH. I first set it permanently through Chandlers way, and since I got the same error I tried opening Processing through terminal, your way. Neither seems to work. Could you see if there’s anything obvious I’m doing wrong here?

    Could this problem have anything to do with the fact that I first installed GStreamer and the plugins through MacPorts before downloading the 0.4.6 release?

    This library seem like exactly what I’ve been looking for, millions of thanks for all your hard work with it..!

    NYX

  7. Hi!

    From the error log you pasted in your comment above, seems that the DYLD_LIBRARY_PATH environment variable is currently set to /Users/liina/Documents/Processing/libraries/gsvideo/library/./JavaApplicationStub, but the last bit, “/JavaApplicationStub” shouldn’t be there. This could be the problem.

    ac

  8. hey NYX, you might also want to try the jmcvideo library (http://www.mat.ucsb.edu/~a.forbes/PROCESSING/jmcvideo/jmcvideo.html) by Angus Forbes. It works pretty well on OSX.

  9. hey ac!
    yes sure, it was the last bit that was causing the problem. thanks :)
    I will check out the jmcvideo lib also, have you tested it yourself? how would you compare it to your own?
    and I’ll try your glgraphics as well!
    get back to you soon with feedback on how it works

  10. In windows seems to be slower than gsvideo, specially for large res files (like 720×480). I tried an HD video (1280×544), and it crashed. But this could be because of windows…
    Right now I don’t have any Mac handy to run benchmarks, but performance and stability might be better.

  11. Hi, i can’t get it to work on OS X 10.5.6 Intel Mac.

    The Capture examples are not working and i get this error:

    “Exception in thread “Animation Thread” java.lang.IllegalArgumentException: No such Gstreamer factory: osxvideosrc
    at org.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:174)
    at org.gstreamer.ElementFactory.make(ElementFactory.java:166)
    at codeanticode.gsvideo.GSCapture.init(GSCapture.java:278)
    at codeanticode.gsvideo.GSCapture.initOS(GSCapture.java:242)
    at codeanticode.gsvideo.GSCapture.(GSCapture.java:53)”

    All the library files are succesfully loaded.

    “Trying to load library file xxxxx
    Loaded library xxxxx succesfully!”

    Any idea ?

  12. The problem is that even though the GSCapture class is available in OSX, the underlying gstreamer plugin required for capture (osxvideosrc) is not included in the gstreamer distribution currently bundled with GSVideo… I’m considering possible solutions for this problem. Thanks for your feedback!

  13. So i’ll wait patiently, thanks for you reply. :)

  14. i have mac osx 10.5 and i am trying to start processing through terminal as you directed. after i paste in each of the three commands i am hitting return. not sure what is supposed to happen next? processing isn’t opening? i’m new to terminal. thank you for your time and work!

  15. FIrst of all, make sure that in the line “export DYLD_LIBRARY_PATH=/Users/username/Documents/Processing/libraries/gsvideo/library/” you replace “username” by your own user name.

    Also, you have hit return after each line. So, if your user name is mac you would runt the following commands:
    > cd /Applications/Processing.app/Contents/MacOS
    > export DYLD_LIBRARY_PATH=/Users/pal/Documents/Processing/libraries/gsvideo/library/
    > ./JavaApplicationStub

    Processing should run after these sequence of commands, if not, is there any error message displayed in the console?

  16. don’t see an error message. here is a copy of the screen info:
    phillip-andrew-lewis-MacBook-Pro:~ PAL$ > cd /Applications/Processing.app/Contents/MacOS
    -bash: /Applications/Processing.app/Contents/MacOS: is a directory
    phillip-andrew-lewis-MacBook-Pro:~ PAL$ > export DYLD_LIBRARY_PATH=/Users/PAL/Documents/Processing/libraries/gsvideo/library/
    phillip-andrew-lewis-MacBook-Pro:~ PAL$ > ./JavaApplicationStub
    phillip-andrew-lewis-MacBook-Pro:~ PAL$

  17. not so sure what could it be… but seems that something is wrong with the change directory (cd) command, as it gives the message:
    -bash: /Applications/Processing.app/Contents/MacOS: is a directory
    As far as I know, cd doesn’t output anything when it runs ok.

  18. i got it to start processing finally thanks to atrowbri. here is the text i was able to put into terminal. so only one command(return) at the end of this string.

    cd /Applications/Processing.app/Contents/MacOS
    export DYLD_LIBRARY_PATH=/Users/PAL/Documents/Processing/libraries/gsvideo/library/
    ./JavaApplicationStub

  19. i just tried to run a sketch and it seems most of the lib files are working, but then i got this error: (any ideas?)

    Exception in thread “Animation Thread” java.lang.IllegalArgumentException: No such Gstreamer factory: osxvideosrc
    at org.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:174)
    at org.gstreamer.ElementFactory.make(ElementFactory.java:166)
    at codeanticode.gsvideo.GSCapture.init(GSCapture.java:278)
    at codeanticode.gsvideo.GSCapture.initOS(GSCapture.java:242)
    at codeanticode.gsvideo.GSCapture.(GSCapture.java:53)
    at sketch_081225a_Snow.setup(sketch_081225a_Snow.java:88)
    at processing.core.PApplet.handleDraw(PApplet.java:1383)
    at processing.core.PApplet.run(PApplet.java:1311)
    at java.lang.Thread.run(Thread.java:613)

  20. Glad to hear that you get it working.

    As for the problem with GSCapture class, it is not functional yet. I still have to manage to include the required underlying OSX GStreamer plugin for capture, osxvideosrc, in gsvideo-mac.

  21. bummer for me. how far off do you suspect this might be? thanks!

  22. Improving the OSX version of GSVideo and adding capture support is a priority at this point. In a week from now I’ll be meeting with other developers to work specifically in this issues. Hopefully we will arrive to a satisfactory solution. Thanks for your interest and feedback!

  23. I’ve been playing with gstreamer on the mac – I’ve tried both your build and the latest macport versions but I don’t see anything when I just try the simple test:

    gst-launch videotestsrc ! osxvideosink

    It seems to say things are ok “Setting pipeline to PLAYING …” but I don’t see anything on my screen – Any suggestions very welcome!

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

%d bloggers like this: