PDA

View Full Version : how Recording video from a standby mode



Yunce
October 18, 2005, 10: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

Tim Cassens
October 18, 2005, 12:40:50
Hello,

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
grabber->startLive()

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

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

// stop live mode
grabber->stopLive();

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

// ... record until the user stops

grabber->stopLive();

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

// Show live vido, back in standby mode
grabber->startLive();



Best regards
Tim Cassens

Gulinx
October 18, 2005, 13: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,
Yunce

Johannes Vogel
October 19, 2005, 09:12:52
Hello,

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

Gulinx
October 19, 2005, 09:48:15
Hi,

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?

Gulinx
October 19, 2005, 14:59:51
no solutions?

Johannes Vogel
October 19, 2005, 17:57:40
Hello,

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

Gulinx
October 20, 2005, 09: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, 17:10:28
Hello,
the release is a matter of weeks rather than a matter of months.