Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1426
  • Last Modified:

CaptureDeviceManager.getDeviceList not returning any value

Dear Expert,

I am new in javax media. I am trying to make an application to capture photograph from USB camera. The problem is CaptureDeviceManager.getDeviceList not returning any value.
Please help. I have already downloaded JMF2.1.1 and included jar file in my NetBeans system to compile. The compilation is successful.

Please help.

Regards
captcam.java
0
MILIND_JOG
Asked:
MILIND_JOG
  • 27
  • 23
1 Solution
 
MILIND_JOGAuthor Commented:
Please give your expert sugestion.

Regards
0
 
MILIND_JOGAuthor Commented:
Thanks for your comments. I think there is an setup issue. I am unable to fix. Setup from Download of correct version,NetBeans liabrary to CLASSPATH & PATH etc...

Can you please guide me.

Regards
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
krakatoaCommented:
Sorry, not on the setup issue, no - I don't use Netbeans.
0
 
MILIND_JOGAuthor Commented:
Ok. No problem. Forget about NetBeans. Otherwise.

Regards
0
 
MILIND_JOGAuthor Commented:
I am observing that CaptureDeviceManager.getDeviceList(null); not returning any device.

Regards
0
 
krakatoaCommented:
You can post some code, perhaps? (If so, please use the code tags here). Thanks.
0
 
MILIND_JOGAuthor Commented:
Dear Krakatoa,
Thanks for taking efforts to resolve my issue. I have already attached the code. If you want I can repost the same.

Regards
0
 
krakatoaCommented:
OK well I compiled and ran your class. I got a long list of devices in a window. I didn't make a selection, but dismissed the window, and was presented with a jframe or smthg asking me if I wanted to make a capture, and an OK button. I pressed that, got some shutter clicking sounds from my machine, then there was a NullPointerException, and things closed.

Does that help?

BUT - my camera is built-in - it's *not* attached via USB.
0
 
MILIND_JOGAuthor Commented:
I am also working in LAPTOP and camera is builtin. I do not understand what is the issue. I suspect the issue is with Setup

Regards
0
 
krakatoaCommented:
But *do you* get as far as being offered a 'capture'?
0
 
MILIND_JOGAuthor Commented:
No I struck at the line CaptureDeviceManager.getDeviceList(null); . Unable to move further
0
 
MILIND_JOGAuthor Commented:
The line not detecting any device
0
 
MILIND_JOGAuthor Commented:
Can you please advice me the currect version of JMF, the URL to download and the setup steps in local machine no matter NetBeans.

Regards
0
 
krakatoaCommented:
Your code works - for me - up until trying to do the capture. The NPE is on this line :

Buffer buf = fgc.grabFrame();
0
 
krakatoaCommented:
You should find it all explained and available here :

http://www.oracle.com/technetwork/java/javase/download-142937.html
0
 
MILIND_JOGAuthor Commented:
Ok. Let me see. I will come back to you. By the I am in India and it is already 10:30PM. What is your local time and what time generally you available. I am asking you for the reason that I am getting very very good support from you and I do not want to break the link

Regards
0
 
krakatoaCommented:
You won't break the link. I can't promise I can help however.

Try to get a list of the devices that your machine has. I thought I saw a list of audio capture devices returned by your code, not video capture devices, but I could be wrong.
0
 
MILIND_JOGAuthor Commented:
Good morning krakatoa,
I am extremely sorry. Before I read your message, I moved out of link. I hope you wouldn't mind.
Now I am able to see devices but all are Audio as you also observed. Till you are available, I am trying to resolve by different means but definately require your support as soon as possible.

Thanks & Regards.
0
 
krakatoaCommented:
1) :
Vector deviceList =CaptureDeviceManager.getDeviceList(new VideoFormat("yuv"));

Open in new window


2) : Start, Programs, JMedia Framework, JMF Registry, Capture Devices.

See what these tell you.
0
 
MILIND_JOGAuthor Commented:
Sir, I got the device now. I am now facing next problem as an exception on line

player = Manager.createRealizedPlayer(ml);

Exception in thread "VFW Request Thread" java.lang.UnsatisfiedLinkError: JMFSecurityManager: java.lang.UnsatisfiedLinkError: C:\Windows\System32\jmvfw.dll: Can't find dependent libraries
      at com.sun.media.JMFSecurityManager.loadLibrary(JMFSecurityManager.java:206)
      at com.sun.media.protocol.vfw.VFWCapture.<clinit>(VFWCapture.java:19)
      at com.sun.media.protocol.vfw.VFWSourceStream.doConnect(VFWSourceStream.java:241)
      at com.sun.media.protocol.vfw.VFWSourceStream.run(VFWSourceStream.java:763)
      at java.lang.Thread.run(Thread.java:662)


Regards
0
 
krakatoaCommented:
Which version JMF are you running?
0
 
MILIND_JOGAuthor Commented:
JMF2.1.1e

Regards
0
 
krakatoaCommented:
You need to look in JMF registry to see which video capture devices are available.
0
 
MILIND_JOGAuthor Commented:
Ok. I will check and confirm.

Regards
0
 
MILIND_JOGAuthor Commented:
Dear krakatoa,
It is YUV Video Format

Regards
0
 
krakatoaCommented:
I don't get that error when I run your code. For me the webcam runs fine and showing in your app. Are you sure you changed the line of your code to handle yuv?
0
 
