New release of GSVideo: 20080911   68 comments

Yesterday I finished a new, “preview”, release of GSVideo (this is the reason for the numbering scheme being just the release date). One of the main novelties here is the availability of a simplified and up-to-date GStreamer installer for Windows, which hopefully will make easier the process of using GSVideo on the Windows platform. The download link is below:

GSVideo 20080911

which includes the GSVideo binaries, source and also the GStreamer installers.

GSVideo itself includes a couple of new features: a GSPlayer class that allows to play any type of media file supported by GStreamer, audio files for instance. This code is based on a GSAudio class contributed by Ryan Kelln. An example that plays a small mp3 file is included (works fine on Linux, for some reason it doesn’t on windows).

The GSCustom class has been renamed to GSPipeline and now it can be ended by a fakesink element, in which case no video frames will be sent to Processing. This can be useful when creating pure audio pipelines. I also added an interesting example posted by equinoxefr75, where a custom pipeline under Linux is created to remove the delay observed when capturing video from a webcam using v4l2.

Again, this release is not very extensively tested, so unexpected errors might happen :-) As always, bug reports, feedback and comments are very much appreciated.

As a final note, for those interested in understanding a little bit better how GStreamer works, this pdf presentation from fluendo can be useful.

Advertisements

Posted September 12, 2008 by ac in Programming

Tagged with , , , ,

68 responses to “New release of GSVideo: 20080911

