|
Assalamoalikum!
i have tried your code as the way it is
It gives no errors but i cant see the video ... now i am stuck
My scenario is that i have a preview mode and a capture mode
I have implemented "preview mode" through VMR in the preview window.
It works fine through it.
Now about the problem i am facing i have a child window that starts showing the same preview on button click in it( say "capture window").
I had implemented this scenario through GRABBER but i want to do it through VMR although i am running an instance of appilication in the same application and on the same dialog
Through your code i got no errors through out i mean till
m_hr=pMC->Run();
i get no errors still i cant preview the video
more over i am getting the rectangle of the child window as
<br />
RECT rcDest;<br />
::GetClientRect (hWnd,&rcDest);<br />
still i cant preview it how to proceed???
Thanks and regards
if you want to look through Code then its like
<br />
<br />
<br />
HRESULT CCameraPreview::TestVideo(HWND m_DlghWnd,HWND hWnd)<br />
{<br />
<br />
r = new VMR9NormalizedRect;<br />
r->left = 0;<br />
r->top = 0;<br />
r->right = 1;<br />
r->bottom = 1;<br />
<br />
pWC = NULL;<br />
pMix = NULL;<br />
pGB = NULL;<br />
pVmr = NULL;<br />
pConfig = NULL;<br />
pMC = NULL;<br />
pMS = NULL;<br />
<br />
m_hr=CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, <br />
IID_IGraphBuilder, (void **)&pGB);<br />
m_hr=CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC,<br />
IID_IBaseFilter, (void**)&pVmr);<br />
m_hr=pGB->AddFilter(pVmr, L"Video"); <br />
m_hr=pVmr->QueryInterface(IID_IVMRFilterConfig9, (void**)&pConfig);<br />
m_hr=pConfig->SetRenderingMode(VMR9Mode_Windowless);<br />
m_hr=pVmr->QueryInterface(IID_IVMRWindowlessControl9, (void**)&pWC);<br />
<br />
<br />
RECT rcDest;<br />
::GetClientRect (hWnd,&rcDest);<br />
<br />
<br />
m_hr=pWC->SetVideoPosition(NULL, &rcDest);<br />
<br />
m_hr=pWC->SetVideoClippingWindow(hWnd);<br />
m_hr=pVmr->QueryInterface(IID_IVMRMixerControl9, (void**)&pMix);<br />
m_hr=pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS);<br />
m_hr=pGB->QueryInterface(IID_IMediaControl, (void **)&pMC);<br />
m_hr=pMC->Run();<br />
return m_hr;<br />
-- modified at 3:45 Monday 4th September, 2006
Jabeen
|
|
|
|
|
W Salaam.
Make sure HWND is not null. Also, do you hear sound?
Regards,
Sameer
|
|
|
|
|
aoa,
MY IVMRMixerControl9 can't be initialized. When I build "Ticker9.dsw" sample of DX SDK, there is no problem with it. Its IVMRMixerControl9 gets perfectly initialized which means there is no problem in my graphics hardware and its driver. I have set "hardware accelaration" to full. When I run my program, the statement where I query for pMix (IVMRMixerContol9 variable) interface returns an error of E_NOINTERFACE. When I debug the program, debugger gives error "Expression can't be evaluated" for the initialization statement of pMix.
I can't find any reason for this strange behavior. I am fed up with this problem. Plz tell me what can be the reason. There is no typographical mistake whatsoever in my program this time. The code is:
/******************************************************************************/
<b>w26.h</b>
class CMainWnd : public CFrameWnd
{
public:
CMainWnd();
~CMainWnd();
DECLARE_MESSAGE_MAP()
};
class CApp : public CWinApp
{
public:
BOOL InitInstance();
};
/**************************************************************************/
<b>w26.cpp</b>
//VMR9 multiple stream
#include <afxwin.h>
#include <dshow.h>
#include <d3d9.h> //for IVMRFilterConfig9
#include <Vmr9.h> //for IVMRFilterConfig9
#include "w26.h"
#include <dxutil.h> //for SAFE_RELEASE
#include <vmrutil.h> //for VerifyVMR
#pragma comment(lib, "quartz.lib")
#pragma comment(lib, "strmiids.lib")
#define FILENAME1 L"C:\\Badday.avi"
#define FILENAME2 L"c:\\p.mpg"
CApp app;
CMainWnd::CMainWnd()
{
Create(NULL, "Videowindow");
}
CMainWnd::~CMainWnd()
{}
BOOL CApp::InitInstance()
{
m_pMainWnd=new CMainWnd;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
IGraphBuilder *pGraph=NULL;
IMediaEvent *pEvent=NULL;
IMediaControl *pControl=NULL;
IBaseFilter *pVmr9=NULL;
IBaseFilter *pSource1=NULL;
IBaseFilter *pSource2=NULL;
IVideoWindow *pVid=NULL;
IVMRMixerControl9 *pMix=NULL;
ICaptureGraphBuilder2 *pCapture=NULL;
long evcode;
//Initialize COM
CoInitialize(NULL);
if(!VerifyVMR())
{
MessageBox(NULL, "VMR NOT FOUND ", "ERROR", MB_OK|MB_ICONEXCLAMATION);
exit(1);
}
else
MessageBox(NULL, "NO PROBLEM WITH VMR", "SUCCESS", MB_OK|MB_ICONEXCLAMATION);
//Create filter graph
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder,
(void **)&pGraph);
//create capture graph
CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER,
IID_ICaptureGraphBuilder2, (void **)&pCapture);
//set filter graph
pCapture->SetFiltergraph(pGraph);
//create VMR9
CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter,
(void **)&pVmr9);
//obtain mixer control interface
HRESULT hr=pVmr9->QueryInterface(IID_IVMRMixerControl9, (void **)&pMix);
if(hr==E_NOINTERFACE )
MessageBox(NULL, "E_NOINTERFACE PROBLEM\nFOR PMIX", "FAILED", MB_OK);
else
if(hr==E_POINTER)
MessageBox(NULL, "E_POINTER PROBLEM\nFOR PMIX" , "FAILED", MB_OK);
//obtain media event interface
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
//obtain media control interface
pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
//obtain video window interface
pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVid);
//add vmr9
pGraph->AddFilter(pVmr9, L"VMR9");
//add source filter 1
pGraph->AddSourceFilter(FILENAME1, L"SOURCE", &pSource1);
//add source filter 2
pGraph->AddSourceFilter(FILENAME2, L"SOURCE", &pSource2);
//ERROR is at this location
hr=pMix->SetAlpha(0, 0.5);
if(hr==VFW_E_NOT_CONNECTED)
MessageBox(NULL, "VFW_E_NOT_CONNECTED FOR SETALPHA", "FAILED", MB_OK);
else
MessageBox(NULL, "S_OK", "SUCCESS OF SETALPHA", MB_OK);
hr=pMix->SetAlpha(1, 0.5);
//render audio and video of source 1
pCapture->RenderStream(NULL, NULL, pSource1, NULL, pVmr9);
pCapture->RenderStream(NULL, &MEDIATYPE_Audio , pSource1, NULL, NULL);
//render audio and video of source 2
pCapture->RenderStream(NULL, NULL, pSource2, NULL, pVmr9);
pCapture->RenderStream(NULL, &MEDIATYPE_Audio , pSource2, NULL, NULL);
//video window's win_management
pVid->put_Owner((OAHWND)m_pMainWnd->GetSafeHwnd());
pVid->put_WindowStyle(WS_CHILD|WS_CLIPSIBLINGS);
RECT rect;
m_pMainWnd->GetClientRect(&rect);
pVid->SetWindowPosition(0,0, rect.right-rect.left, rect.bottom- rect.top);
pVid->SetWindowForeground(OATRUE);
pVid->put_Visible(OATRUE);
//run graph
pControl->Run();
pEvent->WaitForCompletion(INFINITE, &evcode);
SAFE_RELEASE(pGraph);
SAFE_RELEASE(pMix);
SAFE_RELEASE(pVid);
SAFE_RELEASE(pSource1);
SAFE_RELEASE(pSource2);
SAFE_RELEASE(pCapture);
SAFE_RELEASE(pControl);
CoUninitialize();
return 0;
}
BEGIN_MESSAGE_MAP(CMainWnd, CFrameWnd)
END_MESSAGE_MAP()
/**************************************************************************/
Thanks
-- modified at 22:13 Thursday 17th August, 2006
|
|
|
|
|
W S
Why do you build a capture graph? It is meant for file writing, and not this type of application. Simply remove that interface.
Instead of calling pCapture->RenderStream four times, call pGraph->RenderFile twice. 'RenderFile' is the equivalent of 'Render Media File' in GraphEdit.
The reason of your problem (as extracted from the DX SDK help file):
"Note The ICaptureGraphBuilder2 interface does not use the Video Mixing Renderer (VMR) or Video Port Manager filters."
That pretty much sums it up.
-- modified at 0:25 Friday 18th August, 2006
|
|
|
|
|
Aoa,
Where is the rule mentioned that ICaptureGraphBuilder2 interface does not support the Video Mixing Renderer (VMR)9? I have searched for it and haven't found this type of thing. Instead if you read the vmr9 configuration procedure, it says that you can render a video file on vmr9 using RenderFile method of IGraphBuilder or RenderStream method of ICaptureGraphBuilder2. Using RenderFile of IGraphBuilder doesn't solve my problem.
I have realized my mistake. Actually I was querying for pMix (IVMRMixerControl9 variable) interface at wrong place i.e. before rendering videos. Basically the error of E_NOINTERFACE was being generated due to this mistake. Now that I query for it after rendering, I get correct result regardless of the fact that I am using ICaptureGraphBuilder's RenderStream.
Thanks for your answer.
|
|
|
|
|
W S
Very strange, a value of 0 means it's NULL. Are you sure pVmr9 has been correctly initialized?
|
|
|
|
|
hi,
I am new to DirectShow and have encountered a problem. I am trying to implement the following filter graph to render avi video only.
source filter -> mpeg-1 stream splitter -> mpeg video decoder -> video renderer
I get correct output when i use "Capture Graph builder" and apply the "renderstream" function. I want to use "Filter Graph Manager" to implement the above filter graph and manually connect the filters (not using renderfile). The problem is that MPEG-1 Stream Splitter has two pins of media types AMMEDIA_Audio and AMMEDIA_Video. I just want to use the video output pin only. I don't know exactly how to enumerate the pin for this media type. I have tried enummediatypes in my program but it doesn't work. I think there is some problem in the way I have used it. Can anyone please correct the following program for me?
/****************************************************************************
Link -> 1)Strmiids.lib 2)Quartz.lib
Manually building a filter graph for playing an "AVI video" (not audio).
Source Filter -> MPEG-I Stream Splitter -> MPEG Video Decoder -> Video Renderer
*****************************************************************************/
#include <iostream.h>
#include <dshow.h>
void CheckFailure(HRESULT);
HRESULT GetUnconnectedPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin **ppPin);
/******************************************************************/
void main()
{
IGraphBuilder *pGraph=NULL;
IBaseFilter *pSource=NULL;
IBaseFilter *pmpegSplitter=NULL;
IBaseFilter *pmviddecoder=NULL;
IBaseFilter *pvidrenderer=NULL;
IMediaControl *pControl = NULL;
IMediaEvent *pEvent = NULL;
HRESULT hr;
IPin *InPin;
IPin *OutPin;
//initialize COM
CoInitialize(NULL);
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr))
{
cout<<"ERROR - Could not create the Filter Graph Manager."<<endl;
return;
}
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
//STEP 1: Create filter instances
/*hr=CoCreateInstance(CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pSource);
CheckFailure(hr);*/
hr=CoCreateInstance(CLSID_MPEG1Splitter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pmpegSplitter);
CheckFailure(hr);
hr=CoCreateInstance(CLSID_CMpegVideoCodec, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pmviddecoder);
CheckFailure(hr);
hr=CoCreateInstance(CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pSource);
CheckFailure(hr);
//STEP 2: Add the filters
pGraph->AddSourceFilter(L"C:\\Badday.avi", L"Source", &pSource);
pGraph->AddFilter(pmpegSplitter, NULL);
pGraph->AddFilter(pmviddecoder, NULL);
pGraph->AddFilter(pvidrenderer, NULL);
//STEP 3: Query pins for connction
//1. find source output
hr = GetUnconnectedPin(pSource, PINDIR_OUTPUT, &OutPin);
//2. find mpegSplitter input
hr = GetUnconnectedPin(pmpegSplitter, PINDIR_INPUT, &InPin);
//connect 1 & 2
hr = pGraph->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
//3. find mpegSplitter output
// hr = GetUnconnectedPin(pmpegSplitter, PINDIR_OUTPUT, &OutPin);
IEnumPins *pEnum = 0;
IEnumMediaTypes *pmedia=NULL;
AM_MEDIA_TYPE *pmt=NULL;
hr = pmpegSplitter->EnumPins(&pEnum);
while (pEnum->Next(1, &OutPin, NULL) == S_OK)
{
// hr=OutPin->ConnectionMediaType(pmt);
hr=OutPin->EnumMediaTypes(&pmedia);
hr=pmedia->Next(1, &pmt, NULL);
PIN_DIRECTION ThisPinDir;
OutPin->QueryDirection(&ThisPinDir);
if (ThisPinDir == PINDIR_OUTPUT)
{
if(pmt->majortype == MEDIATYPE_Video)
{
pEnum->Release();
pmedia->Release();
break;
}
}
}
//4. find mpeg video decoder input
hr = GetUnconnectedPin(pmviddecoder, PINDIR_INPUT, &InPin);
//connect 3 & 4
pGraph->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
//5. find mpeg video decoder output
hr = GetUnconnectedPin(pmviddecoder, PINDIR_OUTPUT, &OutPin);
//6. find video renderer input
hr = GetUnconnectedPin(pvidrenderer, PINDIR_INPUT, &InPin);
//connect 5 & 6
pGraph->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
//STEP 4: Run the graph
hr = pControl->Run();
if (SUCCEEDED(hr))
{
// Wait for completion.
long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);
}
//STEP : Release all resources
pGraph->Release();
pControl->Release();
pEvent->Release();
pSource->Release();
pmpegSplitter->Release();
pmviddecoder->Release();
pvidrenderer->Release();
CoUninitialize();
}
/******************************************************************/
HRESULT GetUnconnectedPin(
IBaseFilter *pFilter, // Pointer to the filter.
PIN_DIRECTION PinDir, // Direction of the pin to find.
IPin **ppPin) // Receives a pointer to the pin.
{
*ppPin = 0;
IEnumPins *pEnum = 0;
IPin *pPin = 0;
HRESULT hr = pFilter->EnumPins(&pEnum);
if (FAILED(hr))
{
return hr;
}
while (pEnum->Next(1, &pPin, NULL) == S_OK)
{
PIN_DIRECTION ThisPinDir;
pPin->QueryDirection(&ThisPinDir);
if (ThisPinDir == PinDir)
{
IPin *pTmp = 0;
hr = pPin->ConnectedTo(&pTmp);
if (SUCCEEDED(hr)) // Already connected, not the pin we want.
{
pTmp->Release();
}
else // Unconnected, this is the pin we want.
{
pEnum->Release();
*ppPin = pPin;
return S_OK;
}
}
pPin->Release();
}
pEnum->Release();
// Did not find a matching pin.
return E_FAIL;
}
/******************************************************************/
void CheckFailure(HRESULT hr)
{
if(FAILED(hr))
exit(0);
}
|
|
|
|
|
Hi,
AVI and MPEG are different formats and you can not conclude the contents of a file with it's extension.
Considering video only, an MPEG-1 filter graph will *always* look like the following:
MPEG-1 File Source --> MPEG-1 Stream Splitter --> MPEG Video Decoder --> Video Renderer
An AVI filter graph will look *something* like this:
AVI File Source --> AVI Splitter --> AVI Decompresser --> Video Renderer
Now, the AVI decompressor component depends on the type of compression. If the file is in DivX format, a DivX decompressor would be inserted.
Since you are using an MPEG-1 splitter, I will assume you are rendering an MPEG.
The exception occurs because “pvidrenderer” has not been initialized. I will assume you’ve tried to initialize it, but have passed an incorrect variable’s name, because the following line does not make any sense:
hr=CoCreateInstance(CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pSource);
Replace it with:
hr=CoCreateInstance(CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pvidrenderer);
I am sending you a cleaner version of your code (with unnecessary code commented out).
Good luck!
|
|
|
|
|
Hi,
I use on my application the IVideoWindow interface but I want to change the code to use the Video Mixing Renderer filter. How can I switch on the full screen mode ?
Thanks,
Gabriel
|
|
|
|
|
From the SDK:
"The IVideoWindow interface sets properties on the video window. Applications can use it to set the window owner, the position and dimensions of the window, and other properties.
Note The IVMRWindowlessControl or IVMRWindowlessControl9 interface is now preferred over IVideoWindow. For more information, see Using Windowless Mode."
|
|
|
|
|
e:\down\codeproject\directshowvmr9_src\Form1.h(148) : error C2440: 'type cast' : cannot convert from 'System::EventHandler __gc *' to 'byte *'
Cannot convert a managed type to an unmanaged type
e:\down\codeproject\directshowvmr9_src\Form1.h(148) : error C3867: 'DirectShowVMR9::Form1::trackBarX1_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarX1_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(148) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(167) : error C3867: 'DirectShowVMR9::Form1::trackBarY1_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarY1_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(167) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(187) : error C3867: 'DirectShowVMR9::Form1::trackBarW1_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarW1_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(187) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(207) : error C3867: 'DirectShowVMR9::Form1::trackBarH1_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarH1_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(207) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(227) : error C3867: 'DirectShowVMR9::Form1::trackBarA1_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarA1_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(227) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(271) : error C3867: 'DirectShowVMR9::Form1::buttonStop_Click': function call missing argument list; use '&DirectShowVMR9::Form1::buttonStop_Click' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(271) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(282) : error C3867: 'DirectShowVMR9::Form1::buttonClose_Click': function call missing argument list; use '&DirectShowVMR9::Form1::buttonClose_Click' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(282) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(293) : error C3867: 'DirectShowVMR9::Form1::buttonPlay_Click': function call missing argument list; use '&DirectShowVMR9::Form1::buttonPlay_Click' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(293) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(303) : error C3867: 'DirectShowVMR9::Form1::buttonOpen_Click': function call missing argument list; use '&DirectShowVMR9::Form1::buttonOpen_Click' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(303) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(313) : error C3867: 'DirectShowVMR9::Form1::buttonPause_Click': function call missing argument list; use '&DirectShowVMR9::Form1::buttonPause_Click' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(313) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(325) : error C3867: 'DirectShowVMR9::Form1::trackBarA2_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarA2_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(325) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(345) : error C3867: 'DirectShowVMR9::Form1::trackBarH2_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarH2_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(345) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(365) : error C3867: 'DirectShowVMR9::Form1::trackBarW2_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarW2_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(365) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(384) : error C3867: 'DirectShowVMR9::Form1::trackBarY2_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarY2_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(384) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(403) : error C3867: 'DirectShowVMR9::Form1::trackBarX2_Scroll': function call missing argument list; use '&DirectShowVMR9::Form1::trackBarX2_Scroll' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(403) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
e:\down\codeproject\directshowvmr9_src\Form1.h(456) : error C3867: 'DirectShowVMR9::Form1::Form1_Load': function call missing argument list; use '&DirectShowVMR9::Form1::Form1_Load' to create a pointer to member
e:\down\codeproject\directshowvmr9_src\Form1.h(456) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
生成日志保存在“file://e:\down\codeproject\DirectShowVMR9_src\Debug\BuildLog.htm”
|
|
|
|
|
hi sameer,
Gr8 work man.
Can these interfaces b useful to me in mixing the text with video(like displaying subtitles). Can u suggest me some idea regarding this.
..JK
|
|
|
|
|
Thank you.
Well, first you draw your desired text on a bitmap. Then you can use the IVMRMixerBitmap9 Interface to blend that bitmap on any video.
The DirectX9 SDK has a good sample regarding this, it can be found in the following location:
(SDK root)\Samples\C++\DirectShow\VMR9\Text
An alternative solution can be found here:
http://www.gdcl.co.uk/overlay.htm[^]
Good luck!
|
|
|
|
|
W Salaam!
There aren't many DirectShow resources and the two you've mentioned have been the best I've been through. You must also walk-through the (simple) samples provided in the DirectX SDK. Thankfully, a kind person has made available a comprehensive list of DirectShow resources:
http://tmhare.mvps.org/links.htm[^]
|
|
|
|
|
Thanks for posting the great sample. It will be a good resource to learn from. Do you have a blog?
Ron
|
|
|
|
|
Thank you. No, I'm sorry, but I do not have a blog.
|
|
|
|
|
ingnore this
OnlythruGrace
|
|
|
|
|
Oh, I forgot. After I am done I would like to capture the rendered video to a file.
Do the VMR7 or VMR9 have output pins. Or does it require geting the DDraw surface and pull the video from there.
If so how do you keep the audio sinked.
I want to be able to edit just a section one of the embedded video streams, without having to reprocess the entire video.
So I need to capture, cut, reinsert and splice.
Peter
check out the liitle people att http://curems.no-ip.org/grace.html
OnlythruGrace
|
|
|
|
|
This looks like the Blender sample that some with the SDK.
I tried to compile that and got stuck with it not being able to open some 64 bit lib file. When I tweaked it so it could open. I got another error message saying I had a conflict between 32 and 64 bit modes.
I am sure I just did set up the paths corredctly.
With you code I am getting compiler errors with all the System::EventHandler calls.
when I comment these out just to see if it will run. I get a cannot open input file 'ddraw.dll' linker error LNK1181.
Any clues?
I have managed to implement most of this in VMR7 from some windowed sample I made windowless. Since I managed to get all the paths right on that I don't think it will take me much to convert to VMR9.
I am looking to make a production system so I am not certain that I even want VMR9 because it can't use the video port manager. I thaough this might help speed things up if the graphic card could do some decoding, incodeing and other filtering. All this is for a client.
For my own interest I have made some green screen video with C## and dot .NET framework. It is nice but no of my friends or prospective viewers want to download and install .NET on their home computers.
That is what brought me to doing it in C++. I have a free copy of C++ express. When It loadied your demo software it did some conversions, which weren't exactly correct.
Any help would uh.. Help.
Thanks
OnlythruGrace
|
|
|
|
|
hi,
I would like to know,
what I have to do, to play a video in loop.
I mean, how can I detect the end and restart again?
Thanx 4 all, your code has helped me so much.
|
|
|
|
|
Hello !
Thanks for your very useful articles !
Using this method, can you assume that both video are synchronized ? (using same encoding properties for both videos) ?
Thanks in advance
Thomas.P
|
|
|
|
|
Thank you for the encouragement.
Two videos, encoded with the same properties, may not always be synchronized when played, especially when the compression level is high (like MPEG4). Play the videos in Media Player and check out it's quality in the properties section: make sure there is no jitter/frames dropped while playback.
If the playback is smooth: zero jitter/dropped frames, then you may assume both videos are synchronized when mixed, i.e. Frame 214 of a video will be rendered on top of Frame 214 of another video.
I have not tried such an experiment, so please let me know of your results, thank you.
|
|
|
|
|
Hi,
This is a great article! Is there a way to stream the result? I want to add a compressor filter. After the video is compressed (for example with divx), I want to stream it over the internet.
Is this possible? If so, can you explain me how?
Thanks!
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
Hi,
First of all, thank you! Well, VMR9 is a 'renderer' filter and not a 'transform' filter, so the results cannot be streamed to disk (or over the net).
But, VMR9 allows you to capture a bitmap of the mixed videos. Maybe if you capture a bitmap of every frame and convert it to video, then you can stream it over the internet.
This is what Screen Capture utilities do to save a screen (or portions of it) as AVI/WMV. A sample is available here[^].
Further information may be found here[^], under the "Can I create a movie from bitmaps?" section.
[Off the topic: I visited your website, it's impressive!]
-- modified at 18:09 Monday 7th August, 2006
|
|
|
|
|
Thank you for your (speedy) reply!
The only thing I want is to load video from a webcam, compress it and send it over the net (we can use LAN, so the filesize can be pretty big).
I used VMR before, so I was able to show the video in a preview window with the divx logo. I thought, the only thing left now is streaming. That was easier said than done.
Do you think I need to use VMR to implement what I want, or is the IVideoWindow enough?
Again, thank you for your help! It is very hard to find some good tutorials about DirectShow (and streaming) on the internet.
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|