Fresh releases of GSVideo and GLGraphics   31 comments

After taking some time off from gsvideo and glgraphics (in order to finish my MFA project at UCLA), finally had the chance to go back to coding and prepare new releases of both libraries (glgraphics 0.9.1 and gsvideo 0.6-pre0).

I’d say these both releases are more in-progress snapshots than finished versions, fact accentuated in gsvideo by calling it a “pre” release (expect more of these to come in the near future :-))

In the case of gsvideo, the final goal of the 0.6 version is to have proper gstreamer support on the three platforms (Linux, OSX and Windows), as well as working exported applications. The platform that is closest to this goal at this moment is Windows, since gsvideo has been packaged for a while now with the required gstreamer dlls, so no additional install is needed to use gsvideo on this platform. These dlls are the result of the gstreamer-windbuilds and ossbuild projects.

A while ago, user Lincoln from the Processing forums found a hack to solve the apparent inability of gsvideo to create valid exported applications, which is described in this thread. This hack lead me to find what I think is the correct solution for loading the gstreamer dlls from an exported application in windows, and I included this fix in gsvideo-0.6-pre0. However, there is an additional step required after generating the exported application from the PDE. This step consists in copying the folder “gstreamer” located inside “<contributed libraries folder>\gsvideo\library” to the exported application folder (i.e.: inside “<sketch folder>\application.windows”). Otherwise the exported application won’t be able to find the gstreamer dlls. Removing this additional step would require a change in the Processing core (namely, that when an exported application is generated then a recursive copy of subfolders inside the library folder of the library should be performed). So I decided to bug Ben Fry with this feature request.

Please note that this new release of gsvideo should also work on Mac OSX 10.5 (Leopard), provided that gstreamer is installed on the system using the package available for download here. I haven’t tested exported gsvideo applications on OSX, but if the gstreamer package is properly installed, they should work as well.

With regards to GLGraphics, exciting advances are taking place as well. A new developer has been incorporated into the sourceforge project: David Bouchard, who has started his collaboration in the project by submitting modifications to the GLSLShader and GLTextureFilter classes so that they can be created from URL objects instead of filenames alone. Also, from numerous comments and suggestions by Aaron Koblin, the GLModel and GLCamera classes were greatly improved: GLModel now supports texturing and blending, as well as point sprites. All the GLCamera methods (modeled after the API of the Obsessive Camera Direction library) were tested and seem to be working fine, although GLCamera still uses OpenGL units instead Processing screen units. This might lead to some confusion with scaling, which hopefully will solved in next releases of glgraphics.

Advertisements

31 responses to “Fresh releases of GSVideo and GLGraphics

