This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes usb web camera and JMF  Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "usb web camera and JMF  Problem" Watch "usb web camera and JMF  Problem" New topic
Author

usb web camera and JMF Problem

hassan ali
Ranch Hand

Joined: Apr 23, 2006
Posts: 127
hi
i have tried many example to work with usb 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);
}
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: usb web camera and JMF Problem
 
jQuery in Action, 3rd edition