Click here to Skip to main content
11,926,472 members (58,629 online)
Rate this:
Please Sign up or sign in to vote.
See more: Java
Hi i create one project using java swing. i want to take a snap picture using web cam when the button click event get generated.

I got some info as JMF is the best way to integrate java with web cam. But i cant have any knowledge in jmf. so please help me friends.

if you know another way to integrate java swing with web cam means please inform me.

else if you know how to use jmf means please help me... Smile | :)
Posted 18-Jan-11 2:55am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

JMF sucks! It's completely outdated, not maintained any more and terribly complicated. The only good thing I can say about it is the fact it is pretty fast.

I'm the author of open source Webcam Capture project available on Github. It s goal is to give users access to build-in or USB connected webcams, same as for network or IP cameras, directly from Java code. You don't need to implement any additional software (as you have to do in case of JMF), it works standalone. It's pretty fast - in my case I was able t stream 250 FPS in BufferedImage objects.

The API I provided in Webcam Capture is really simple, there are many examples, so you can start developing your app and don;t care if it will be working on Linux, Windows, or Mac OS. Webcam Capture will run everywhere.

Here is a simple code. Assume you have two cameras connected to your PC (but of course, you can have only one).

Webcam buildin = Webcam.getWebcams().get(0); // build-in laptop camera
Webcam usb = Webcam.getWebcams().get(1); // usb camera
BufferedImage image1 = buildin.getImage();
BufferedImage image2 = usb.getImage();
// do with image1 and image2 whatever you want
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hope this[^] will give you an idea.
Member 12056141 17-Oct-15 17:10pm
I have written a code myself but it is not running it giving error can't find dependent libraries
Member 12056141 17-Oct-15 17:10pm
can u plzz tell me the soln of this problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100