UPDATE: An updated post about this library can be found here: http://www.mobvcasting.com/wp/?p=455
I just finished up a library for Mobile Processing called MVideoCapture.
I don’t have time to document it at the moment but you can download, look at the source and try out the following sample code:
import com.mobvcasting.mvideocapture.*;
MVideoCapture vidcap;
byte[] videoData;
String captureKey = "Capture";
String captureStop = "Stop Capture";
String showCamera = "Show Camera";
PFont font;
void setup()
{
softkey(showCamera);
vidcap = new MVideoCapture(this);
font = loadFont("ArialMT-12.mvlw");
textFont(font);
text("Welcome to the test MVideoCapture application",10,15);
noLoop();
}
void draw()
{
}
void softkeyPressed(String label)
{
if (label.equals(captureKey))
{
softkey(captureStop);
vidcap.startCapture();
}
else if (label.equals(captureStop))
{
softkey(captureKey);
vidcap.stopCapture();
}
else if (label.equals(showCamera))
{
softkey(captureKey);
vidcap.showCamera();
}
}
void libraryEvent(Object library, int event, Object data)
{
if (library.getClass().isInstance(vidcap) && event == MVideoCapture.CAPTURE_COMPLETE)
{
videoData = (byte[])data;
saveBytes("savedvideobytes",(byte[])data);
softkey(captureKey);
}
}