|
|
references:
http://msdn2.microsoft.com/en-us/library/799kze2z(vs.71).aspx
http://www.ddj.com/windows/184416689 (topic: Application Domains and Unmanaged Calls)
|
|
|
|
|
waw, seem like i got a lot of thing to do b4 i can build this project correctly.
thank u.
|
|
|
|
|
Hi,
can I change merit value for ACM filter using filmerit_30en.exe or other similar stuff.
It seems to me not.
thanks
jdsc
|
|
|
|
|
haven't tried that, but
http://www.videohelp.com/tools/RadLight_Filter_Manager
works well for me.
|
|
|
|
|
EZGrabberMgr.obj : error LNK2001: unresolved external symbol _CLSID_NullRenderer
EZGrabberMgr.obj : error LNK2001: unresolved external symbol _IID_ISampleGrabber
EZGrabberMgr.obj : error LNK2001: unresolved external symbol _CLSID_SampleGrabber
EZGrabberMgr.obj : error LNK2001: unresolved external symbol _IID_ICaptureGraphBuilder2
i am using platform sdk release for windows Vista
i have also linked the libraries strmiids .lib ,strmbasd.lib ,dxguid.lib,
My include paths are also set
plz helpppp
|
|
|
|
|
How have you linked the libraries? Have you set the paths for 'Library files'? [Tools-->Options-->Directories-->Show directories for-->Library files]
Make sure your Platform SDK paths (both Include and Library) are right at the top.
Also, you must set these directories again if you change your build type from Debug to Release (or vice-versa)
|
|
|
|
|
Is there a way to have a single filter graph with both VMR7 and VMR9 filters. Coz, if I create such a graph, when I try deleting any of the filter through my code, the VMR7 filters stops playing.
Or is there any event that shall notify that the filter has stopped playing so that it can be handled when that notification or event occurs?
Any help will be welcome..
- Manu
|
|
|
|
|
I'm facing with issues while trying to continuously add and delete VMR9 filters in filter graphs for my application. But after creating and deleting some 53 VMR9s, my application stops connecting more VMR9s in the filter graph.
What actually happens is I add a VMR9 filter to the filter graph and establish connections. Then delete the graph, again create a new VMR9 and continue adding and deleting, till as many times it successfully adds and connects the filters. But after creating and connecting the 53rd VMR9 filter, DirectX fails to connect the filters in the graph eventhough it creates one.
It seems like some kind of memory leak, that doesnt not release the VMR9 filters, even though I've ensured in the code, that I release the filters. So, it creates the next VMR9 instead of recreating or reusing the last destroyed one.
Can anyone please suggest what should I do in order fix this issues.
|
|
|
|
|
I found the solution for my issue regarding this. Its necessary to release every instance thats created due to QueryInterface() calls, just before another QueryInterface(), as if we fail to do this, the reference count keeps on incrementing eachtime we call QueryInterface() even though for the same variable name and when we Release() for the filter object is called just once, it just reduces the reference count by 1 and thus the leakage as the reference count needs to be 0 after Release() call for a queried render-filter.
-Manu
|
|
|
|
|
Hello,
I want to save the result of the VMR9 mixing in a .avi file instead that on the screen.
How to get the output of the VMR9 ? And to redirect this resulting image in a file ?
Thank you,
Christophe,
CJ
|
|
|
|
|
Hi
first it should be clear that VMR9 is a renderer filter,
and renderer filters donot have output pin, which can be
connected to another filter.
So you yourself have to write a mixer filter which must be
a transform filter so can be connect to a file writer filter.
|
|
|
|
|
Hi
I have GraphFilter getting from IRenderEngine. i overlaid text on video using the vmr9.how to save video file with the text?.Kindly explain more.
Advance Thanks!!!
boopathi_tpgit@yahoo.com
|
|
|
|
|
Hi
As earlier said you that VMR9 is a rederer filter
and renderrer filters donot have output pins, meaning they
can get media data from other filters (through input pins)
but they cannot output data because they donot have output pins.
So any filter having a output pin will be able to send its data
to file writer filter. (BTW file writer is also a renderer
filter ).
So if you want to overlay text over video you must have a
filter which can do ovelay work for you and then connect
that filter to the file writer.
You yourself can write such a filter, for an example
see the sdk filter exampl
RGBFilters this example have many filters but the
TransSmpte will work for you it tells how to write
over video.
|
|
|
|
|
open task manager on any other window while video is playing results in greenish lines on video window.
Can anybody reproduce the behaviour. I am using RenderStream to render video using BDA analog capture device on DELL D800 laptop.
Please any suggestions or solutions
Thanks in advance
Shovit
|
|
|
|
|
Sorry, firstly, thankyou for such a fine example to work with. Secondly, Can I change the VMR picture window to full screen? If so, how?
Thankyou once again, apologies for the initial abrupt question
Alan
-- modified at 10:40 Friday 6th October, 2006
|
|
|
|
|
Aoa,
Do you know how to enumerate a pin on a filter containing two pins in the same direction? I want to find 2nd output pin on a filter that has two output pins.
Thanks
|
|
|
|
|
---->(2)
(1)----> Filter
---->(3)
IEnumPins *pEnum;
IPin *pPin;
pFilter->EnumPins(&pEnum);
pEnum->Next(1, &pPin, NULL); // pPin now contains pointer to INPUT pin (1)
pEnum->Next(1, &pPin, NULL); // pPin now contains pointer to OUTPUT pin (2)
pEnum->Next(1, &pPin, NULL); // pPin now contains pointer to OUTPUT pin (3), which is what you want
The sequence (almost) always has INPUT pins enumerated first, followed by OUTPUT pins.
Another example to show the sequence scheme is:
(1)----> ---->(3)
Filter
(2)----> ---->(4)
|
|
|
|
|
Hello, this is a great project.
But is it possible to hear only the sound of one video???
Can i change it during playtime???
|
|
|
|
|
Thank you. Yes, just disconnect the input pin to your DirectSound Audio Renderer filter.
|
|
|
|
|
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.
|
|
|
|
|