sarxos / webcam-capture

The goal of this project is to allow integrated or USB-connected webcams to be accessed directly from Java. Using provided libraries users are able to read camera images and detect motion. Main project consist of several sub projects - the root one, which contains required classes, build-in webcam driver compatible with Windows, Linux and Mac OS, which can stream images as fast as your camera can serve them (up to 50 FPS). Main project can be used standalone, but user is able to replace build-in driver with different one - such as OpenIMAJ, GStreamer, V4L4j, JMF, LTI-CIVIL, FMJ, etc.
http://webcam-capture.sarxos.pl
MIT License
2.28k stars 1.11k forks source link

Raspberry Pi B+ & Raspicam #286

Open portalBlock opened 9 years ago

portalBlock commented 9 years ago

Hi I am trying to get this library to work with the Raspberry Pi model B+ and the Raspicam but it seems to not detect the camera. I was just wondering if there was support for this or not, and if not would it be possible for you to add support? If it already does support the Raspicam are there any special steps needed to get it working?

sarxos commented 9 years ago

Hi @portalBlock,

The Raspicam module is not supported by v4l and this is why it cannot be detected by Webcam Capture API. I tried to write dedicated driver to work on top of MMAL instead of v4l, but there was no Java binding at this time for MMAL, so I failed with this task.

portalBlock commented 9 years ago

Thanks for your response @sarxos, do you know of any library that does support the Raspicam? If not then I guess I will use an external webcam.

sarxos commented 9 years ago

@portalBlock, if you are asking about Java library, then the answer is no - I'm not aware of any Java library that supports Raspicam module. But in the area of non-java projects I read somewhere that OpenCV supports it (so maybe JavaCV support it as well), but I cannot verify this information to be true since I never tested this solution.

portalBlock commented 9 years ago

Thank you very much, and thanks for the awesome library!

sarxos commented 9 years ago

Hi @portalBlock,

The Raspberry Pi Camera Module is now working with Webcam capture API. After the camera is connected and configured you have to enable bcm2835-v4l2. Everything is described in details on this wiki page:

How To Configure Raspberry Pi

Then, you have to use V4L4J driver for Webcam Capture API:

static {
  Webcam.setDriver(new V4l4jDriver());
}

public static void main(String[] args) {
  Webcam webcam = Webcam.getDefault();
  // ... etc
}

Thus I'm closing the issue.