Click here to Skip to main content
13,046,087 members (62,642 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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... :)
Posted 18-Jan-11 1:55am
Updated 27-Apr-17 4:57am
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
Member 13156632 27-Apr-17 10:59am
Why I have been encountered with this error????

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
NotPolitcallyCorrect 27-Apr-17 12:59pm
Because you have something wrong with your code.

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
Web02 | 2.8.170713.1 | Last Updated 27 Apr 2017
Copyright © CodeProject, 1999-2017
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