Hi All,
I've created an application that uses a custom allocator-presenter that I created based on the VMR9Allocator example found on the DirectX SDK (well, now it's on the Platform SDK). I've managed to uderstand most of what I've "implemented" and I now have almost everything I need, except for one thing.
I need to be able to play more than one video at the same time and to control them independently. To do this I know that I need to have multiple Filter Graphs rendering the videos on private textures and then have the Allocator-Presenter show them on screen (this I know, but I don't fully understand how).
The SDK has a multiple filter graph example called MultiVRM9, but it's way too much for what I need, it's massive distance from the VMR9Allocator example and I can't really understand what's going on.
The only thing I need is to be able to adapt the VMR9Allocator example so that it's able to play multiple filter graphs independently.
Can anyone tell me what I need to implement and/or change from this example to be able to do this Any help will be more than appreciated, even just an outline of what I have to do.
Thank you all in advance,
Dani.
I've created an application that uses a custom allocator-presenter that I created based on the VMR9Allocator example found on the DirectX SDK (well, now it's on the Platform SDK). I've managed to uderstand most of what I've "implemented" and I now have almost everything I need, except for one thing.
I need to be able to play more than one video at the same time and to control them independently. To do this I know that I need to have multiple Filter Graphs rendering the videos on private textures and then have the Allocator-Presenter show them on screen (this I know, but I don't fully understand how).
The SDK has a multiple filter graph example called MultiVRM9, but it's way too much for what I need, it's massive distance from the VMR9Allocator example and I can't really understand what's going on.
The only thing I need is to be able to adapt the VMR9Allocator example so that it's able to play multiple filter graphs independently.
Can anyone tell me what I need to implement and/or change from this example to be able to do this Any help will be more than appreciated, even just an outline of what I have to do.
Thank you all in advance,
Dani.

Multiple Filter Graphs with DirectShow
JuanManuelC
For this you need to use some kind of text overlay DirectShow filter, such as:
http://www.medialooks.com/products/directshow_filters/text_n_graphics_overlay.html
http://www.montivision.com/support/documentation/noframes/source/filter/text_overlay_filter.htm
Fagutish
Hi Paul,
Thanks for your reply.
I'm not able to download the full SDK (it breaks in the middle) but I've been able to download the VideoFilter sample only and it looks more than interesting.
As I don't have the full SDK I can't recompile the NVidia libs so, how can I short out the d3d sdk version check
I have a Matrox Parhelia 256 and the VideoFilter program executes correctly but the 2 videos play very very slow... I think this might be solved if I'm able to change the code to load regular AVIs.
Thanks for your help and thanks to Etienne as well for your help,
Dani.
Herwin Grauel
Hi Proussin and Etienne,
I've checked both examples you said but I'm still stuck.
Etienne: your example is fine but it's too much like the VMR9Allocator example I'm trying to change. It plays only on FilterGraph and there's where I'm stuck :(
Proussin: I have to admit that the VideoFilter example is awsome... so good that I spent too much time looking at the features it implements more than the actual implementation of what I really need... multiple Filter Graphs. The whole application is too messy for me to "extract" what I don't need from that code and keep only what I need to have the multiple videos running on my window.
I'm stuck at this point again... except with a little less time :) Any help is more than appreciated.
Thanks,
Dani.
Goodway
Shorting out the sdk version check.
The check is in Allocator.cpp at line 35
if( m_D3D == NULL ){
ASSERT( d3dd == NULL );
m_D3D.Attach( Direct3DCreate9(D3D_SDK_VERSION) );
if (m_D3D == NULL) {
hr = E_FAIL;
return;
}
}
Using a debugger I changed "D3D_SDK_VERSION" the executable to match the value checked against in this call. You would have to know where the check is in your executable and use a hex editor to change it.
Looking at the lib list in the linker inputs shows only strmbase(d).lib so it may be that I had to recomplie the Directshow base libs; I think I had to do both
My sample runs very smooth on a 6800GT sith a 3 GHz Intel single P4 MB at 38 FPS in an 800xso it does take a lot of horsepower.
I do not know if it switches to vertex software processing or uses the ref device which would certainly kill the performance to like about 5 seconds per frame (kidding somewhat). I think the debug spew would tell you which device it is using. You can also switch off the ref device from the control panel so that if your app fails to run you would know it can't use the GPU. I am not familiar with the details of your card. The sample uses 2.0 shaders.
Regards,
Paul
forummember
This link may help you :
http://www.codeproject.com/audio/vmr9.asp df=100
I don't know how they send it to the windows but it must be with the handle of the window
VMR9 must have a way to set a m_hWnd to it so he know where to send data
(When you render in DX you can create swap chain that use the m_hWnd
of any windows you want...)
So probably the VMR9 send it to some hWnd
You can create 2 windows, get their hWnd in some global variable
and set that hWnd to the render VMR9 you want
For the Render on Texture you need to create a Texture with the Flag
RENDER_TARGET
using D3DXCreateTexture8()
then you get the surface of that texture (another pointer of type Surface)
pTexture->GetLevel(0,pSurface) and then
you use pDevice->SetRenderTarget(pSurface);
You then call pDevice->Begin() you draw or send the output of the VMR9
then you call pDevice->End() and you have a texture with your video ouput
You need to render that texture on a face as any other 3D object...
Hope this could help
PLCweaver
I wanna know how to build an application using a single video and adding a close caption to it.
I want to develop and application like Banks have to manage their quotes, you get a ticket with an ID. And after a while in a TV you can see your Ticket ID, but at the same time in the same tv are showing a video.
Sorry if my english is not good
Sedigh
Take a look at NVidia's "VideoFilter" sample. It loads two videos and displays three pictures while allowing you to select various HLSL Shaders to filter to displays. They use DirectShow and may be just what you are looking for. It plays very well.
What is neat is the sample shows how to use the video card's GPU as a directshow filter. Perhaps it is overkill as you mention but it works so well that I would take a serious look at it.
The sample I compiled is in their 9.5 SDK. You may have to short out the d3d sdk version check to get it to run and it does run when you do. However you can recompile all of the NVidia libs and thus fix the problem the preferred way:)
Paul
licheca
Maybe this site can help you :
http://www.gdcl.co.uk/articles/