Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

JMF error: No such capture device!

Thread view: 
Raphael Bauduin - 06 Mar 2004 11:06 GMT
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
Raphael Bauduin - 06 Mar 2004 18:31 GMT
Seems this is not so uncommon as problem:
http://forum.java.sun.com/thread.jsp?forum=28&thread=333682&start=0&range=15&hil
ite=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

> Hi,
>
[quoted text clipped - 39 lines]
>
> Raph
Knute Johnson - 07 Mar 2004 22:38 GMT
> Seems this is not so uncommon as problem:
> http://forum.java.sun.com/thread.jsp?forum=28&thread=333682&start=0&range=15&hil
ite=false&q
=
[quoted text clipped - 52 lines]
>>
>>Raph

Raph:

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

Signature

Knute Johnson
email s/nospam/knute/
Molon labe...

Raphael Bauduin - 08 Mar 2004 16:25 GMT
>> Seems this is not so uncommon as problem:

http://forum.java.sun.com/thread.jsp?forum=28&thread=333682&start=0&range=15&hil
ite=false&q
=

[snip]

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

Hi,

you'll find the complete code in attachement.

To run it, I either launch it from the command line:
 java FrameGrab
or I edit the script jmstudio in $JMF_HOME/bin and change this line
 exec java JMStudio $*
in this
 exec java FrameGrab $*

This last solution generates this error (check attachment jmout.txt for
complete output):

An error has occurred.  Check jmf.log for details.
Exception in thread "main" javax.media.NoPlayerException: Error
instantiating class: com.sun.media.protocol.v4l.DataSource :
java.io.IOException: java.lang.Error: Couldn't initialize 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:44)

and jmf.log is this:

#
# JMF Version 2.1.1e
#

## Platform: Linux, i386, 2.4.20-cdrw
## Java VM: Sun Microsystems Inc., 1.4.2

XX java.io.IOException: java.lang.Error: Couldn't initialize capture device
XX java.io.IOException: java.lang.Error: Couldn't initialize capture device

I set these environment variables:
export JMF_HOME=/usr/local/JMF-2.1.1e/
export CLASSPATH=$CLASSPATH:$JMF_HOME/lib/jmf.jar:$JMFHOME/lib/sound.jar
$JMFHOME/lib/.
export LD_LIBRARY_PATH=$JMFHOME/lib:${LD_LIBRARY_PATH}

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

System is Debian GNU/Linux unstable. java is 1.4.2 build 1.4.2-b28
If you need more info, just tell me.

Thanks!

Raph
Knute Johnson - 08 Mar 2004 19:25 GMT
>>>Seems this is not so uncommon as problem:
>
[quoted text clipped - 237 lines]
>     at javax.media.Manager.createRealizedPlayer(Manager.java:553)
>     at FrameGrab.main(FrameGrab.java:44)

Raph:

It works here with my Creative web cam.  It could be numerous things
with the way this code is written.  Here are some things to try.  Use
vfw://0 as the device locator, create your player with
Manager.createPlayer() and use a ControllerListener to check for
realized, try to display the video rather than grabbing a frame.

I'll email you a copy of a program to try too.  Let me know if it works.

Signature

Knute Johnson
email s/nospam/knute/
Molon labe...

james - 13 Jun 2005 14:58 GMT
>Seems this is not so uncommon as problem:
>http://forum.java.sun.com/thread.jsp?forum=28&thread=333682&start=0&range=15&hil
ite=false&q
=
[quoted text clipped - 14 lines]
>>
>> Raph
Signature

Hi ,

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.