We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Gsvideo issues (Read 1517 times)
Gsvideo issues
Dec 10th, 2009, 6:47am
 
Hi there, I'm new to the board but I already read a lot in there for various subjects.
Here is my current problem as I'm building a (simple) camera application. I'm running ubuntu 9.10, I make an extensive use of the gsvideo library (latest version I think gsvideo-0.6-pre0), and I have two main troubles.

First, processing 1.0.9 seems unable to load the classes from the gsvideo library.
The library show up in the "import library" menu, the import command is correct. But it refuses to create GSCapture objects, or GSPipeline, it yells "Cannot find a class or type named "GSCapture".
I'm unable to spot the problem, maybe some syntax changes that I'm unaware of, or library location (seems odd).

Next is more problematic and occurs in processing 1.0.3 (yes I missed a couple of updates).
I am unable to read() a GSPipeline. I used the "Fast_webcam" example. The Pipeline creation shows no error but the app stops immediately on camera.read() and says :
Quote:
"BufferUnderflowException"

console says :
Quote:
Exception in thread "Animation Thread" java.nio.BufferUnderflowException
     at java.nio.HeapIntBuffer.get(HeapIntBuffer.java:127)
     at java.nio.IntBuffer.get(IntBuffer.java:675)
     at codeanticode.gsvideo.GSPipeline.read(GSPipeline.java:146)
     at FastWebcam.draw(FastWebcam.java:41)
     at processing.core.PApplet.handleDraw(PApplet.java:1423)
     at processing.core.PApplet.run(PApplet.java:1328)
     at java.lang.Thread.run(Thread.java:619)


If I change the code to use GSCapture method it works fine. This is frustrating because I need these pipe to work with some DV stream for my project, I saw on another post that it should run allright. But for now the DV stream is not the issue since I can't even create a pipeline using my webcam (same problem I'm able to get the pipeline running with gst-launch, but once in the processing GSPipeline command, it can't read it).
It might be some package missing on my system regarding gstreamer, but at this point I have almost all the gstreamer related ubuntu packages installed :/.

I thought using processing 1.0.9 would help, but... check problem 1.
Thanks for any hints regarding these two issues, if you need additional infos I can get to solve this, I keep investigating.

dF
Re: Gsvideo issues
Reply #1 - Dec 10th, 2009, 12:33pm
 
Hello,

The first problem ("Cannot find a class or type named "GSCapture") in Processing 1.0.9 seems to me an issue with the installation of the library. Not exactly sure what, because I have used multiple versions of Processing before, and as long as gsvideo is in the external libraries folder (usually <sketchbook folder>/libraries/gsvideo) all the versions of processing were able to load it properly.

With regards to GSPipeline, what happens if you try this code:

Code:

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 draw() {
 if (pipeline.available() == true) {
   pipeline.read();
   image(pipeline, 0, 0);
 }
}


Do you still get errors?
Re: Gsvideo issues
Reply #2 - Dec 11th, 2009, 5:39am
 
Hi, thanks for the quick reply.
So for the library error, I tried to add the lib properly in the project's sketchbook folder, same error.
But this is now a minor concern since the code you gave me for the pipeline works great with my webcam, shows no error and display the stream.
I guess it's the gstreamer pipeline that was incorrect, I really need to learn and understand the tons of options available with this software.
(I'm ashamed I must have try "rvb" instead of "rgb" in the video type, a poor froggy error :/ )
Fact is, it works with the webcam AND the DV stream I wanted.
So it is really really cool.
Thanks ac for the support, and of course for the lib. I'll try to investigate this odd behaviour in processing 1.0.9 on my system, its really strange.

Thanks again.

dF
Re: Gsvideo issues DESPERATE FOR ANY HELP TO MOVE THIS
Reply #3 - May 6th, 2010, 5:38am
 

DESPERATE FOR ANY HELP TO MOVE THIS FORWARD AS TIME IS RUNNING OUT

import codeanticode.gsvideo.*;
import hypermedia.video.*;
GSPipeline pipe;
OpenCV opencv;
void setup() {
//  pipe = new GSPipeline(this, "gnomevfssrc location=http://192.168.1.118/axis-cgi/mjpg/video.cgi?resolution=640x480 ! jpegdec ! ffmpegcolorspace");
//  http://192.168.2.3/jpg/image.jpg
pipe = new GSPipeline(this, "gnomevfssrc location=http://192.168.2.3/mjpg/video.mjpg");
opencv = new OpenCV( this );
opencv.allocate(width,height);
}
void draw() {
if (pipe.available() == true) {
  pipe.read();
  opencv.copy(pipe, 0, 0, 640, 480, 0, 0, width, height);
  print ("   hello    ");
}
print ("   not found   ");
}
Page Index Toggle Pages: 1