-
USB WEBCAM prolem with JMF
hi
i have tried many example to work with web camera but exception said that no device connected
while camera fine and work under windwos
this is th code thank you for help
import javax.media.Player;
import javax.media.CaptureDeviceInfo;
import javax.media.MediaLocator;
import javax.media.CaptureDeviceManager;
import javax.media.Manager;
import javax.media.format.*;
import java.util.Vector;
import java.awt.*;
public class TestJMF4 {
CaptureDeviceInfo device;
MediaLocator ml;
Player player;
Component videoScreen;
public static void main(String args[]){
new TestJMF4();
}
TestJMF4(){
try
{ //gets a list of devices how support the given videoformat
Vector deviceList = CaptureDeviceManager.getDeviceList(new YUVFormat());
device = (CaptureDeviceInfo) deviceList.firstElement();
ml = device.getLocator();
player = Manager.createRealizedPlayer(ml);
player.start();
videoScreen = player.getVisualComponent();
Frame frm=new Frame();
frm.setBounds(10,10,300,300);
frm.add(videoScreen);
frm.setVisible(true);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Similar Threads
-
By bao2330 in forum Mobile
Replies: 0
Last Post: 04-25-2007, 09:49 PM
-
By vb_programmer in forum VB Classic
Replies: 1
Last Post: 01-08-2007, 07:11 AM
-
Replies: 1
Last Post: 07-23-2006, 01:21 PM
-
By orko3001 in forum Java
Replies: 3
Last Post: 08-28-2005, 11:35 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks