grab a picture from webcam JFM

  • Thread starter james via JavaKB.com
  • Start date
J

james via JavaKB.com

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
 
K

Knute Johnson

james said:
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


Exception in thread "main" java.lang.NullPointerException
at FrameGrab.main(FrameGrab.java:25)



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

james via JavaKB.com

Knute said:
[quoted text clipped - 28 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
 
J

james via JavaKB.com

i ve changed nothing but now it's working
thanks anyway

james

[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
 
J

james via JavaKB.com

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
i ve changed nothing but now it's working
thanks anyway

james
[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
 
K

Knute Johnson

james said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top