PDA

View Full Version : GrabberSinkType error



somoon
June 7, 2011, 09:45:42
use IC Imaging Control 3.1 on Visual studio 2008.

I would like to save a AVI with IC Dialog Application . :-)

I Can save AVI file from Sink Type in the samples, but can not save AVI file from IC Dialog Application. :confused:

Program can show live video. When click bottom recode video. program error and creat AVI file
in project. :confused:

error :
http://image.free.in.th/show.php?id=f893b0b13c67f544b700f3c3e84904d8

AVI file:

http://image.free.in.th/show.php?id=ccd4ebac74a5f96ce273aa2b1523caa3



.....
DShowLib::tMediaStreamSinkPtr m_cAVISink;

// Set the filename.
m_cAVISink->setFilename( "RecodeDevice1.avi" );
// The sink is initially paused, so that no video data is written to the file.
m_cAVISink->setSinkMode( GrabberSinkType::ePAUSE );
// Set pSink as the current sink.
m_cGrabber.setSinkType( m_cAVISink );
......
void CCamera_Snap_ImageDlg::OnBnClickedButtonrecode()
{
if(m_cGrabber.isDevValid() && m_cGrabber.isLive())
{
m_cAVISink->setSinkMode(GrabberSinkType::eRUN );
}

}



Thanks very much :-)
PS: sorry for my poor experience

Stefan Geissler
June 7, 2011, 13:02:12
Hello,

"tMediaStreamSinkPtr" defines a pointer. You used "m_cAVISink" without initialization. Therefore you receive the nice access violation

With "MediaStreamSink::create()" you create this sink. Please see the samples at:
http://www.imagingcontrol.com/en_US/support/documentation/class/meth_descMediaStreamSink_create.htm

Also you must select a codec for compression and the AVIContainer, as shown on this website.

somoon
June 7, 2011, 17:03:32
.....
DShowLib::tMediaStreamSinkPtr m_cAVISink;

tMediaStreamSinkPtr m_cAVISink = MediaStreamSink::create(
MediaStreamContainer::create( MSC_AviContainer ), MEDIASUBTYPE_Y800);

// tMediaStreamSinkPtr m_cAVISink = MediaStreamSink::create(
// MediaStreamContainer::create( MSC_AviContainer ), MEDIASUBTYPE_RGB32);

// Set the filename.
m_cAVISink->setFilename( "RecodeDevice1.avi" );
// The sink is initially paused, so that no video data is written to the file.
m_cAVISink->setSinkMode( GrabberSinkType::ePAUSE );
// Set pSink as the current sink.
m_cGrabber.setSinkType( m_cAVISink );
......
void CCamera_Snap_ImageDlg::OnBnClickedButtonrecode()
{
if(m_cGrabber.isDevValid() && m_cGrabber.isLive())
{
m_cAVISink->setSinkMode(GrabberSinkType::eRUN );
}

}


sorry for wrong code. ;-)
this code does not work well. :confused:

error :



CDShowFilter::getInputPin_( unsigned int i ) const : pin #"0" not found.

Could not find upstream IAMStreamControl interface. Pausing the sink may not be possible for this device.

Thank you very much. :-)