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.
IndexProcessing DevelopmentLibraries,  Tool Development › LibCV and JMFSimpleCapture
Page Index Toggle Pages: 1
LibCV and JMFSimpleCapture (Read 2771 times)
LibCV and JMFSimpleCapture
Jun 13th, 2006, 10:32pm
 
Hey guys,

I've just stitched together the necessary bits to get my attempt of an alternative video capture library ready for public consumption. So without any further ado, please read all about it here:

http://www.toxi.co.uk/blog/2006/06/libcv-and-jmfsimplecapture.htm
Re: LibCV and JMFSimpleCapture
Reply #1 - Jun 13th, 2006, 10:45pm
 
JMF download only available for Windows?  I didn't see a Mac download and I assume that is why I get a java.lang.NoClassDefFoundError: javax/media/NoDataSourceException?

Hopeful,
Robert
Re: LibCV and JMFSimpleCapture
Reply #2 - Jun 13th, 2006, 11:30pm
 
There're optimized versions for Windows and Linux, but there's also a generic pure Java version for all platforms (hopefully incl. OSX). (It's the last item on the JMF download page).

Fingers x-ed! Smiley
Re: LibCV and JMFSimpleCapture
Reply #3 - Jul 12th, 2006, 10:57am
 
I've tried it in Linux and it works. I'm using the JMF performance pack (the one with native libraries in it). My cam it's a Logitech quickcam express.

However I've got a problem with opengl. Putting size(...,...,OPENGL) and SimpleCapture.initVideo() in the same script causes it to hang on initVideo().

That's not JMFSimpleCapture's fault, as I've also tried opengl with some code for JMF video capture I found in some forum, and it hangs the same way.

Has anyone tried something like this:


import toxi.video.capture.*;
import processing.opengl.*;

String CAPTURE_DEVICE = "v4l:Logitech QuickCam Express II:0";
int CAPTURE_WIDTH = 160;
int CAPTURE_HEIGHT = 120;

void setup() {
 size(CAPTURE_WIDTH, CAPTURE_HEIGHT, OPENGL);
 SimpleCapture capture = new JMFSimpleCapture();
 if (!capture.initVideo(CAPTURE_DEVICE, CAPTURE_WIDTH,
                        CAPTURE_HEIGHT, 0)) {
   println(capture.getError());
   System.exit(0);
 }
 println("initVideo() succesful");
}
void draw() { background(0); }


It hangs on initVideo() without printing anything. With P3D in place of OPENGL it works fine.


Regards


Dario
Re: LibCV and JMFSimpleCapture
Reply #4 - Jul 12th, 2006, 12:11pm
 
Hi Dario,

thanks for the very 1st (and positive) linux feedback, ++pleased to hear it's working for you... Wink

I actually encountered the very same problem with initVideo() hanging in my own project and found the reason that setup()  is being called twice when using OPENGL. I'll add this quite important bit of information to the reference ASAP.

An easy fix for this is:

Code:
SimpleCapture capture;

void setup() {
if (capture==null) {
print("detecting device... ");
capture = new JMFSimpleCapture();
if (!capture.initVideo(CAPTURE_DEVICE, CAPTURE_WIDTH,
CAPTURE_HEIGHT, 0)) {
println(capture.getError());
System.exit(0);
}
println("initVideo() succesful");
}
size(CAPTURE_WIDTH, CAPTURE_HEIGHT, OPENGL);
}


Please let me know if that helped you or if there's another (possibly linux specific) issue...
Re: LibCV and JMFSimpleCapture
Reply #5 - Jul 12th, 2006, 3:47pm
 
Thank you toxi, your fix works fine.

Sorry, I should be much happier... but I needed opengl to speed up fullscreen rendering of video, and I found out that p3d is actually much faster for me than opengl! And I've got an accelerated video card! Don't know, can't get rid of that bloody interpolation...

But that's another issue! Maybe I'll ask somewhere else.

Thanks again

Dario
Re: LibCV and JMFSimpleCapture
Reply #6 - Jul 12th, 2006, 6:30pm
 
setup() almost always gets called twice (unless you don't use size() in your app), which is one of the reasons that size() needs to be the first line of setup(). however, an exception is thrown immediately, which should prevent anything that comes after size() from being called twice.. is this not the case?
Re: LibCV and JMFSimpleCapture
Reply #7 - Apr 29th, 2008, 5:38pm
 
Hi guys, Big problem here!

Spent the hole workday at it and didn't manage to get it to work...

I installed the JMF Performance pack for windows but whenever I try to instanciate a LMFSimpleCapture it throws:

java.lang.NoClassDefFoundError: javax/media/NoDataSourceException
at Temporary_977_176.setup(Temporary_977_176.java:10)


this is the code (very very simple but even then doesn't work?!?!?):

----------------------------------
import toxi.video.capture.*;

SimpleCapture capture;

void setup()
{
 size(800, 600);
 if(capture == null)
 {
   capture = new JMFSimpleCapture();
 }
}
---------------------------------------
Page Index Toggle Pages: 1