Subscribe to comments with RSS.

  1. Hello Andres

    I’m trying to use your library with the AsciiVideo example, running Processing 0148 on Ubuntu 8.04 64 bits. I did put gstreamer-java in the classpath. When I run the program, it complains “UnsatisfiedLinkError: unable to load library ‘gstreamer-0.10’: /usr/lib/libgstreamer-0.10.so.0.16: wrong ELF class: ELFCLASS64”, which is pretty logical, since most libraries are compiled for 32 bits. So i installed the 32bits version of the libgstreamer, linked the one in /usr/lib/ to /usr/lib32. Now Processing needs another 32 lib… Is there a way to set GSVideo to get the libraries in the /usr/lib32 directory?

  2. hey,

    Some people found that installing the package libgstreamer0.10-dev solves the problems on Ubuntu 64 bits… did you try this?

    Andres

  3. Yes, i did install this lib, but for amd64… silly me :). I had to install the x86 version with getlibs, and some other gstreamer-related libraries in their 32 bits flavour. Now I’m only stuck with an “IllegalArgumentException: No such Gstreamer factory : v4l2src”. Guess it’s another 32 bits library issue!

  4. Yay, it’s working ! I just had to add the 32 bits version of the gstreamer-plugins : bad, good & ugly.
    Thanks for your help and the GSVideo library!

    • @dwan: can you help me out with the “no such Gstreamer factory” problem? I’m on 64 bit Ubuntu and it’s the first time I try Processing outside Mac OS X.

      • A couple of things you can check:

        Are the basic examples working properly on you 64 bits system?
        Did you install the gstreamer packages using Synaptic?

  5. cool, thanks!

  6. Hi there,

    First, thanks for your work, looks brilliant.

    I tried to test an example (backgroundSubtraction) from that context :
    Windows XP SP2
    processing 148 beta and processing 154 beta
    java version “1.6.0_04” and java version “1.6.0_04”
    I installed both normal and dev Gstreamer thanks to your installer

    I’ve got those errors :

    ** (java.exe:2908): WARNING **: Failed to load plugin ‘C:\gstreamer\lib\gstreamer-0.10/libdshowsrcwrapper.dll’

    ** (java.exe:2908): WARNING **: Failed to load plugin ‘C:\gstreamer\lib\gstreamer-0.10/libgstdshowvideosink.dll’

    ** (java.exe:2908): WARNING **: Failed to load plugin ‘C:\gstreamer\lib\gstreamer-0.10/libdshowsrcwrapper.dll’

    ** (java.exe:2908): WARNING **: Failed to load plugin ‘C:\gstreamer\lib\gstreamer-0.10/libgstdshowvideosink.dll’

    any idea ?

    Paul

  7. It just says the package codeanticode does not exist. I’ve tried putting it in
    My Documents\processing\libraries
    and it doesn’t work… where does it go ?

    [processing 0.154]

  8. mmh… a number of changes in library handling where introduced in Processing 0149+

    So perhaps I need to recompile gsvideo, I’ll test it and let you know what happens.

  9. ok, I just run the basic examples on Processing 0154, using the latest gsvideo package available (0.5) and works fine… tested on Linux though…

    What is the sketchbook location you have set in preferences? The location of the gsvideo files should be:
    /libraries/gsvideo/library

    I’ll try on Windows later today.

  10. Just a note about the libdshowsrcwrapper errors on windows XP… those are ok, dshowsrcwrapper is not properly configured in this current version of the installer. But the examples should work anyways.

  11. On windows XP (Processing 0154, GStreamerOABuild-20080911 and gsvideo-20080911) I’m getting all these errors:

    ** (java.exe:3872): WARNING **: Failed to load plugin ‘C:\gstreamer\lib\gstreamer-0.10/libdshowsrcwrapper.dll’: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

    but the Loop and Pixelate examples under the Movie categorie work ok. The Scratch example doesn’t, though.

  12. Hi, I’m trying to use your library for an RFID program we’re working on. I’ve noticed that its alot fast than the processing movie library and many thanks.

    Additionally, I’ve noticed that I can’t get larger files to play nor can I get the audio to play. Is there any kind of constraints on these 2 variables?

  13. Many thanks for the feedback!

    If you are working on windows, I have already realized that large video files (high-res., for instance) and audio files are not played. This is a problem with the current release of GstreamerOABuild, and it doesn’t occur when you use the lib on Linux or OSX. Hopefully, I’ll be able to fix these issues in the next version of the windows gstreamer installer.

  14. hi, first of all thanks for this library. the advanteges are obvious ;)
    i test out performances of video on processing at the moment and would like to use pipelines with the GStreamer lib.
    you postet a codesnippet with a test-image generation in the examples.
    is it also possible to use this with files as accoriding to the man pages of the gst-launch, e.g. gst-launch playbin uri=file:///path/to/file.xy ?

    somehow i get java.lang.NumberFormatException and had a look in the code. for i am no java-dev all i get is that you parse the arguments according to the “!” signs.
    how do i have to format the arguments?

    this is my test-snippet:

    /*
    testing piplines with GSVideo
    */

    import codeanticode.gsvideo.*;

    GSPipeline pipe;

    void setup() {
    size(640, 480);

    // Trying a pipline to a file:
    pipe = new GSPipeline(this, "playbin uri=file:///Users/jens/Movies/tool.mov ! width=320 , height=240 , bpp=32 , depth=24");
    }

    void draw() {
    if (pipe.available() == true) {
    pipe.read();
    image(pipe, 160, 100);
    }
    }

    *****
    and this is the exception:

    java(747,0x8c5600) malloc: *** error for object 0x1ce8f0: Non-aligned pointer being freed (2)
    *** set a breakpoint in malloc_error_break to debug
    Exception in thread "Animation Thread" java.lang.NumberFormatException: For input string: "file:///Users/jens/Movies/tool.mov"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:447)
    at java.lang.Integer.parseInt(Integer.java:497)
    at codeanticode.gsvideo.GSPipeline.isIntNumber(GSPipeline.java:340)
    at codeanticode.gsvideo.GSPipeline.extractElements(GSPipeline.java:292)
    at codeanticode.gsvideo.GSPipeline.(GSPipeline.java:94)
    at gstreamer_pipline_test.setup(gstreamer_pipline_test.java:28)
    at processing.core.PApplet.handleDraw(PApplet.java:1372)
    at processing.core.PApplet.run(PApplet.java:1300)
    at java.lang.Thread.run(Thread.java:613)

    any suggestions?

    thanks, jens;

  15. hello jens,

    you cannot create a playbin inside a GSPipeline object. GSPipeline allows you to create pipelines manually, specifying each element in the same way you would do it from the command line.

    There is another object you can use to create a playbin, which is GSPlayer. Look at the Player|Audio example, where GSPlayer is used to play an audio file. You can use it to play a video file if you set the last boolean parameter in the constructor to true, for instance:

    video = new GSPlayer(this, “tool.mov”, true);

  16. I cant see GSCustom.java in source files…

    Its posible to adjust brightness contrasts and other parameters like you can do with xvimagesink??

    gst-launch v4l2src device=”/dev/video0″ ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! xvimagesink brightness=200 contrast=-1000

  17. Hello,

    In the latest release of gsvideo, the GSCustom class was renamed to GSPipeline.

    It is not possible to set brightness or contrast like you would do with xvimagesink… but once you have the video frame inside your program, you can apply on it any effect you implement with Processing, like for example a filter:

    GSPipeline test;

    void setup()
    {
    size(640, 480);

    test = new GSPipeline(this, “videotestsrc pattern=0 ! ffmpegcolorspace ! video/x-raw-rgb, width=320, height=240, bpp=32, depth=24”);

    }

    void draw() {
    if (test.available() == true) {
    test.read();
    image(test, 0, 0, width, height);
    filter(BLUR, 6);

    }
    }

    I hope this helps.

  18. Hi Andres,

    great work on GSVideo. It is so much faster than the built-in implementation.

    I’m new to Processing and have a couple of questions about GSCapture:

    1. How do I get a list of available devices? GSCapture.list() is empty on my Vista64 machine even though Capture.list() works. I am able to use GSCapture despite this with my default device despite this.

    2. If I have multiple cameras hooked up, how do I specify which camera I want to capture from? Are there any caveats to capturing from multiple cameras at the same time?

    3. I tried setting the capture resolution to 80×60 in GSVideo but that doesn’t work–GSCapture.available() returns false. This works with the standard Capture object. 160×120 works though.

    4. I get a Java VM binary crash whenever I terminate an app that uses GSCapture. I can re-run the app despite this. Sorry, don’t have the exact error message, but it’s an error dialog. I don’t get this with Capture.

  19. Hello Johnny,

    The support for multiple cameras and device selections in GSVideo still needs to be implemented.

    I think the 160×120 is a lower limit in the plugin that gstreamer is currently using for capture

    I’m also getting the VM error when closing a GSVideo app. At this point I don’t know the reason, but hopefully will be able to address this problem in next releases of the library.

    Thank for your feedback!
    Andres

  20. Hi Andres,

    thx. for the quick answers.

    1. Regarding multiple camera support in GSCapture–will it be implemented any time soon?

    2. Alternatively is it possible to create a GSCustom object that would pull in data from multiple cameras? I don’t really understand how to put together a pipeline at this point.

    3. Does it make any difference (in terms of getting multiple cameras via GSCapture or GSCustom) if I use Linux instead of Vista64?

    • Multiple camera support and device selection is something that needs to be implemented in gstreamer-java first, which is the layer gluing together GStreamer and GSVideo/Processing. I’m already investigating this now, but at this point I cannot provide you with a good guess on when these features will be finished.

      Ideally, after the lower-level capture infrastructure is resolved in gstreamer-java, the way of selecting input devices will be the same on every platform.

  21. Hi again Andres,

    I got my RFID program working using your GSVideo library and it works great. Since then I’ve tried to transfer my program to a laptop to make it more portable, but now I run into some error with gstreamer and I hope you might be able to guide me.

    When loading the program I get “Failed to load plugin …libdshowsrcwrapper.dll: this application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem”

    I get this error for libgstdshowvideosink.dll as well. The program will eventually load and function, but it is very slow. I’ve tried reinstalling the program to no avail. Any ideas?

    Thanks,
    Mika

  22. to add onto my comment, I am using the OABuild exe. The desktop (runs the program fine) has XP. The laptop also runs XP and installed with the OABuild. So essentially the same exact setup running processing 0156.

  23. Well, I don’t think that the error with dshowsrcwrapper and dshowvideosink are the reason for the program to run slower. In any case, what you can do in order to remove the error is to delete the dshowsrcwrapper and dshowsrcwrapper plugins. Just go to gstreamer/lib/gstreamer-0.10 and delete the files libdshowsrcwrapper.dll and libgstdshowvideosink.dll
    This shouldn’t affect the rest of the plugins, and in any case the capture is done using the winks plugin.

  24. I don’t think I was clear on my purpose. I am displaying videos as an event is triggered, not capturing. the dshowsrcwrapper and dshowvideosink plug ins are for displaying correct?

  25. Sorry for the misunderstanding. However, either dshowsrcwrapper and dshowvideosink are not used at all. dshowsrcwrapper is a plugin to capture video from directshow devices (not used because winks is the default capture plugin), while dshowvideosink allows drawing frames to a directshow surface (not used either because video frames are drawn into Processing canvas).

  26. Have downloaded the latest version of gsvideo (20080911) libraries for recent Processing version on Mac OS 10.4.11. Worked through the issues with installing the libgstreamer library and putting the gsvideo .jar libs into the correct Processing sketchbook folder. So, that’s all good now.

    However, now when I try to run the example movie loop in the lib distro (i.e. simple loop of station.mov), I’m getting the following error that is pasted below. I don’t think it’s a simple permission or file path issue, because the same example code with either the relative (or full) path work fine with the normal Movie class.

    Any ideas on how to fix? Thank you for any help or information!

    Exception in thread “Animation Thread” java.lang.RuntimeException: Could not load movie file /Users/abc/Documents/Processing/test/data/station.mov
    at processing.core.PApplet.die(PApplet.java:2169)
    at processing.core.PApplet.die(PApplet.java:2178)
    at codeanticode.gsvideo.GSMovie.(GSMovie.java:115)
    at codeanticode.gsvideo.GSMovie.(GSMovie.java:47)
    at test.setup(test.java:38)
    at processing.core.PApplet.handleDraw(PApplet.java:1383)
    at processing.core.PApplet.run(PApplet.java:1311)
    at java.lang.Thread.run(Thread.java:613)

  27. Does the Test example works? (it’s inside the Pipelines folder)

    You can also try to run gst-launch from the command line. For example:

    > gst-launch filesrc location=station.mov ! decodebin ! ffmpegcolorspace ! osxvideosink

    If this works, then the problem is in gsvideo…

  28. Attempting the Test example from the Pipelines folder yields the following error below. I don’t see any ‘libgstinterfaces’ library in the /opt/local/lib set of libs that were added with the ‘gstreamer’ package. I’ve got the following new libs from the gstreamer package (along with dependencies):

    libglib-2.0
    libgmodule-2.0
    libgobject-2.0
    libgstbase-0.10
    libgstcontroller-0.10
    libgstdataprotocol-0.10
    libgstnet-0.10
    libgstreamer-0.10
    libgthread-2.0
    gstreamer-0.10/libgstcoreelements
    gstreamer-0.10/libgstcoreindexers

    And the manual command line of ‘gst-launch’ yields “WARNING: erroneous pipeline: no element “decodebin”.

    Could this be a missing library issue? Or perhaps I need to somehow specify an extra LD_LIBRARY_PATH location for the gsvideo java libs to look in (i.e. /opt/local/lib).

    Any ideas from these additional tests? Thanks!

    ————-
    Exception in thread “Animation Thread” java.lang.UnsatisfiedLinkError: Unable to load library ‘gstinterfaces-0.10’: dlopen(libgstinterfaces-0.10.dylib, 1): image not found
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157)
    at com.sun.jna.Library$Handler.(Library.java:123)
    at com.sun.jna.Native.loadLibrary(Native.java:260)
    at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:50)
    at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:47)
    at org.gstreamer.lowlevel.GstInterfacesAPI.(GstInterfacesAPI.java:28)
    at org.gstreamer.lowlevel.GstTypes$StaticData$1.(GstTypes.java:149)
    at org.gstreamer.lowlevel.GstTypes$StaticData.(GstTypes.java:145)
    at org.gstreamer.lowlevel.GstTypes.getTypeMap(GstTypes.java:97)
    at org.gstreamer.lowlevel.GstTypes.classFor(GstTypes.java:75)
    at org.gstreamer.lowlevel.NativeObject.classFor(NativeObject.java:201)
    at org.gstreamer.lowlevel.NativeObject.objectFor(NativeObject.java:178)
    at org.gstreamer.lowlevel.GTypeMapper$3.fromNative(GTypeMapper.java:124)
    at com.sun.jna.Function.invoke(Function.java:231)
    at com.sun.jna.Library$Handler.invoke(Library.java:204)
    at org.gstreamer.lowlevel.GNative$Handler.invoke(GNative.java:214)
    at org.gstreamer.$Proxy18.gst_pipeline_get_bus(Unknown Source)
    at org.gstreamer.Pipeline.getBus(Pipeline.java:220)
    at org.gstreamer.Pipeline.initBus(Pipeline.java:151)
    at org.gstreamer.Pipeline.(Pipeline.java:110)
    at codeanticode.gsvideo.GSPipeline.(GSPipeline.java:72)
    at sketch_dec22a.setup(sketch_dec22a.java:28)
    at processing.core.PApplet.handleDraw(PApplet.java:1383)
    at processing.core.PApplet.run(PApplet.java:1311)
    at java.lang.Thread.run(Thread.java:613)

  29. Seems that your installation of gstreamer is incomplete. I’m assuming that you used macports, did you install the gst-plugins-base, gst-plugins-good, gst-plugins-bad and gst-plugins-ugly packages?

  30. Thanks very much for the info on the additional MacPorts packages required. After installed gst-plugins-base/good/bad/ugly, I am no longer seeing the “cannot open movie” file. Instead am getting the error below… Any info on this one? Does an X/Gnome session need to be active while running Processing on Mac OS X? Thank you!

    ——-

    GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://www.gnome.org/projects/gconf/ for information. (Details – 1: Not running within active session)
    ** Message: don’t know how to handle video/x-svq, svqversion=(int)1, width=(int)160, height=(int)120, framerate=(fraction)2997/125

  31. Please ignore the last question about the GConf error. I went through some of the older posts and also read that the gst-ffmpeg package was required. After adding that, the error went away and the test movie played normally. Great!

    I see that the CPU performance (at least from a quick ‘top’ comparison) is indeed noticeably better than the standard Movie class. The real memory set size seems similar, but that is fine.
    So, a new question. The test movies I’m looking at are playing much smoother and at better speed with the GSMovie class vs. the Movie class. That’s great. But the GSMovie calss in Processing still is not as smooth as a standalone player (i.e. Quicktime, VLC, etc). Are there any recommended code approaches, resource allocations or settings, etc that I can do in my code to get slightly better/faster performance for just a simple play/loop of a movie. Any best practices to optimize the GSVideo/Processing code?

    Thanks again!

  32. Hi, I’m glad to see that you were able to install and run GSVideo.

    As for your question, the mail goal of GSVideo is not to provide a replacement for standalone players such as Quicktime or VLC, but to re-implement the Processing video library using GStreamer. So at this point my focus is to rewrite the Movie, Capture and MovieMaker classes with GStreamer-java (which is the wrapper that allows to access GStreamer from Java apps). Things like performance and memory usage will hopefully get better as the code is debugged and improved.

    This being said, you can try using Processing+GSVideo to implement your own standalone video player (in fact, I wrote my own “experimental” player to test shader effects on video: https://codeanticode.wordpress.com/2008/04/21/realmatik-a-little-demo-of-realtime-video-filters/).
    But I don’t think that using Procesing and GSVideo will ever allow you to get as much performance as Quicktime or VLC, since they are written in native C/C++/objective C code, whereas Processing is Java-based.

    On tip though to improve performance is to combine GSVideo with opengl. Check the GLGraphics library and look at the examples that use opengl textures to read video frames. That speeds up things specially if you want to apply real-time effects on video.

  33. Thanks very much for the detailed explanation about dev roadmap (mem, cpu). You were right about the opengl textures being a better approach. When using the glgraphics lib with a gaussian blur texture, the movie plays better — less jumping and fewer ‘line’ artifacts that pop up. That’s great.
    Two final questions for you although they’re not really directly related to your gsvideo/glgraphics libs — but you might have some insight! :)

    (1) Aside from the gaussian blur filter, any other general filters that you might recommend to make video playback less choppy. Every now and then a very fast, horizontal line shows up and cuts through the picture — it would be nice to minimize those artifacts.

    (2) I’d like to open the video fullscreen on a second display plugged into my mac (i.e. a projector). By any chance, do you know the best way to do this — open fullscreen on a 2nd display. And also, I’d like to get rid of the menu/title bar on/around the video window.

    Any ideas?

    Thanks again for your terrific support!

  34. You can apply any glsl image filter on the videos (edge detection, posterize, sharpen, etc). But I’m not so sure what the source of the artifacts you mention could be. You are using the opengl renderer, right?

    To open a fullscreen window without any menu element, use the “Sketch|Present” option. As for displaying it on the second screen, one trick is to create an output window with the width of the two screens combined, and show the video on the second half of the window.

  35. I read the posts about installing gsvideo on a 64 bit Linux system and I wonder if there is any way to make it work without the need of any 32 bit library.

    Do I need to recompile the .java files in the src directory or do the gstreamer-java-bin-1.0.jar and jna-3.0.4.jar call some 32 bit libraries too?

  36. Hi everyone!

    I’ve just bought an AXIS ip camera. I’m working on it with the GStreamer library.
    I’m tring to get the video source in processing. there is the code:

    import codeanticode.gsvideo.*;
    import hypermedia.video.*;
    GSPipeline pipe;
    OpenCV opencv;

    void setup() {

    pipe = new GSPipeline(this, “gnomevfssrc location=http://192.168.1.90/axis-cgi/mjpg/video.cgi? ! jpegdec ! ffmpegcolorspace”);
    opencv = new OpenCV( this );
    opencv.allocate(352,240);
    }
    void draw() {
    if (pipe.available() == true) {
    pipe.read();
    opencv.copy(pipe, 0, 0, 640, 480, 0, 0, 352, 240);
    }
    }

    ———————————–
    and there is the exception:
    ———————————–

    Exception in thread “Animation Thread” java.lang.NumberFormatException: For input string: “http://192.168.1.90/axis-cgi/mjpg/video.cgi?”
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:449)
    at java.lang.Integer.parseInt(Integer.java:499)
    at codeanticode.gsvideo.GSPipeline.isIntNumber(GSPipeline.java:340)
    at codeanticode.gsvideo.GSPipeline.extractElements(GSPipeline.java:292)
    at codeanticode.gsvideo.GSPipeline.(GSPipeline.java:94)
    at sketch_aug18a.setup(sketch_aug18a.java:27)
    at processing.core.PApplet.handleDraw(PApplet.java:1403)
    at processing.core.PApplet.run(PApplet.java:1328)
    at java.lang.Thread.run(Thread.java:619)

    —————————————

    Any ideas on how to fix?
    Thanks a lot for your help!
    K

    • Hello K,

      From looking at the error information, seems to me that you are using an older version of GSVideo, because I recently reimplemented GSPipeline to avoid this kind of problems when handling URL strings in the pipeline. Try the latest version available at sourceforge and let me know if it works.

  37. Hello,

    yes it works, thanks… but for “pipe.read();” there is this error:

    Exception in thread “Animation Thread” java.nio.BufferUnderflowException

    What does it means?

    Thans a lot for your help.
    K

    • Not sure, it seems to be something related to the buffer that the gstreamer pipeline is handing over to gsvideo. Maybe there are moments during which the buffer is empty…

      Since I don’t have access to the hardware you are using, I’m unable to reproduce this error. I added a try/catch block inside the GSPipeline.read() method, hopefully this will allow the processing sketch to continue running even when buffers are malformed. Try it with the version of gsvideo I uploaded here.

  38. Thanks for your answer!
    but now the terminal display:

    Error getting pixels from pipeline: null

    I’m using ubuntu 9.04 on a 4go Pc, with a good graphic card. When i test the commend line ont the terminal, there is no problem with the display…
    K

    • So gsvideo is receiving null buffers. This is clearly not a problem with gstreamer, since the camera works from the command line. It must be then an issue in the java bindings I’m using to access gstreamer from processing. Unfortunately this will take me some time to figure out. I added a bug report in the sourceforge page of the project. Are you able to run successfully other GSPipelines (like the videotestsrc)?

      • Hello!

        yes no pb with the other GSPipelines. The code works with the USB webcam.
        And no problem with gstreamer when i do “gst-launch gnomevfssrc location=http://192.168.1.90/axis-cgi/mjpg/video.cgi?resolution=352×240 ! jpegdec ! ffmpegcolorspace ! autovideosink
        ” in my terminal….
        K

      • Did you try setting the color format explicitly to rgb:

        pipe = new GSPipeline(this, “gnomevfssrc …blahblah… ffmpegcolorspace ! video/x-raw-rgb, bpp=32, depth=24”);

        ?

      • hi !
        sorry for the delay ;)
        since the last time, i’ve try to remove and install all the openCV et Gstreamer packages. I think that the problem came from the openCV library. The sketch works now with an older version of Gstreamer. Thanks a lot for your help !
        see you!

      • ok, great to hear that you got your ip-camera sketch working! Just out of curiosity, what version of Gstreamer were you using before and what version are you using now?

  39. hi, i have this error when i use GSCaputure(this, “v4l2src”), GSPipeline(this, “v4l2src”) in Processing on ubuntu: “error getting pixels from pipeline: null” … This for example when i play the “fastwebcam” example from gsvideo example

    • Note that some older webcams only work with video4linux (v4l) instead of v4l2. I would recommend you try out the following code, first with v4l2 and then v4l, to see when the error appears:

      import codeanticode.gsvideo.*;
      GSPipeline pipeline;
      void setup() {
        size(640, 480);
        pipeline = new GSPipeline(this, "v4l2src ! ffmpegcolorspace ! video/x-raw-rgb, width=640, height=480, bpp=32, depth=24");
      }
      
      void pipelineEvent(GSPipeline p) {
        p.read();  
      }
      
      void draw() {
        if (pipeline.width > 1 && pipeline.height > 1) {
          image(pipeline, 0, 0);
        }
      }
      
      • hi AC, i try your sketch, when i user v4l2src the webcam led is off, instead when i use v4lsrc is on. but in the both case i have only the gray screen, and not image displayed. But when i write “pipeline = new GSPipeline(this, “v4l2src ! ffmpegcolorspace ! video/x-raw-rgb, width=640, height=480, bpp=32, depth=24″)” without “width=640, height=480, bpp=32, depth=24”.. like this :pipeline = new GSPipeline(this, “v4l2src ! ffmpegcolorspace ! video/x-raw-rgb”) something upping: on the gray screen i have a little black display, and processing give me this error : error getting pixels from pipeline: null

  40. What version of GSVideo are you using? Latest one (0.7)?

  41. yes the last one gsvideo-linux-0.7, i untarit a put it in processing libraries folder. that’s all i do

  42. yesGSVIDEO-LINUX-0.7, in ubuntu 10.04. i untar it e put it in processing libraries folder. that’s all i do.

  43. Since the camera led only turns on when you use v4l, I’m inclined to think that v4l2 doesn’t support your webcam. One further test you can do is to run the capture pipeline from the linux terminal (not from processing). This should do it:

    gst-launch-0.10 v4lsrc ! ffmpegcolorspace ! xvimagesink

    If this test also fails, then the problem is not in Processing or GSVideo.

  44. Ok, so the camera is fine and gstreamer supports it. Running the pipeline in Processing requires the color conversion because Processing uses pixels in rgb format. Maybe we were specifying the wrong height and with. What about running the following then:

    pipe = new GSPipeline(this, “v4l2src ! ffmpegcolorspace ! video/x-raw-rgb, bpp=32, depth=24”);

    Note that neither width nor height are indicated. In this way the camera will use its default resolution. Hopefully this works.

    • thanks man, now GSPipeline work, but GScature does not works. with GScapture the cam led goes on but nothing is displayed…

      • ok… it seems that your camera doesn’t support 640×480 resolution (although sounds strange). You need to pass a a valid resolution to GSCapture. Why don’t you try some typical values (i.e.: 320×240, 720×480, etc) to see which one works. You can also try out different resolutions in the GSPipeline.

    • for example with asciivideo, one of gsvideo examples i have this output: 19200.

      and e black display whitout image.

      • In the worst case scenario (no way to make GSCapture to work) you can adapt the asciivideo and the other examples to use GSPipeline instead.

  45. for example with asciivideo, one of gsvideo example, i have this output: 19200

  46. Hello.

    I would like to know if it’s possible to obtain the audio data from a movie file (together with the video data) in order to manipulate it in real time (using other processing libraries like Minim). Ultimately I wish to 1) read the audio data from the video file; 2) pass it to Minim through an AudioInput; 3) process the audio using Minim; 4) and, if possible, replace audio in the playback of the movie file (as analogous to updating the pixels array for each frame).

    Thanks in advance.

    • Okay, I’ve been tinkering with GSPipelines, but I still don’t know what to do with the audio data (byte[ ]) . What element should I use at the end of the pipe in order to handle the byte array as a set of pitch values?

    • Hello. What kind of processing you need to do on the audio? GStreamer includes some audio effects plugins, maybe this could be useful for you.

      Also, you could use a tee element to split your video stream. Some more information here.

  47. Thanks a lot, Andres. Those came in handy ;)

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: