Cooker
October 6th, 2005, 04:18 AM
Hi,
I would like to capture live video, preview live video and grab live video.
But I find that the input pin of SampleGrab can't connect to the output Preview pin of Smart Tee.
Could someone tell me how to coonect between Smart Tee's Preview Pin and SampleGrab's input Pin ?
Thank you! :confused:
pFilterGraph->AddFilter(pSourceFilter,L"Source Filter");
pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,NULL,NULL);
pCaptureGraphBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi,L"Example.avi",&pMux,NULL);
pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,pSourceFilter,NULL,pMux);
// Setting of grabbing image
IBaseFilter *pSG_Filter;
IBaseFilter *pNull;
CoCreateInstance(CLSID_SampleGrabber,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pSG_Filter);
pFilterGraph->AddFilter(pSG_Filter, L"SampleGrab");
CoCreateInstance(CLSID_NullRenderer,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pNull);
pFilterGraph->AddFilter(pNull, L"NullRender");
// I get the FAILED
pCaptureGraphBuilder->RenderStream
(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,pSG_Filter,pNull);
SaveGraphFile(pFilterGraph, L"C:\\MyGraph.grf");
I would like to capture live video, preview live video and grab live video.
But I find that the input pin of SampleGrab can't connect to the output Preview pin of Smart Tee.
Could someone tell me how to coonect between Smart Tee's Preview Pin and SampleGrab's input Pin ?
Thank you! :confused:
pFilterGraph->AddFilter(pSourceFilter,L"Source Filter");
pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,NULL,NULL);
pCaptureGraphBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi,L"Example.avi",&pMux,NULL);
pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,pSourceFilter,NULL,pMux);
// Setting of grabbing image
IBaseFilter *pSG_Filter;
IBaseFilter *pNull;
CoCreateInstance(CLSID_SampleGrabber,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pSG_Filter);
pFilterGraph->AddFilter(pSG_Filter, L"SampleGrab");
CoCreateInstance(CLSID_NullRenderer,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pNull);
pFilterGraph->AddFilter(pNull, L"NullRender");
// I get the FAILED
pCaptureGraphBuilder->RenderStream
(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,pSG_Filter,pNull);
SaveGraphFile(pFilterGraph, L"C:\\MyGraph.grf");