TorstenEdelmann
January 9, 2012, 08:01:22
Hi,
For my capture application (FireCapture) I'm trying to intialize TIS-cameras without dialog. I want to start the cam always in Y800 and with highest framerate/image size.
The following code seems to work for my DMK41 under XP using the older DCAM driver (v4.1.1.1) but some users report errors when they try this on Win7.
bool initCamWithoutDialog() {
Grabber::tVidCapDevListPtr pVidCapDevList = grabber->getAvailableVideoCaptureDevices();
if (!grabber->openDev( (*pVidCapDevList)[0])) {
return false;
}
std::string camName = grabber->getDev().getName();
size_t found;
found = camName.find("21");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (640x480)" )) {
return grabber->setFPS( 60.0 );
}
}
found = camName.find("31");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (1024x768)" )) {
return grabber->setFPS( 30.0 );
}
}
found = camName.find("41");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (1280x960)" )) {
return grabber->setFPS( 15.0 );
}
}
return false;
}
Is there something missing in the above code or what I'm doing wrong ?
Thanks for helping,
Torsten
For my capture application (FireCapture) I'm trying to intialize TIS-cameras without dialog. I want to start the cam always in Y800 and with highest framerate/image size.
The following code seems to work for my DMK41 under XP using the older DCAM driver (v4.1.1.1) but some users report errors when they try this on Win7.
bool initCamWithoutDialog() {
Grabber::tVidCapDevListPtr pVidCapDevList = grabber->getAvailableVideoCaptureDevices();
if (!grabber->openDev( (*pVidCapDevList)[0])) {
return false;
}
std::string camName = grabber->getDev().getName();
size_t found;
found = camName.find("21");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (640x480)" )) {
return grabber->setFPS( 60.0 );
}
}
found = camName.find("31");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (1024x768)" )) {
return grabber->setFPS( 30.0 );
}
}
found = camName.find("41");
if (found!=std::string::npos) {
if (grabber->setVideoFormat( "Y800 (1280x960)" )) {
return grabber->setFPS( 15.0 );
}
}
return false;
}
Is there something missing in the above code or what I'm doing wrong ?
Thanks for helping,
Torsten