Hello Everyone,
I’m back with something new, while exploring Java and this time the API is : Java Media Framework (JMF).
Well this time I’m going to share how you can create Video Capturing Application Or you can say a Webcam in Java using JMF API.
Here’s a cap :
No more words and without wasting more time. Lets get to the main point.
Here’s the code : Click Here
Comments on all main lines of code are provided in file.
More to come soon!..

hii
i see ur code but i want some modification in that code
i want video capturing and save to a file for every 10 seconds but in hidden
Yes you can do it by using sleep(10000);
Use a loop until the capturing is going and use delay of 10sec [ sleep(10000) ] and put the saved file to where JAVA is Installed. [ ../bin ] + use the save method in that fx()……
we r also makng this project but facing many problems
can u pls help us nd share some ideas regardng this topic
hw we can do chat in real time…
plsssss help us
its our minor project othr wise our hod is gong to kill us
Hey Ankita,
Sorry for late reply,
We’ll discuss it on Facebook as i have accepted your friend req. already.
Regards
Hi,
I installed JMF. Where I can get the javax.media.* library?
Hey friend i run this code.. but it gives
java.lang.NullPointerException
at newpackage.MyCam.(MyCam.java:42)
at newpackage.MyCam.main(MyCam.java:75)
error..
i dont know y, i properly connected my cam also
Hey guys i managed to fix it… u’ll have to configure jmf studio to list the capture devices…
great work guys……………
I am also a computer science student but pursuing my diploma from Center for Computers and Communication Technology, Chisopani, South Sikkim. I was really happy to see the code. I don’t know whether it may run or not, but I am heartily thankful to Puneet for his contribution to my knowledge.
hello sir i have taken a project to capture a video through webcam i read your code .when i run this code i m facing
java.lang.NullPointerException
at mycam.MyCam.(MyCam.java:42)
at mycam.MyCam.main(MyCam.java:75)
this error.
i am working on window vista.please give me guide because i have to submit this project in one week please sir help me.
mohit singhal
Hi Puneet,
Thanks for your post, but i am also getting the error java.lang.NullPointerException
at MyCam.(MyCam.java:40)
at MyCam.main(MyCam.java:73)
Can you help me about that plzz?
The problem u might be facing is because jmf works fine with a 32 bit jdk.. so be sure u are using a 32 bit java..
I also tried running the prog with a 64 bit java and found the same error…
I studied the code and found that the statement at line 30 does not get executed.. that means that there is problem with the capture device manager class.. I dont have the solution … if any one gets it pls reply..