Results 1 to 1 of 1
Thread: JMF: capturing built in webcam
- 02-20-2010, 10:58 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 1
- Rep Power
- 0
JMF: capturing built in webcam
hi,
i'm using jmf to capture a webcam.
It works good when I use an extern (USB) webcam,
but when I use the webcam from my laptop it gives this error:
(it's an runtime error)
java.io.IOException: Could not connect to capture device
20-feb-2010 11:15:23 webcam.Main play
SEVERE: null
javax.media.NoDataSourceException: Error instantiating class: com.sun.media.protocol.vfw.DataSource : java.io.IOException: Could not connect to capture device
at javax.media.Manager.createDataSource(Manager.java: 1012)
this is the operation that creates the error:
private Vector<DataSource> getDataSources() throws IOException, NoDataSourceException {
Vector<DataSource> dataSources = new Vector<DataSource>();
//alle checkboxen overlopen en kijken welk apparaat ingeschakeld moet worden
for(int i=0; i<checkBoxDeviceList.size(); i++) {
if(checkBoxDeviceList.elementAt(i).isSelected()) {
//sourcemedialocator van het apparaat bepalen
String deviceName = checkBoxDeviceList.get(i).getText();
MediaLocator sourceMediaLocator = null;
Vector deviceList = getDeviceList();
int index=0;
while(index<deviceList.size() &&
!((CaptureDeviceInfo)deviceList.elementAt(index)). getName().equals(deviceName)) {
index++;
}
if(index<deviceList.size()) {
sourceMediaLocator = ((CaptureDeviceInfo)deviceList.elementAt(index)).g etLocator();
}
DataSource dataSource = Manager.createDataSource(sourceMediaLocator);
//dataSource = Manager.createCloneableDataSource(dataSource);
dataSources.add(dataSource);
}
}
return dataSources;
}
Similar Threads
-
capture webcam images with java
By MuslimCoder in forum Advanced JavaReplies: 3Last Post: 12-21-2009, 03:21 PM -
webcam application startup
By Bharat in forum New To JavaReplies: 7Last Post: 01-19-2009, 05:24 AM -
Remote Triggering of Webcam
By Jakester in forum Java AppletsReplies: 3Last Post: 10-15-2008, 07:06 PM -
initialising a webcam?
By jonsamwell in forum New To JavaReplies: 1Last Post: 08-25-2008, 05:17 PM -
J2ME Webcam 0.1
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-31-2007, 05:25 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks