JMF error: No such capture device!

  • Thread starter Raphael Bauduin
  • Start date
R

Raphael Bauduin

Hi,

I'm discovering JMF, and base my exploration on the example located at
http://www.uk-dave.com/bytes/java/jmf-framegrab.shtml

My webcam is recognised and usable with jmstudio.
However, I can't use it in my code and get "No such capture device!"...
Excerpts:

Vector deviceList = CaptureDeviceManager.getDeviceList(null);
while (!deviceList.isEmpty())
{
device = (CaptureDeviceInfo) deviceList.remove(0);
}
System.out.println("Working with : " +device.getName() + " -- " +
device.getLocator() );

CaptureDeviceInfo deviceInfo = device;
Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());

(last line is line 39)
and I get this output:

v4l:philips 740 webcam:0
v4l://0
Working with : v4l:philips 740 webcam:0 -- v4l://0
java.io.IOException: java.lang.Error: No such capture device!
java.io.IOException: java.lang.Error: No such capture device!
Exception in thread "main" javax.media.NoPlayerException: Error
instantiating class: com.sun.media.protocol.v4l.DataSource :
java.io.IOException: java.lang.Error: No such capture device!
at javax.media.Manager.createPlayerForContent(Manager.java:1362)
at javax.media.Manager.createPlayer(Manager.java:417)
at javax.media.Manager.createRealizedPlayer(Manager.java:553)
at FrameGrab.main(FrameGrab.java:39)

What am I doing wrong? Starting jmstudio with the same environment lets me
capture from the webcam....

Thanks.

Raph
 
K

Knute Johnson

Raphael said:
Seems this is not so uncommon as problem:
http://forum.java.sun.com/thread.jsp?forum=28&thread=333682&start=0&range=15&hilite=false&q=

No definitive answer though (setting the env variables
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
$JMFHOME/lib:/usr/local/java/jre/lib/i386/:/usr/local/java/jre/lib/i386/client/
export LD_PRELOAD=$LD_PRELOAD:/usr/local/java/jre/lib/i386/libjawt.so
doesn't help in my case)

anyone has better experiences?

Raph



Raphael Bauduin wrote:

Raph:

You've got something messed up in your device/deviceInfo variables
probably. Post the complete code and I can tell you for sure.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top