Subscribe to comments with RSS.

  1. Hey Andres, amazing work, will give the libraries a try now and keep you posted!

    Cheers,
    Pedro.

  2. Dude! You are my hero!

    I am in a project to use video capture in Processing on Linux… and as far as I was informed, the video capture in Processing wasn’t available on Linux, and for that reason I was planing do it myself, and while ‘googling’ for something to give a start up, I’ve found your work!

    Awesome! your blog is on my RSS reader! I am your fan!

    • Many thanks for your compliments. Happy to see that the library is useful for Linux users!

      • Definitely! I’m using linux and processing with GSVideo on two machines and it’s great to finally start to see a solution for processing video on linux. Thank you for all your hard work.
        Tim

  3. Hi,

    Could you please update the installation instructions for gsvideo? do I still need to install gtk+? if so, then do you have a link to a recent binary? gstreamer is already included in the processing lib?

    thank you!

  4. hi,

    I am on windows 7 x64 and try to get gsvideo up and running. I installed GStreamerWinBuild-0.10.5.1.exe from http://www.gstreamer-winbuild.ylatuya.es
    and gimp-2.6.8-i686-setup.exe from http://sourceforge.net/projects/gimp-win
    to get gtk+.

    Unfortunately i get an exception when running your windows capture example:

    Exception in thread “Animation Thread” java.lang.IllegalArgumentException: Element does not implement interface
    at org.gstreamer.interfaces.GstInterface.(GstInterface.java:41)
    at org.gstreamer.interfaces.PropertyProbe.(PropertyProbe.java:55)
    at org.gstreamer.interfaces.PropertyProbe.wrap(PropertyProbe.java:46)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:156)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:139)
    at sketch_feb24a.setup(sketch_feb24a.java:26)
    at processing.core.PApplet.handleDraw(PApplet.java:1402)
    at processing.core.PApplet.run(PApplet.java:1327)
    at java.lang.Thread.run(Thread.java:619)

    I tried in the normal processing IDE as well as in a custom eclipse project. I always get that exception.

    can you please point in the right direction?

    thank you very much!

  5. hi,

    I am on windows 7 x64 and try to get gsvideo up and running. I installed GStreamerWinBuild-0.10.5.1.exe from http://www.gstreamer-winbuild.ylatuya.es
    and gimp-2.6.8-i686-setup.exe from http://sourceforge.net/projects/gimp-win
    to get gtk+. I am using gsvideo 0.6-pre0

    Unfortunately i get an exception when running your windows capture example:

    Exception in thread “Animation Thread” java.lang.IllegalArgumentException: Element does not implement interface
    at org.gstreamer.interfaces.GstInterface.(GstInterface.java:41)
    at org.gstreamer.interfaces.PropertyProbe.(PropertyProbe.java:55)
    at org.gstreamer.interfaces.PropertyProbe.wrap(PropertyProbe.java:46)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:156)
    at codeanticode.gsvideo.GSCapture.list(GSCapture.java:139)
    at sketch_feb24a.setup(sketch_feb24a.java:26)
    at processing.core.PApplet.handleDraw(PApplet.java:1402)
    at processing.core.PApplet.run(PApplet.java:1327)
    at java.lang.Thread.run(Thread.java:619)

    I tried in the normal processing IDE as well as in a custom eclipse project. I always get that exception.

    can you please point in the right direction?

    thank you very much!

    • ok, I see the problem. The latest version of gstreamer-winbuilds doesn’t include a patch in the capture element that allows to list the available devices…
      We will address this issue in a next version of the winbuilds.

      For the time being, you have the following options:
      * don’t use the GLCapture.list() method.
      * install an older version of gstreamer-winbuilds (I think 0.10.3.1 does include the patch, available here: http://forja.rediris.es/frs/?group_id=96)
      * if you don’t install any stand-alone gstreamer package, gsvideo should use the built-in gstreamer binaries, which also include the patch.

      • Hi,

        Thanks for the help, everything works fine now.

        And sorry for the double post.
        best regards
        Chris

  6. Hi,

    I am now trying to play 720p movie files. a capture from my hd webcam encoded with mjpeg inside an avi container studders alot. a flv from vimeo is a little better (even though the codec should be more stress for the cpu). I followed your advanced example and draw the video pixels with an opengl texture on the screen.

    I am on a win7 x64 core 2 duo 2.3 Ghz laptop. I am workin inside a custom eclipse project. is it possible that i included the wrong jar files or made some other mistake? from your experience is that the best performance i can expect from this machine with java?

    best regards
    Chris

    • The performance for playback of SD videos should be better… I just tested 720×480 clips encoded with the XVID4 codec and inside an avi container. The playback was acceptable (on Processing 1.0.9 and latest gsvideo, Core2 duo 2.2Ghz machine)… Are you using external gstreamer binaries, or the ones that come bundled with the library package?

      • i uninstalled the GStreamerWinBuild-0.10.5.1 package, so i am guessing that the the dlls that you bundled are used. is there a string with the dll version that i can get via java to check which dlls are used?

        do you know if gstreamer uses its own video decoding lib or the installed codecs on the computer. after reading the description of gstreamer i am not really sure about that.

      • If no external version of gstreamer is installed, then gsvideo is using the binaries that come bundled with it (which are based on gstreamer-winbuilds 0.10.3).

        Also, gstreamer uses its own codecs for playback (lots of them provided by the gst-ffmpeg plugin)

      • Do you know why the performance of gst-ffmpeg is so much different to ffdshow, which uses ffmpeg too? is there a way to get better performance in java? otherwise i will problably have to switch to C++.

        Thanks for your comments.

      • java/processing interface it undoubtedly has an effect on the performance of movie playback… but I still think that SD videos should play smooth enough even with the overhead from java. I’ll do a couple of tests and will let you know…

        About gst-ffmpeg… I think gst-ffmpeg run from the command line with gst-launch should have similar performance to ffmpeg

      • ok, I did some tests with SD video (720×480, XVID MPEG-4, 30fps). The windows version drops frames indeed, with the fps oscillating around 22. However, running on Linux I get good playback at the original rate… I will investigate the reason for this difference. It will take some time though, as now I’m quite busy with some other projects.

  7. Hi,

    Is there a way to get to the settings panel of the capture device or set the exposure time and focus of a camera via java?

    best regards
    Chris

  8. I understand that the issue with exporting valid processing applications is solved in the latest version.
    Does this include applications that read the video from the data folder ?
    If not, is there any hack to solve that also ?

    • The exported application should work fine with latest gsvideo, but the video file needs to put in a location different from the data folder. For instance, you could do:

      movie = new GSMovie(this, “videos/sample.avi”);

      and then copy the video file to the videos folder inside application.windows

  9. Is there a known issue with movie.jump() ?
    I cant get it working. It seems that the jump is always to the beginning of the movie, disregarding whatever I define as jump-target.

    • Look at the example “Scratch” provided with the library. It shows how to use GSMovie.jump() method. Note that jump() expects a jump point expressed in seconds. Does it work as expected on your system?

      • The example works as expected, no problem.
        The movie that I work with is much longer (approx. 400 sec). If I use this movie in the “scratch” example it works also.
        If I run my sketch, it does not work.
        It seems to me, that between movie.play and the movie.jump there needs to be a delay.
        I did a little sketch to test this.
        If on my system I leave the delay logic (counter) out, it will never jump. With this logic it works (counter>5). This might be dependant on the system performance.

        import codeanticode.gsvideo.*;

        GSMovie myMovie;
        int state;
        int counter;
        void setup() {
        size(640, 480);
        background(0);
        state=0;
        counter=0;
        frameRate(10);
        // Load and play the video in a loop
        myMovie = new GSMovie(this, “C:\\video\\komplettV1.mov”);
        myMovie.play();
        }

        void draw() {
        switch (state){
        case 0:
        counter++;
        if (counter>5) { //delay
        myMovie.jump(300.0);//mov is >400 sec
        state++;
        }
        break;
        case 1:
        if (myMovie.available()){
        myMovie.read();

        image(myMovie,0,0);
        }
        break;
        }

        }

      • Thanks for sharing this hack.

  10. I did a fresh installation and gsvideo on an XP PC.
    I have problems with gsvideo, this includes the examples.
    If I run any of those examples I get the error message:
    cant load library glew.32dll with -Djna.library.path=D:/sketchbook/libraries/gsvideo/library\gstreamer\bin last error: java.lang.UnsatisfiedLinkError:Unable to load library ‘glew32.dll’Modul not found.
    Looking into that directory I can see the grew32.dll.
    I have no idea what to.
    Any help would be greatly appreciated.

    • What version of gsvideo are you using?

      • I tried 2 different versions:
        The newest gsvideo-0.6-pre5
        and
        gsvideo-0.5.
        Both show the same problem.
        But I am not really shure, if I have a gsvideo or an OpenGl problem.
        I am currently testing several different processing applications on that pc and applications that use gsvideo OR OpenGl give me unsatisfiedLinkErrors.
        I have a due date beginning next week, so I think I will have to survive without OpenGl and gsvideo (which is hard but possible).
        Of course any ideas on this subject are very welcome.

      • Hi, to rule out a potential issue with your opengl drivers (which could lead to the glew32.dll error), why don’t you try some application that requires opengl?

        You could use glgraphics, for instance.

  11. Pingback: hello world » Blog Archive » 프로세싱 비디오 라이브러리, GSVideo

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: