New version of GSVideo with capture object   31 comments

Here is a new release of the gsvideo library for processing. This version (0.3.9) includes the GSCapture and GSMovieMaker classes (however, GSMovieMaker is not functional yet):

library and examples

source code

So, the GSCapture class is the most important addition at this time. Video capture is highly platform dependent, and it requires different gstreamer input plugins on Linux, Mac OSX and MS Windows.

On Windows, gsvideo uses the directshow wrapper source element. This has the advantage of making available in Processing any camera that is supported by Windows. However, getting the directshow wrapper to work properly is tricky. First of all, you need to install the latest version of GStreamer, which you can grab from here:

Install the packages gstreamer, gst-plugins-base, gst-plugins-good, gst-plugins-bad and gst-plugins-ugly. I have used the “” files, which contain a windows installer for each package. Now, an important detail is that the directshow wrapper included in the latest gst-plugins-bad (0.10.6) package is not the most up-to-date and doesn’t work with many webcams. Here is the dll of the updated directshow wrapper that fixes these compatibility issues. Just download it and copy where the gstreamer plugins are installed, usually in “C:\Program Files\Common Files\GStreamer.10\lib\gstreamer-0.10”.

On Linux, gsvideo uses the video4linux source plugin. If you camera is supported then it should work, but since mine is not I couldn’t test it.

For Mac… well, not much progress really. The biggest issue here is to have an easy way to install gstreamer on OSX. I haven’t had time to work on this, but I’ll try to as soon as possible.

Hopefully the next release of the library will have its own webpage, most likely as a Google code project, where I will also upload simplified installation packages of gstreamer for Windows and OSX, in order to make the setup process less painful for the users of these platforms (gstreamer usually comes preinstalled on most Linux distributions).


Posted March 27, 2008 by ac in Programming

Tagged with , , , , , ,

31 responses to “New version of GSVideo with capture object

Subscribe to comments with RSS.

  1. I’m testing the gsvideo library on gentoo GNU/linux amd64 2007 OS.
    The result is the following error:

    Exception in thread “Thread-1” java.lang.UnsatisfiedLinkError: Unable to load library ‘gstreamer-0.10’: cannot open shared object file: No such file or directory
    at com.sun.jna.NativeLibrary.loadLibrary(

    The gstreamer plugins is installed. The library is in /usr/lib and /usr/lib64.

    I think that has to do with the 64bits system.
    Do you testing on 64bits OS?

  2. Hi Sergio,

    I haven’t tested the library on Linux 64bits,so at this point I don’t know what the reason for the error could be. Did you try the library on other distributions? Perhaps you need to recompile both gstreamer-java and gsvideo for your platform?

    Right now I’m busy with some other projects, but I’ll go back to gsvideo as soon as possible and I’ll look at the Linux issues in more detail.

  3. I’ve got the same error that sergio in ubuntu gutsy, to solve it i just installed libgstreamer0.10-dev and now it is working :D

  4. Pingback: video @ p5 @ linuxBox at [.ranDomLAB.]

  5. Thanks for the fix!

    Were you able to test video capture?

  6. In 32Bit Chroot it’s working, I’m tested with Genius WebCAM eye and kworld PlusTV lite PCI tv capture.

    I able to capture with a miniDV camcorder plugged s-video input to tv capture, but first I had to execute xdtv tuner and select S-Video input.

    On 64bits OS, it’s not working.

  7. I’m glad to hear that the linux version of GSCapture works with all these input devices, at least for 32 bits.

    For 64 bits did you try zea’s suggestion of installing libgstreamer0.10-dev?

  8. On gentoo *-dev packages not exist.
    All system is “-dev”. perhaps your ubuntu gutsy is 32bits?

  9. ups, sorry, the WebCam is Genius VideoCAM N/B, the WebCam Eye is not recognized by the v4l drivers.

  10. Wow! It’s working very very well!! Thank you. I was looking for a way to use video with P5 on Ubuntu.

    As Zea, I had the same error. Install libgstreamer0.10-dev solve evrything…

    Thank you!

  11. Great to hear that the lib is working fine under linux!

    I only have to finish the GSMovieMaker class in order to have all the funcionality available in the built-in video library of processing.

  12. Hi,

    Your lib is really appreciate by linux users, but it seems that the movie.loop() function not work. Am I the only person to have this problem ?

  13. Hello Julien,

    I just tested it on ubuntu 7.10 with a full installation of gstreamer, and I found the problem you mention…the video is not looping. I’ll check this out.


  14. Thank’s andres. I have the same configuration.


  15. Hi everyone
    Many thanks for library and for your time Andres.
    I’m testing gsvideo library on ubuntu, it working well, but i can’t use a web cam, no error appear, but i can’t change the cam. do you know if working the “device[0]”?
    In the standard file “Getting Started with Capture”
    cam = new GSCapture(this, width, height, devices[0])
    thank you.

  16. I haven’t implemented yet a method to select which camera you want to use when creating the capture object.

    However, if the webcam is the only capture device connected to the computer and is not being detected, perhaps the webcam it is not compatible with linux. Have been you able to use it with other applications in ubuntu?

    Here there is a list of compatible USB capture devices:

  17. the webcam is the only capture device connected to the computer and it working fine with skype and puredata.I really don’t know was wrong.

    i’m new user of ubuntu, maybe i have to configure something in the system.
    Any idea?
    Thanks for your help.

  18. You mean skype and puredata under linux?

    What brand and model the webcam is?

  19. Yes, skype and puredata (gem), under linux.
    i use 3 different cam with this program:

    1) i.t. works model DC390
    2) microsoft livecam vx-1000
    3) logitech quickcam communicate stx

    this webcam are not in the list of the webcam supported under linux, but working well with pd e skype on my ubuntu Feisty 7.04.

    I think Gem(puredata) use the same v4l.

    when use GSCapture on processing, no error appear,
    the only thing is: “OS is linux”, but no error.

    gestreamer5 and 7 working properly.

    Do you think i have to buy one cam from the list ?

    Some suggestion?

    Many thanks

  20. Hello Andreas.

    Thank you so much for this Processing Library. I thought I would never get video in P5 under Linux… :-)
    I’ve just installed it on Ubuntu 7.10 connected to a Logitech Quickcam with Processing 0135 linked to jvm/java-6-sun-
    I had to install LibGstreamer0.10-dev to get the library working (as mentioned in upper comments).
    Video playback works fine (all 3 examples) except the fact that the video doesn’t loop.

    Capture doesn’t seem to work. I’m having the same problem as Dami. Nothing appears. No image, no error messages.

    I have only one webcam connected and it works under Xawtv, Camorama, Cheese (which uses Gstreamer, I think) and PD.

    Hope all this info helps you spot the problem.

    Thank you so much again for your excellent work.


  21. Ok guys, many thanks for the bug reports.

    I’m working on a new release of the library right now, so I’ll look at these two issues (video not looping and supported cameras not being detected).

  22. (update)…
    After reading through your source code a bit…
    I found out you are using “v4l2src” as a method for capturing video.
    I don’t know if it helps (don’t have enough coding knowledge to change this and “compile” it to a new library), but I wonder if this might not be the problem…

    When I run Cheese in the command line, It outputs lots of errors while trying to capture images from my webcam with “v4l2src”. But in the end, it works but I don’t know with which method.

    And If I do a “gst-lauch v4l2src” in the terminal, I get errors telling me /dev/video0 is not a v4l2 driver and that I might try v4l instead…

    Hope this helps…

  23. Hi juego, that is in fact a good tip.

    You can actually specify the source element you want to use in the GSCapture object upon creation. By default, it uses v4lsrc, but you can do:

    cam = new GSCapture(this, 320, 240, “v4l”);

  24. Cool. Thanks. It works now :-)
    Though, I had to write it like this:

    cam = new GSCapture(this, 320, 240, “v4lsrc”);

    Thank you so much for replying so quickly to those questions I had.

  25. Yeah, v4lsrc that’s what I meant… Great to hear that it’s working now!

    One area I have to improve greatly in GSCapture is the API interface to select different input devices. In Processing you have the Capture.list() method, I still have to figure out how to come out with something equivalent using gstreamer (while keeping it crossplatform)

  26. I just uploaded a new version of gsvideo:

    which should solve the loop bug. Let me know if it works for you.

  27. Thanks for your work, the video is looping now !!


  28. Many thanks for new version of gsvideo.

  29. Its awesome!!!
    i havent test yet, but i will buy a cam to do this!
    codeanticode, u know how i can export to a video, the program?
    i use to say, i do a program, the i want make a movie with the results, u understand? (sorry my poor english)


  30. Hi, thanks for your comments.

    What are you using, Windows, OSX or Linux? On Windows, almost any camera should work, on Linux, the camera has to be supported by video4linux or video4linux2.

    Unfortunately there is still not support for capture on OSX.

    As for saving the output of your program into a video, I’m currently implementing that feature.

    By the way, this is the website of gsvideo project:
    from which you can grab the latest version of the library.

  31. hi people, i’m using gsvideo-linux-07 in processing on ubuntu 10.04.
    when i try this: “$ gst-launch v4l2src device=/dev/video0 ! ‘video/x-raw-yuv,width=640,height=480,framerate=30/1’ ! xvimagesink ” it works…
    But i try the GSvudei examples i see only black screen, i don’t have some error. I have problem in “video/x-raw-yuv,width=640,height=480” with this options “width=640,height=480”, when i delete it something up: GsPipeline(this, “v4l2src”) give this error: error getting pixels from pipeline: null

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: