|
Have you installed DirectX SDK? If not, download it from Microsoft , which is freely available. Set the include path in Visual Studio and run it.
Hope, this helps..
GOOD DAY.!
DK
|
|
|
|
|
In VC6
Click Tools\Options\Directories tab
& then add the Include files as:
C:\Program Files\Microsoft DirectX 9.0 SDK (December 2004)\Include
Dillian
|
|
|
|
|
Could someone explain me how to:
"Create an Object of the class “CCaptureVideo” using Class wizard."
Thanks
|
|
|
|
|
when i was running a program using dshow.h , an error in strmif.h (Generated IDL header file for streams interfaces) which is included in dshow.h occured saying missing semicolon at line 1024 , but i didn't find any error , i don't know what to do ? can any one send me a working strmif.h file ?
|
|
|
|
|
add these two line in header file
typedef long LONG_PTR;
typedef unsigned long DWORD_PTR;
Dillian
|
|
|
|
|
Does anyone know how to add the ISampleGrabber to this current example,
so that a single video frame can be grabbed?
There is a frame grabber example here... http://www.codeproject.com/audio/framegrabber.asp
but I cant seem to get the ISampleGrabber to work this this particualr example,
Thanks
|
|
|
|
|
Nevermind I figured it out,
but what I did not figure out yet, is how to change the video stream size so when I grab a snapshot of the video it is the size I want. ex 640 x 480.
|
|
|
|
|
I'm tring to save video in WMV format.
Adding this code
IFileSinkFilter *pSink = NULL;
IBaseFilter *pMux = NULL;
hr = m_pCaptureMoniker->SetOutputFileName(&MEDIASUBTYPE_Avi,L"C:\\Example.avi",&pMux,&pSink);
hr = m_pCaptureMoniker->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,pBaseFilter, NULL, pMux);
video stream is saved in Avi file, changing SetOutputFileName arguments in (&MEDIASUBTYPE_Asf,L"C:\\Example.wmv",&pAsfWriter,NULL);
the graph couldn't run
Please, could someone explain me why, or give me a way to save video to WMV file or better MPG file?
thanks
|
|
|
|
|
The easiest way to build this graph is by specifing MEDIASUBTYPE_Asf in the ICaptureGraphBuilder2::SetOutputFileName method:
IBaseFilter* pASFWriter = 0;
hr = pBuild->SetOutputFileName(
&MEDIASUBTYPE_Asf, // Create a Windows Media file.
L"C:\\VidCap.wmv", // File name.
&pASFWriter, // Receives a pointer to the filter.
NULL); // Receives an IFileSinkFilter interface pointer (optional).
The value MEDIASUBTYPE_Asf tells the Capture Graph Builder to use the WM ASF Writer filter as the file sink. The Capture Graph Builder creates the filter, adds it to the graph, and calls IFileSinkFilter::SetFileName to set the name of the output file. It returns a pointer to the filter as an outgoing parameter (pASFWriter in the previous example).
Use the IConfigAsfWriter interface on the WM ASF Writer to set the Windows Media profile. You must do this before you connect any pins on the WM ASF Writer.
IConfigAsfWriter *pConfig = 0;
hr = pASFWriter->QueryInterface(IID_IConfigAsfWriter, (void**)&pConfig);
if (SUCCEEDED(hr))
{
// Configure the ASF Writer filter.
pConfig->Release();
}
For more information about setting the profile, see Creating ASF Files in DirectShow.
Call ICaptureGraphBuilder2::RenderStream to connect the capture filter to the ASF Writer:
hr = pBuild->RenderStream(
&PIN_CATEGORY_CAPTURE, // Capture pin.
&MEDIATYPE_Video, // Video. Use MEDIATYPE_Audio for audio.
pCap, // Pointer to the capture filter.
0,
pASFWriter); // Pointer to the sink filter (ASF Writer).
Each input pin on the WM ASF Writer filter corresponds to a stream in the Windows Media profile. You must connect every pin, so that the file content matches the profile.
|
|
|
|
|
could any one copy and paste the code for dshow.h here or attach it to me
|
|
|
|
|
You find it in \DXSDK\Include
|
|
|
|
|
Hi, I Want to capture live video with dimension 720x576, thanks.
|
|
|
|
|
Hi,
I have a little problem!!!
When i build this API with MVS++ 6.0, it can't find all the file.h (afxres.h, ect...)!!!
It work if i give the good way (c:\fjhfv\csdhbvj.....)!!
Can you help me thanks!!
Cyril
|
|
|
|
|
subject says it all....Basically I tried to complie the project but it says it can't find dshow.h
Any help?
|
|
|
|
|
"You need to install DirectX, which is available freely from Microsoft. You can download DirectX 9.0 from Microsoft.
For development, install DirectX 9.0 SDK. You can download DirectX 9.0 SDK from Microsoft. "
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Also be aware that DirectShow has been removed from the latest update to DirectX (April 2005) and is now part of the Platform SDK.
You can get it by downloading the Microsoft® Windows Server 2003 SP1 Platform SDK - April 2005 Edition if you are not using an earlier version of DirectX. If you use the web installation package you can just download the DirectShow elements of the SDK.
Cheers,
Jason.
Melbourne. Australia.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
thanks guys I never would have known... all these things.
|
|
|
|
|
|
Hi, it is possible to capture video from different sources at the same time using only one capture card?
Excellent
|
|
|
|
|
Does anyone know how I could modify the CCaptureVideo class to call a callback function when each frame of video is grabbed, and if so how would it be done? This would be useful for me as I’m writing an application to grab and buffer images for storage rather than display live images. I could use the callback function to trigger image storage code when each new frame of video arrives.
Nice code btw. CPU sits idle grabbing live video.
Cheers,
Matt.
|
|
|
|
|
Hi palm,
I got your source codes for live video and when I tryed to compile it .. I got the following messages:
--------------------Configuration: LiveVideo - Win32 Debug--------------------
Compiling...
CaptureVideo.cpp
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
LiveVideo.cpp
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
LiveVideoDlg.cpp
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:\arquivos de programas\microsoft directx 9.0 sdk (december 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.
LiveVideo.exe - 6 error(s), 0 warning(s)
I wonder if you could help me out with that couse i don't understando what's going on.
thank you... by the way great work on the code ...
Marcus Augustus
|
|
|
|
|
I have same errors....
|
|
|
|
|
I have same problems.Did you solve this problem, plesa give information about this problem.
shayirli@yahoo.com
Sezgin
Shayirli
|
|
|
|
|
Please somebody that has the error i have the same error and i dont know how can i do it?
please give us the solution ???
my email is santano@hotmail.com
i dont care of the trobble
|
|
|
|
|
It will be terrible, I replace functions
e.g.
// ICaptureGraphBuilder2* m_pCapture ;
ICaptureGraphBuilder* m_pCapture ;
and
// hr = CoCreateInstance (CLSID_CaptureGraphBuilder2 , NULL, CLSCTX_INPROC,
// IID_ICaptureGraphBuilder2, (void **) &m_pCapture);
hr = CoCreateInstance (CLSID_CaptureGraphBuilder , NULL, CLSCTX_INPROC,
IID_ICaptureGraphBuilder, (void **) &m_pCapture);
// hr = CoCreateInstance (CLSID_CaptureGraphBuilder2 , NULL, CLSCTX_INPROC,
// IID_ICaptureGraphBuilder2, (void **) &m_pCaptureMoniker);
hr = CoCreateInstance (CLSID_CaptureGraphBuilder , NULL, CLSCTX_INPROC,
IID_ICaptureGraphBuilder, (void **) &m_pCaptureMoniker);
// hr = m_pCaptureMoniker->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,
// pBaseFilter, NULL, NULL);
hr = m_pCaptureMoniker->RenderStream (&PIN_CATEGORY_PREVIEW,
pBaseFilter, NULL, NULL);
// hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
// &MEDIATYPE_Interleaved, pSrcF,
// IID_IAMCrossbar, (void **)&pX);
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
pSrcF,
IID_IAMCrossbar, (void **)&pX);
// if(hr != NOERROR)
// hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
// &MEDIATYPE_Video, pSrcF,
// IID_IAMCrossbar, (void **)&pX);
if(hr != NOERROR)
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
pSrcF,
IID_IAMCrossbar, (void **)&pX);
/*
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved, pSrcF,
IID_IAMCrossbar, (void **)&pX);
if(hr != NOERROR)
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video, pSrcF,
IID_IAMCrossbar, (void **)&pX);
*/
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
pSrcF,
IID_IAMCrossbar, (void **)&pX);
if(hr != NOERROR)
hr = m_pCapture->FindInterface(&PIN_CATEGORY_CAPTURE,
pSrcF,
IID_IAMCrossbar, (void **)&pX);
Delete
// wsprintfW(wsz, L"FilterGraph %08x pid %08x\0", (DWORD_PTR)pUnkGraph,
// GetCurrentProcessId());
// _vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);
// va_end(pArgs);
Dillian
|
|
|
|
|