PDA

View Full Version : Slow restart on frame rate change



kdelong
April 13, 2006, 08:00:28
I've got the video-to-1394 framegrabber, accessing it through the Imaging Control C++ class library, 2.1Dio3.

When my framegrabber is running, happily delivering frames, I find that when I switch frame rates
grabber->stopLive();
grabber->setFrameRate(f);
grabber->startLive();

the startLive() command takes 5-6 seconds. This occurs even when the frame rates are close to each other (100ms/frame and 90 ms/frame).

When I first start the framegrabber, it sets the video source, input channel, video norm, capture device, etc. When I finally issue the startLive() command it takes barely a second to start delivering frames.

Why does it take so long when I'm changing frame rates? Is there something I can do to speed it up?

Ken

kdelong
April 17, 2006, 07:15:14
I've also found that if I create a new FG, initialize the whole sequence (video source etc) it starts up in less than a second.

Why are only previously initialized FG's slow in restarting?

kdelong
April 17, 2006, 07:23:12
PS More information: My setup is like this (I've removed some of the error handling to make it more readable):

DShowLib::tColorformatEnum eSinkColorformat = DShowLib::eY8;

m_pGrabber->setSinkType( DShowLib::FrameGrabberSink(
DShowLib::FrameGrabberSink::tFrameGrabberMode::eGR AB,
eSinkColorformat ) );

// Set a MemBufferCollection
pMemBuffColl = m_pGrabber->newMemBufferCollection( m_numBuffers );

m_pGrabber->setActiveMemBufferCollection( pMemBuffColl );

m_pCListener = new CListener();
m_pGrabber->addListener( m_pCListener, DShowLib::GrabberListener::eFRAMEREADY);

zkhan
November 15, 2011, 20:47:02
I've got the video-to-1394 framegrabber, accessing it through the Imaging Control C++ class library, 2.1Dio3.

When my framegrabber is running, happily delivering frames, I find that when I switch frame rates
grabber->stopLive();
grabber->setFrameRate(f);
grabber->startLive();

the startLive() command takes 5-6 seconds. This occurs even when the frame rates are close to each other (100ms/frame and 90 ms/frame).

When I first start the framegrabber, it sets the video source, input channel, video norm, capture device, etc. When I finally issue the startLive() command it takes barely a second to start delivering frames.

Why does it take so long when I'm changing frame rates? Is there something I can do to speed it up?

Ken

I'm also interested in the answer to this question - any ideas?

Stefan Geissler
November 16, 2011, 09:21:20
First of all, I wonder, why there was no answer from me 5 years ago on this question.

Stopping and starting the live video will cause the complete destroying and rebuild of the filtergraph. The rebuild can take time, because DirectShow needs to find color space transform filters and negotiate the video format to the output format. Especially on older computers this may take longer, because loading of DLLs and instantiating of objects takes its time.

On current computers, this lasts not as long. But 5 seconds is too long and may points to a problem with the used computer.