GSVideo website and new release   17 comments

I uploaded a first version of the website for the GSVideo project:

http://users.design.ucla.edu/~acolubri/processing/gsvideo/home/

I tried to put together all the comments and suggestions that people posted on the blog up to this point.

I also released a new version of the library, 0.4. It includes a new object called GSCustom that allows to build arbitrary GStreamer pipelines inside Processing.

Advertisements

Posted June 13, 2008 by ac in Programming

Tagged with , , , , ,

17 responses to “GSVideo website and new release

Subscribe to comments with RSS.

  1. Hello,

    I’m using your library to display video from a Dazzle DVD recorder un ubuntu 8.04 and processing-0148.

    Everything is fine but the video rendering is a little slow. I’ve tested P3D mode but same results.

    Here is the code:

    import codeanticode.gsvideo.*;

    GSCapture camera;

    void setup() {
    size(800, 400,P3D);
    noStroke();
    // With GSVideo there is not method to select the capture device, yet.
    camera = new GSCapture(this, 320, 240);
    }

    void draw() {

    if (camera.available() == true) {

    camera.read();
    background(0);
    set(10,10,camera);
    stroke(255, 100, 100);
    line(170, 100, 170, 140);
    line(150, 120, 190, 120);
    }
    }

    Can’i optimize the use of lib ? With mplayer, there’s no problem. I think it’s the rendering mode from Pimage, no ?

    Thank’s for your help and your great job ;-)

  2. Hello equinoxfr,

    I’m glad you find the library useful. You are right, there is a way to optimize the rendering of the video frames, because as you said, the bottleneck here is very likely to be PImage.

    A possible solution is to use opengl textures to render the video frames. This solution of course requires you to have a more or less recent video card with opengl accelerated drivers under linux.

    BTW, I have developed another processing library to handle opengl textures and gpu-accelerated video effects in processing. It is called GLGraphics, here is the homepage:
    http://users.design.ucla.edu/~acolubri/processing/glgraphics/home/index.html
    and there is way to combine glgraphics with gsvideo to render the video using the GLTexture object. This technique is described in the GSVideo website, at the end of the advanced use section:
    http://users.design.ucla.edu/~acolubri/processing/gsvideo/home/advanced.html

  3. However, I’m surprised that the playback is slow, since you are using a small resolution, 320×240.

    I don’t discard the possibility of some issue inside gsvideo, but in any case, I’m working right now in a new release of the library where the video capture system will be improved (hopefully :-)).

    Let me know if the glgraphics thing works for you.

  4. Thank’s for your help.

    I’ve tried this code:

    import processing.opengl.*;
    import codeanticode.gsvideo.*;
    import codeanticode.glgraphics.*;

    GSCapture camera;
    GLTexture tex;

    void setup() {
    size(800, 400,GLConstants.GLGRAPHICS);

    // With GSVideo there is not method to select the capture device, yet.
    camera = new GSCapture(this, 320, 240);
    tex = new GLTexture(this);
    }

    void draw() {

    if (camera.available() == true) {
    background(0);
    camera.read();
    tex.putPixelsIntoTexture(camera);
    image(tex, 10, 10, 320, 240);

    // set(10,10,camera);

    stroke(255, 100, 100);
    line(170, 100, 170, 140);
    line(150, 120, 190, 120);
    }
    }

    But there’s only a white image, no video. I’m using old processing (0144) because in 0148 openGL isn’t working under linux (http://dev.processing.org/bugs/show_bug.cgi?id=891).

    Pierre

  5. what version of glgraphics are you using…? Only GLGraphics 0.8.144 works with Processing 0148.

  6. Hello,

    I have same results with version 0.8.2 or 0.8.144.

    Which java version to use ? i use sun jdk 1.6

    Thank’s

  7. Hello,

    i did some new tests. I have same problem with gstreamer in cmd line.

    gst-launch-0.10 v4l2src ! “video/x-raw-yuv”,width=320,height=240 ! xvimagesink

    It works but with a 2 sec delay in video rendering. I can’t have realtime. I would like to pilot a drone with processing, it’s a bit difficult if video isn’t realtime ;-)

  8. Interesting find…

    Perhaps you need to play with the buffering options, etc. in gstreamer. Or could it be a limitation in v4l2?

    At this point I cannot give you much useful information. I’d recommend that you invesigate the gstreamer and/or v4l forums to see if there is some way to speed up the video capture.

  9. Hello,

    I found a great solution with your help. I use a custom pipe with “queue” option and everything works.

    Here is the code.

    import codeanticode.gsvideo.*;

    GSCustom camera;
    //GSCapture camera;

    void setup() {
    size(800, 400,P3D);
    camera = new GSCustom(this, “v4l2src ! queue ! “+”video/x-raw-yuv,width=320,height=240”);

    // camera = new GSCapture(this, 320, 240);
    background(0);
    }

    void draw() {

    if (camera.available() == true) {

    camera.read();
    set(10,10,camera);
    stroke(255, 100, 100);
    line(170, 100, 170, 140);
    line(150, 120, 190, 120);
    }
    }

    Thank’s for your great job ;-)

  10. great!

  11. Hey, I just released a new version of gsvideo. I added your capture code as an example…

    https://codeanticode.wordpress.com/2008/09/12/new-release-of-gsvideo-20080911/

  12. For me, it work’s … thank’s

  13. Pingback: New release of GSVideo: 20080911 « codeanticode

  14. hello,
    im tryin to implemement a barcode scanner on processing, and im using the gsvideo library for it, but everytime i compile the following error occurs:

    “GSCapture constructor is undefined”
    cam = new GSCapture(this, 640, 480, “v4l2src”, parName, parValue); is the line….
    iv included all the libraries required , and the syntax for the constructor is correcty as far as i know..
    pls help!:(

  15. the full code is availiable on the link below..

    http://www.local-guru.net/processing/barcodescanner.pde

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: