1

I'm trying to run an example file that comes with ruby-processing, but it crashes with this error each time:

me$ rp5 run ~/rp_samples/samples/processing_app/library/movie/loop.rb 
/Users/jimmy/rp_samples/samples/processing_app/library/movie/loop.rb:14 warning: ambiguous Java methods found, using background(int)
Java::JavaLang::UnsatisfiedLinkError
Could not load library: gstreamer
    org.gstreamer.lowlevel.GstNative.load(org/gstreamer/lowlevel/GstNative.java:53)
    org.gstreamer.lowlevel.GstNative.load(org/gstreamer/lowlevel/GstNative.java:43)
    org.gstreamer.Gst.<clinit>(org/gstreamer/Gst.java:101)
    java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:513)
    RUBY.setup(/rp_samples/samples/processing_app/library/movie/loop.rb:16)
    processing.core.PApplet.handleDraw(processing/core/PApplet.java:2361)
    processing.core.PGraphicsJava2D.requestDraw(processing/core/PGraphicsJava2D.java:240)
    processing.core.PApplet.run(processing/core/PApplet.java:2256)
    java.lang.Thread.run(java/lang/Thread.java:695)

Here's what I've tried:

  1. I was using the bundled (with ruby-processing) jruby-complete, but when this didn't work, I installed the regular jruby package.
  2. I've already added the line from the answer on this page to resolve a Java::JavaLang::RuntimeException to get this far.
  3. I found this question for java, but installing gstreamer via homebrew (on a Mac) didn't work and installing the universal pkg from gstreamer hasn't gotten me any further either.

I just want to play with ruby-processing :(. Let me know if I haven't given enough detail, but does anyone have any ideas? Thanks!

--

EDIT

I believe by looking at the gstreamer-java Google group, that the new version of gstreamer (> 1.0) isn't compatible. I found a collection of the old 0.10 gstreamer libs on homebrew and installed them.

I tried a 'sudo find / -iname "gstnative.java", and I can't seem to find the GSTNative.java file that this error is coming from. Maybe it's packaged somehow with ruby-processing? Anyway.. I found this line in gstreamer-java/src/org/gstreamer/lowlevel/Main.java:

System.setProperty("jna.library.path", "/usr/share/java:/opt/local/lib:/usr/local/lib:/usr/lib");

If I check for the files mentioned in the below comment (la /usr/local/lib/ | grep "gst"), I see them all and they're named both ways (0.10.0.dylib or 0.10.dylib). E.g.

lrwxr-xr-x    1 jimms  admin      71 Jan 12 15:24 libgstinterfaces-0.10.0.dylib -> ../Cellar/gst-plugins-base010/0.10.36/lib/libgstinterfaces-0.10.0.dylib
lrwxr-xr-x    1 jimms  admin      65 Jan 12 15:24 libgstinterfaces-0.10.a -> ../Cellar/gst-plugins-base010/0.10.36/lib/libgstinterfaces-0.10.a
lrwxr-xr-x    1 jimms  admin      69 Jan 12 15:24 libgstinterfaces-0.10.dylib -> ../Cellar/gst-plugins-base010/0.10.36/lib/libgstinterfaces-0.10.dylib

So they seem to be there, but maybe I'm not understanding exactly what it's looking for. Any help is appreciated!

Community
  • 1
  • 1
jimms
  • 21
  • 6
  • https://code.google.com/p/gstreamer-java/issues/detail?id=141 – BMW Jan 12 '15 at 00:50
  • @BMW, Thanks for the link! It helped me get a little further, but I'm still stuck. Edited the post with more info. – jimms Jan 13 '15 at 10:49

1 Answers1

1

It's working now:

I'm not 100% sure about what fixed the problem finally, but, for future-googlers, here's a list of elements that seem to be required:

  1. Do a brew search gst and install anything with 010 appended to it. Gstreamer-java has not been updated to be compatible with any version past gstreamer-0.10.
  2. I updated my JDK to version 7 update 72 (maybe 8 will work, but I haven't tried). At this point, I removed the "java_args": "-d32" line from my .rp5rc file because 32bit mode wasn't supported.
  3. The ruby-processing script doesn't seem to understand relative paths looks in a directory that's relative to where you run the rp5 command (instead of relative to the sketch itself) when loading a file with Movie.new, and so I changed it to an absolute path and Eureka!

--

Edit

Edited step 3 above for clarity: If I had cded into ~/rp_samples/samples/processing_app/library/movie/ before running rp5 run loop.rb it would have helped the troubleshooting process.

jimms
  • 21
  • 6