Solved

CaptureDeviceManager.getDeviceList not returning any value

Posted on 2013-01-16
50
1,214 Views
Last Modified: 2013-01-22
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
Comment
Question by:MILIND_JOG
  • 27
  • 23
50 Comments
 

Author Comment

by:MILIND_JOG
ID: 38786031
Please give your expert sugestion.

Regards
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38786595
0
 

Author Comment

by:MILIND_JOG
ID: 38787351
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38787408
Sorry, not on the setup issue, no - I don't use Netbeans.
0
 

Author Comment

by:MILIND_JOG
ID: 38787419
Ok. No problem. Forget about NetBeans. Otherwise.

Regards
0
 

Author Comment

by:MILIND_JOG
ID: 38787423
I am observing that CaptureDeviceManager.getDeviceList(null); not returning any device.

Regards
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38787580
You can post some code, perhaps? (If so, please use the code tags here). Thanks.
0
 

Author Comment

by:MILIND_JOG
ID: 38787635
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38787708
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
 

Author Comment

by:MILIND_JOG
ID: 38788012
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38788033
But *do you* get as far as being offered a 'capture'?
0
 

Author Comment

by:MILIND_JOG
ID: 38788046
No I struck at the line CaptureDeviceManager.getDeviceList(null); . Unable to move further
0
 

Author Comment

by:MILIND_JOG
ID: 38788051
The line not detecting any device
0
 

Author Comment

by:MILIND_JOG
ID: 38788080
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38788094
Your code works - for me - up until trying to do the capture. The NPE is on this line :

Buffer buf = fgc.grabFrame();
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38788118
You should find it all explained and available here :

http://www.oracle.com/technetwork/java/javase/download-142937.html
0
 

Author Comment

by:MILIND_JOG
ID: 38788140
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38788270
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
 

Author Comment

by:MILIND_JOG
ID: 38790515
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38792209
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
 

Author Comment

by:MILIND_JOG
ID: 38795773
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38796172
Which version JMF are you running?
0
 

Author Comment

by:MILIND_JOG
ID: 38796173
JMF2.1.1e

Regards
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38796179
You need to look in JMF registry to see which video capture devices are available.
0
 

Author Comment

by:MILIND_JOG
ID: 38796186
Ok. I will check and confirm.

Regards
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:MILIND_JOG
ID: 38796220
Dear krakatoa,
It is YUV Video Format

Regards
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38796332
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38796360
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
 

Author Comment

by:MILIND_JOG
ID: 38798150
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38798343
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
 

Author Comment

by:MILIND_JOG
ID: 38798373
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38798408
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
 

Author Comment

by:MILIND_JOG
ID: 38798545
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
 

Author Comment

by:MILIND_JOG
ID: 38798563
0
 

Author Comment

by:MILIND_JOG
ID: 38798774
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38798780
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
 

Author Comment

by:MILIND_JOG
ID: 38798834
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38799067
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
 

Author Comment

by:MILIND_JOG
ID: 38800806
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
 
LVL 16

Accepted Solution

by:
krakatoa earned 500 total points
ID: 38801058
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
 

Author Comment

by:MILIND_JOG
ID: 38801175
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
 

Author Closing Comment

by:MILIND_JOG
ID: 38801218
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38801220
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38801222
ok. thankx.
0
 

Author Comment

by:MILIND_JOG
ID: 38804012
Dear krakatoa,
I have raised fresh question for the same. Please help.

Regards
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38804433
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
 

Author Comment

by:MILIND_JOG
ID: 38804438
Ok Krakatoa. Thanks for response. I will see some other option.

Regards

Milind
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 38804504
0
 

Author Comment

by:MILIND_JOG
ID: 38804509
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
 
LVL 16

Expert Comment

by:krakatoa
ID: 38804516
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Issues installing SSL certificate into Apache Tomcat 3 70
factorial example challenge 10 61
IT Company 5 69
parentbit challenge 3 52
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now