krakatoaCommented:
I would say that a DLL is missing from your System file, as the error report says. Look for C:\Windows\System32\jmvfw.dll in your system somewhere.
0
 
MILIND_JOGAuthor Commented:
the jmvfw.dll is present in system32 still I am facing the same problem. In net it is sugested to install jre 32 bit and not 64 bit. I am not sure whether it will solve the problem or further escalate to other.

Regards
0
 
krakatoaCommented:
That was something I was going to suggest also. Best if you can try it on another machine - which in a sense you already have, since I have run it successfully.
0
 
MILIND_JOGAuthor Commented:
No Krakatoa. I do not have any other machine ufortunately. But I think it's time to take risk to go for that if no other option left.

Regards
0
 
krakatoaCommented:
I am not an OS person, but it would surprise me if there were no way to enforce 32-bit mode, if not per-app, then system-wide. It could be worth opening another Q here in the Operating System TA about that. In the meantime, I will do a bit more research myself.
0
 
MILIND_JOGAuthor Commented:
Ok, I will do that. Let me first install JRE 32 bit and try. Let's se what it results. Other wise we may revert back.

Regards
0
 
MILIND_JOGAuthor Commented:
0
 
MILIND_JOGAuthor Commented:
Dear krakatoa,

Good news to say that we have achieved to capture photo. I have uninstall JRE 64 bit and install 32 bit. I am really happy to say that without your help it could not happen. I am still keeping the issue open because there are still some issue to resolve.

Regards
0
 
krakatoaCommented:
MILIND_JOG, yes, I know those posts. I was not convinced 100%, (which means no more than I hesitated to mention them as it didn't look as if it would resolve your issue without compromise). But this seems the most likely reason at the moment, and relatively unsatisfactory in any case.

I just posted the above, and then saw your latest post. That's good. At the very least it shows that your code is good, which is the most important thing of course.
0
 
MILIND_JOGAuthor Commented:
Thanks Krakatoa. We will again discuss tomorrow. I hope you wouldn't mind.

It's 11:30PM India time. Good nitght. See you tomorrow.

Bye for now.

Thanks & Regards

Milind
0
 
krakatoaCommented:
As I said in a previous comment, there is a very high likelihood that 32 bit can be configured for 64 environment. The key may be in where the 32-bit libraries are then meant to reside.
0
 
MILIND_JOGAuthor Commented:
Dear Krakatoa,

I am trying to occomadate the media output in a small panel size. The image is not shrinking. I have tried a lot by putting efforts in the dark. Will you please help.

Regards
0
 
krakatoaCommented:
Your explanation of the problem is not as informative as it might be. You don't say where it is failing in any more than just a general way, and you don't supply any exception traces or error messages.

If you are talking about scaling an image, then do  you mean something like this ? :
 
* get the image: im =  new ImageIcon(this.getClass().getResource("/some_jpg_or_other.jpg"));

* make a JLabel (for example) to hold it : JLab = new JLabel(new ImageIcon(im.getImage().getScaledInstance(JFr_logo.getWidth(),JFr_logo.getHeight(),Image.SCALE_SMOOTH)));
0
 
MILIND_JOGAuthor Commented:
Dear krakatoa,
I would like to make more clearity. When ever I execute the java program, it displays the video stream on screen with designed optimum size. When I capture, the image gets saved in .jpg file.

The main issue is resolved to get stream and capture the image. I want to implement it in my main application form. The size designated to this image screen is too less and the issue is to fit the streaming image on that without compromizing on image view. I am unable to shring the streaming video size.

The original issue is resolved. If you advice, I can close this issue and open another as a fresh issue.

Regards
0
 
MILIND_JOGAuthor Commented:
Dear krakatoa,

Thanks for resolving my issue. I am closing this request and opening another. Please help.

Thanks a ton for helping.

Regards

Milind Jog
0
 
krakatoaCommented:
1.
it displays the video stream on screen with designed optimum size
<1> So the size of the streaming vid display is fine. Tick.

2.
When I capture, the image gets saved in .jpg file.
<2> And now you have your snapshot in a file. Tick.
 
3.
The size designated to this image screen is too less and the issue is to fit the streaming image on that without compromizing on image view.  I am unable to shring the streaming video size.
<3> This comment I do not understand, in light of your two comments above, where everything seemed to be satisfactory. Cross.
0
 
krakatoaCommented:
ok. thankx.
0
 
MILIND_JOGAuthor Commented:
Dear krakatoa,
I have raised fresh question for the same. Please help.

Regards
0
 
krakatoaCommented:
If I could I would - unfortunately I do not have any useful experience with video, and I imagine there is going to be a requirement for some manipulation of the image, which I am not versed in. Sorry about that.
0
 
MILIND_JOGAuthor Commented:
Ok Krakatoa. Thanks for response. I will see some other option.

Regards

Milind
0
 
MILIND_JOGAuthor Commented:
Yesss. I will go through this. It is a great help for me. I will come back to you once I go through these link.

Regards
0
 
krakatoaCommented:
This - although I think it is for an applet - seems to have code in it which is tackling the issue and how the container renders the image concerning size. Even if the code is not directly useful, it looks - at a glance - as if it has useful concepts about what you should be doing. ;)

Oops, nearly forgot the link :

http://jcs.mobile-utopia.com/jcs/64912_MediaPlayer.java
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 27
  • 23
Tackle projects and never again get stuck behind a technical roadblock.
Join Now