View Full Version : how Recording video from a standby mode

October 18, 2005, 09:03:42

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.

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

printf("Press [enter] to start capturing!");

// 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!");

// 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.


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,

Tim Cassens
October 18, 2005, 11:40:50

by standby mode, do you mean a mode where the user can just watch live video, and eventually select a file name for the AVI file?

If yes, this is the way to go:

// Set any FrameGrabberSink, settings do not matter when you do not want to use the images from it
grabber->setSinkType( FrameGrabberSink( ... ) )

// start live mode

// ...
// Live video is now displayed
// ...

// Now the user selected a file name and wants to record an AVI file

// stop live mode

// Set and use the avi sink as in the snipped you posted:
grabber->setSinkType( AviSink( filename, compressor, GrabberSinkType::ePAUSE ) );
// ...

// ... record until the user stops


// Set a FrameGrabberSink again
grabber->setSinkType( FrameGrabberSink( ... ) )

// Show live vido, back in standby mode

Best regards
Tim Cassens

October 18, 2005, 12:38:58
Hi tim,

thanks for your reply. anyway, I have tried this solution before you posted it. but its looked not so good (stop the grabber and then start it again, after setSinkType(...)).

The problem is, I want track eye movements with video. From this Eye movements (video), the programm will show some graphics (horizontal and vertical eye movements).
its mean, I shouldn't stopped the image capturing.

have you another solution? or imaging source can't do this without stopping capture image?

Best regards,

Johannes Vogel
October 19, 2005, 08:12:52

Do you want to have access to images buffers while streaming to an AVi file ?

October 19, 2005, 08:48:15

I have two tasks to do.
1. get access to images buffers while capturing images (to plot line graphs)
2. on clicking the record button, I can record streaming images to AVI files (plan for 2 cameras). but for to do that I dont want stopping the live mode, because I must plot several line graphs without broken lines.

well, do you have some of the better solutions for my problem?

October 19, 2005, 13:59:51
no solutions?

Johannes Vogel
October 19, 2005, 16:57:40

the upcoming version 3.0 of IC Imaging Control will provide access to image buffers while streaming to a video file.

October 20, 2005, 08:59:16
Hi Johannes,

when's that coming out? because I need that as soon as posible. If Imaging Control can do what I need, I plan to buy more runtime lincese.
Can you write me mail at yunce.gunawan@gmx.de, if that version is coming out.
Thank you.

Johannes Vogel
October 20, 2005, 16:10:28
the release is a matter of weeks rather than a matter of months.