grab a picture from webcam JFM

Discussion in 'Java' started by james via JavaKB.com, Jun 13, 2005.

  1. Hi ,

    I was trying the code at
    http://www.uk-dave.com/bytes/java/jmf-framegrab.shtml. At the beginning i had
    an error at the line 24 with the device error. I figured out this error.

    But now i have an exception in the thread
    Just in the next line 25
    >Exit code: 0
    >java FrameGrab

    Exception in thread "main" java.lang.NullPointerException
    at FrameGrab.main(FrameGrab.java:25)
    >Exit code: 1


    // Create capture device
    CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice("vfw:
    Microsoft WDM Image Capture (WIN32):0");
    Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());
    player.start();

    Im using Windows 2000 Pro and JDK 1.5.0-02


    Can you tell me why i got this error ?

    Thanks and regards,

    Jeremy
    --
    Hi ,%0d%0a %0d%0aI was trying the same codecode. At the beginning i had an
    error at the line 24 with the device error. I figured out this error. %0d%
    0aBu now i have an exception in the thread %0d%0aJust in the next line 25 %0d%
    0a>Exit code: 0%0d%0a>java FrameGrab%0d%0aException in thread "main" java.
    lang.NullPointerException%0d%0a at FrameGrab.main(FrameGrab.java:25)%0d%
    0a>Exit code: 1%0d%0a %0d%0a// Create capture device%0d%0a CaptureDeviceInfo
    deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture
    (WIN32):0")


    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200506/1
    james via JavaKB.com, Jun 13, 2005
    #1
    1. Advertising

  2. james via JavaKB.com wrote:
    > Hi ,
    >
    > I was trying the code at
    > http://www.uk-dave.com/bytes/java/jmf-framegrab.shtml. At the beginning i had
    > an error at the line 24 with the device error. I figured out this error.
    >
    > But now i have an exception in the thread
    > Just in the next line 25
    >
    >>Exit code: 0
    >>java FrameGrab

    >
    > Exception in thread "main" java.lang.NullPointerException
    > at FrameGrab.main(FrameGrab.java:25)
    >
    >>Exit code: 1

    >
    >
    > // Create capture device
    > CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice("vfw:
    > Microsoft WDM Image Capture (WIN32):0");
    > Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());
    > player.start();
    >
    > Im using Windows 2000 Pro and JDK 1.5.0-02
    >
    >
    > Can you tell me why i got this error ?
    >
    > Thanks and regards,
    >
    > Jeremy


    I compiled and ran it fine here. A couple of possibilities, you
    accidently changed some of the code or your JMF isn't installed correctly.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Jun 13, 2005
    #2
    1. Advertising

  3. Knute Johnson wrote:
    >> Hi ,
    >>

    >[quoted text clipped - 28 lines]
    >>
    >> Jeremy

    >
    >I compiled and ran it fine here. A couple of possibilities, you
    >accidently changed some of the code or your JMF isn't installed correctly.
    >


    Everything seems Ok.
    Maybe the webcam ? , i'm using a brand not very known Genius of KYE ...

    What's your webcam ?
    Have you done any modification in your JMF ?

    --
    Hi ,%0d%0a %0d%0aI was trying the same codecode. At the beginning i had an
    error at the line 24 with the device error. I figured out this error. %0d%
    0aBu now i have an exception in the thread %0d%0aJust in the next line 25 %0d%
    0a>Exit code: 0%0d%0a>java FrameGrab%0d%0aException in thread "main" java.
    lang.NullPointerException%0d%0a at FrameGrab.main(FrameGrab.java:25)%0d%
    0a>Exit code: 1%0d%0a %0d%0a// Create capture device%0d%0a CaptureDeviceInfo
    deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture
    (WIN32):0")


    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200506/1
    james via JavaKB.com, Jun 14, 2005
    #3
  4. i ve changed nothing but now it's working
    thanks anyway

    james


    james wrote:
    >>> Hi ,
    >>>

    >[quoted text clipped - 4 lines]
    >>I compiled and ran it fine here. A couple of possibilities, you
    >>accidently changed some of the code or your JMF isn't installed correctly.

    >
    >Everything seems Ok.
    >Maybe the webcam ? , i'm using a brand not very known Genius of KYE ...
    >
    >What's your webcam ?
    >Have you done any modification in your JMF ?
    >


    --
    Hi ,%0d%0a %0d%0aI was trying the same codecode. At the beginning i had an
    error at the line 24 with the device error. I figured out this error. %0d%
    0aBu now i have an exception in the thread %0d%0aJust in the next line 25 %0d%
    0a>Exit code: 0%0d%0a>java FrameGrab%0d%0aException in thread "main" java.
    lang.NullPointerException%0d%0a at FrameGrab.main(FrameGrab.java:25)%0d%
    0a>Exit code: 1%0d%0a %0d%0a// Create capture device%0d%0a CaptureDeviceInfo
    deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture
    (WIN32):0")


    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200506/1
    james via JavaKB.com, Jun 14, 2005
    #4
  5. Hi Folks ,


    Do you know how can i change the size of the picture taken ?

    For the moment it's in 320 240 but i would like in bigger 640 480
    Someone to figure out this pb ?

    Thanks

    james wrote:
    >i ve changed nothing but now it's working
    >thanks anyway
    >
    >james
    >
    >>>> Hi ,
    >>>>

    >[quoted text clipped - 7 lines]
    >>What's your webcam ?
    >>Have you done any modification in your JMF ?

    >


    --
    Hi ,%0d%0a %0d%0aI was trying the same codecode. At the beginning i had an
    error at the line 24 with the device error. I figured out this error. %0d%
    0aBu now i have an exception in the thread %0d%0aJust in the next line 25 %0d%
    0a>Exit code: 0%0d%0a>java FrameGrab%0d%0aException in thread "main" java.
    lang.NullPointerException%0d%0a at FrameGrab.main(FrameGrab.java:25)%0d%
    0a>Exit code: 1%0d%0a %0d%0a// Create capture device%0d%0a CaptureDeviceInfo
    deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture
    (WIN32):0")


    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200506/1
    james via JavaKB.com, Jun 14, 2005
    #5
  6. james via JavaKB.com wrote:
    > Hi Folks ,
    >
    >
    > Do you know how can i change the size of the picture taken ?
    >
    > For the moment it's in 320 240 but i would like in bigger 640 480
    > Someone to figure out this pb ?
    >
    > Thanks


    Depends on your camera. You could also open the FormatControl for the
    player.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Jun 15, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    466
  2. hihihi

    Bad webcam picture

    hihihi, Apr 18, 2005, in forum: C++
    Replies:
    1
    Views:
    439
    Thomas Matthews
    Apr 18, 2005
  3. sunra

    reloading a webcam picture

    sunra, Jul 25, 2008, in forum: HTML
    Replies:
    3
    Views:
    419
    sunra
    Jul 25, 2008
  4. PB
    Replies:
    4
    Views:
    116
  5. Replies:
    8
    Views:
    1,219
    Mick White
    Apr 19, 2005
Loading...

Share This Page