aspose file tools*
The moose likes Beginning Java and the fly likes WebCam Through Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "WebCam Through Java" Watch "WebCam Through Java" New topic
Author

WebCam Through Java

suraj kurumkar
Greenhorn

Joined: Feb 20, 2007
Posts: 5
How we can access webcam through java..???
naga raaju
Greenhorn

Joined: Mar 14, 2008
Posts: 29
hi suraj,

in java we have one good frmaework ie JavaMediaFrameWork(JMF).
so first you download that software and set path .

and run this program


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);
}
}
}


ans my advice is study the JMF API. so you can understand the concepts.

ok na
have a nice day.

bye
naga
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebCam Through Java