Yunce
October 18, 2005, 09:03:42
hi,
I have a little problem here. May be you can tell me about some of the better solutions for my problem.
IC Imaging Control Class Library User's guide show me, how the programmers use setSinkMode Method.
so...
//-----------------------------------------------------------------------
// Create an AviSink object with the specified codec in pause mode.
AviSink AviSinkInst( filename, pCompressorList->at( choice ), GrabberSinkType::ePAUSE );
// Set AviSinkInst as the current sink.
grabber->setSinkType( AviSinkInst );
// Start the live mode. The live video will be displayed but no images will be written
// to the AVI file because AviSinkInst is in pause mode.
grabber->startLive( true );
fflush(stdin);
printf("Press [enter] to start capturing!");
getchar();
// Start the AviSink. The image stream is written to the AVI file.
grabber->getSinkType().setSinkMode(GrabberSinkType::eRUN );
printf("Video recording started\n.");
printf("Press [enter] to stop capturing!");
getchar();
// Pause the AviSink. This stops writing the image stram to the AVI file.
// A subsequent call to setSinkMode with GrabberSinkType::eRUN as the
// parameter would restart AVI recording.
grabber->getSinkType().setSinkMode(GrabberSinkType::ePAUSE );
// Stop the livemode. This stops writing images to the AVI file if the mode is not
// GrabberSinkType::ePAUSE. The AVI file is closed.
grabber->stopLive();
//-----------------------------------------------------------------------
The problem is, I want start my program in standby mode (grabber->startlive) before capturing image and stop it after x minutes.
but its looked impossible. I must Set AviSink first and then start the live mode (startlive). After that the function stoplive must be called. If this function is not called, The image stream will not written to avi file.
any solutions?
best regards,
Yunce
I have a little problem here. May be you can tell me about some of the better solutions for my problem.
IC Imaging Control Class Library User's guide show me, how the programmers use setSinkMode Method.
so...
//-----------------------------------------------------------------------
// Create an AviSink object with the specified codec in pause mode.
AviSink AviSinkInst( filename, pCompressorList->at( choice ), GrabberSinkType::ePAUSE );
// Set AviSinkInst as the current sink.
grabber->setSinkType( AviSinkInst );
// Start the live mode. The live video will be displayed but no images will be written
// to the AVI file because AviSinkInst is in pause mode.
grabber->startLive( true );
fflush(stdin);
printf("Press [enter] to start capturing!");
getchar();
// Start the AviSink. The image stream is written to the AVI file.
grabber->getSinkType().setSinkMode(GrabberSinkType::eRUN );
printf("Video recording started\n.");
printf("Press [enter] to stop capturing!");
getchar();
// Pause the AviSink. This stops writing the image stram to the AVI file.
// A subsequent call to setSinkMode with GrabberSinkType::eRUN as the
// parameter would restart AVI recording.
grabber->getSinkType().setSinkMode(GrabberSinkType::ePAUSE );
// Stop the livemode. This stops writing images to the AVI file if the mode is not
// GrabberSinkType::ePAUSE. The AVI file is closed.
grabber->stopLive();
//-----------------------------------------------------------------------
The problem is, I want start my program in standby mode (grabber->startlive) before capturing image and stop it after x minutes.
but its looked impossible. I must Set AviSink first and then start the live mode (startlive). After that the function stoplive must be called. If this function is not called, The image stream will not written to avi file.
any solutions?
best regards,
Yunce