"I Think, I Conceptualize, I Analyze, I Design, and I Create." ~ Puneet Kalra

Cognitive Robotics Research Centre Of University Of Wales, Newport Puneet Kalra

Home Studies Research Projects Tutorials Portfolio

Puneet Kalra - www.puneetk.com - Socializing Robots

Video Capturing In Java Using JMF

February 7th, 2010 by Puneet Kalra Leave a reply »

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 :
Cap Of Video Capturing Application Created In Java

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!..

Advertisement

15 Responses

  1. kishor says:

    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

  2. Jatish Khanna says:

    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()……

  3. Ankita bhutra says:

    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

  4. Puneet Kalra says:

    Hey Ankita,

    Sorry for late reply,
    We’ll discuss it on Facebook as i have accepted your friend req. already.

    Regards

  5. George Adams says:

    Hi,
    I installed JMF. Where I can get the javax.media.* library?

  6. imal hasaranga says:

    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

  7. imal hasaranga says:

    Hey guys i managed to fix it… u’ll have to configure jmf studio to list the capture devices…

  8. bhanu says:

    great work guys……………

  9. AddKluziv says:

    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.

  10. mohit singhal says:

    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

  11. Fatema Mohsen says:

    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?

    • madhav says:

      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..

Trackbacks/
Pingbacks

  1. hWinetst
  2. bvesnie
  3. vgteslle

Leave a Reply

Please note : I will help you only if you will show some efforts! Don't expect replies to simple queries, You can easily find answers for them through searching.

I'm a student and I work as well. So i might reply late here. If you have something important to discuss Or stuck somewhere in your project. Please post on my Facebook page for a quick response.