Source change video solution from webcam - It's wrong???
vietdoor_at_gmail.com
Date: 02/14/05
- Next message: vietdoor_at_gmail.com: "Change video stream?"
- Previous message: Marc Höper: "Re: Use second graphic card with VMR7"
- Messages sorted by: [ date ] [ thread ]
Date: 13 Feb 2005 23:05:19 -0800
I want to change width and height of Webcam for capturing to a video
file.But with below source, error is "This media type is not valid".
// ICaptureGraphBuilder2 *m_pBuilder;
// IAMStreamConfig *m_pVSC;
// IBaseFilter *m_pSrcFilter; // Filter is from Live Video
// int width, int height // 160 x 120 or 320 x 240
hr = m_pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved, m_pSrcFilter, IID_IAMStreamConfig, (void
**)&m_pVSC);
if (FAILED(hr))
{
hr = m_pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, m_pSrcFilter, IID_IAMStreamConfig, (void **)&m_pVSC);
}
if(hr != NOERROR)
{
// this means we can't set frame rate (non-DV only)
ErrMsg(TEXT("Error %x: Cannot find
VCapture:IAMStreamConfig"), hr);
}
else
{
AM_MEDIA_TYPE *pmt;
hr = m_pVSC->GetFormat(&pmt);
// DV capture does not use a VIDEOINFOHEADER
if(hr == NOERROR)
{
if(pmt->formattype == FORMAT_VideoInfo)
{
VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER
*)pmt->pbFormat;
pvi->bmiHeader.biWidth = width;
pvi->bmiHeader.biHeight = height;
}
hr = m_pVSC->SetFormat(pmt);
-----------------------------------
Help me! Thanks
- Next message: vietdoor_at_gmail.com: "Change video stream?"
- Previous message: Marc Höper: "Re: Use second graphic card with VMR7"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|