|
|
I can find it in the directory Samples/C++/DirectShow/Capture of the DS.
-daniel
|
|
|
|
|
In the path you mean, I have the following folders:
- Common
- Direct3D
- DirectInput
- DirectSound
- Misc
- XACT
- XInput
but, there's no DirectShow folder
I've done the full installation of the latest DirectX SDK (October 2005) Any idea?
|
|
|
|
|
DirectShow is now part of the Platform SDK. I'm not sure if it's a separate download or you have to update the whole Platform SDK. Search MSDN for Platform SDK.
-daniel
|
|
|
|
|
Hi,
I was reading on DirectShowLib message board that my custom a/p couldn't play mpeg files. So I went to check and I fixed a bug, here's the update code for the CustomAP InitializeDevice (that I'll include when I'll update these tutorials)
============================================
public void InitializeDevice ( uint dwUserID , ref _VMR9AllocationInfo lpAllocInfo , ref uint lpNumBuffers )
{
lock(this)
{
if( lpNumBuffers == 0 || m_san == null )
throw new Exception( "errors during Initialization" );
uint width = 1, height = 1;
while( width < lpAllocInfo.dwWidth ) width = width << 1;
while( height < lpAllocInfo.dwHeight ) height = height << 1;
float fTU = 1.0f, fTV = 1.0f;
fTU = (float)(lpAllocInfo.dwWidth) / (float)(width);
fTV = (float)(lpAllocInfo.dwHeight) / (float)(height);
m_scene.SetSrcRect( fTU, fTV );
lpAllocInfo.dwWidth = width;
lpAllocInfo.dwHeight = height;
// VMR9AllocFlag_TextureSurface = 0x0004
lpAllocInfo.dwFlags |= 0x0004;
DeleteSurfaces();
// allocate memory for our surface pointers
IntPtr buffer = Marshal.AllocCoTaskMem( Marshal.SizeOf( typeof( IntPtr )) * (int)lpNumBuffers );
// ask the renderer to create these surfaces
m_san.AllocateSurfaceHelper( ref lpAllocInfo, ref lpNumBuffers, buffer );
// retrieve the pointers and stuff them in our array
surfaces = new IntPtr[lpNumBuffers];
for( int i = 0; i < lpNumBuffers; i++ )
{
// following only work on 32 bit machines
surfaces[i] = Marshal.ReadIntPtr(buffer , i*4);
}
Marshal.FreeCoTaskMem( buffer );
m_scene.Init( device );
}
}
-- modified at 14:14 Monday 12th December, 2005
|
|
|
|
|
Hi there,
any way how to get single frames from a camera (in a windows ce 5.0 pda) and save them into memory? I need to do real time face recognition and thus am looking for a way to get single frames. I think it might be done via the imaging API, but I have no idea how to do that in c# and how to figure out the framerate (which in generell is not constant). Thanx for help, Andy O.
|
|
|
|
|
Hi,
You can look at the capture tutorial (ie Tutorial 3) and modify it to change the call to the RenderStream method with the 4th argument (ie second to last) referring to an instance of the SampleGrabber filter (for e.g. as used in Tutorial 7).
Then the SampleGrabber callback returns a pointer that can be used like in the following code, to create a bitmap object
// create a bitmap object; 40 is the size of the header on a 32-bit machine
// bufPtr is the pointer returned in your callback
Bitmap b = new Bitmap( width, height, width*3, PixelFormat.Format24bppRbg, new IntPtr( (int)bufPtr + 40 ));
// if needed, change the bitmap orientation
b.RotateFlip( RotateFlipType.Rotate180FlipX );
-daniel
|
|
|
|
|
Hi,
thanx for thy reply. I wanted to write the project in C++ which I am quite familiar with, but as it seems way easier in c#, I decided to give c# a shot. Hence, I tried to change the tutorial into a Smart Device project. Was no big deal, but the GUIDs don't work at all and thus I get an error message and the program quits. As I am a newbie to c# I got one further question: How can I - especially for Smart Devices - figure out those GUIDs?
I admit I would prefer C++ - you don't happen to have written a tutorial for DirectShow and C++? I promise, this will have been my last question.
Best wishes,
gilgamash
-- modified at 3:08 Friday 9th December, 2005
|
|
|
|
|
I'm not that familiar with Windows CE but, as with the X86 platform, you have to "fish" for them in the .h and .idl files of the DirectShow and DirectX sdk.
-daniel
|
|
|
|
|
You can't use the iSmapleGrabber interface in CE unless you write your own version. It's simply not supported. There are two ways that you might be able to get access to the data on the screen. One is to take repeated screen shots of your phone, this is the simpler option but can have a performance overhead. The second is a bit more complex and involves you writing your own transform filter to plug in to the renderstream method call for the preview. You can then use this transform filter to access the raw data, create a bitmap if need be, anything basically. I'm not sure what performance would be like in C# as i ended up using C++ for mine. Hope this helps
Suggs
|
|
|
|
|
Is it possible to use a seperate IMediaControl for each of the movies in the PIP tutorial so that, for example, you could pause the smaller video at a chosen point?
Also, is it possible to load and play a second video on top of an already-playing larger video i.e. at any given time during the first video's playback?
thanks for your help, the tutorials are excellent!
kind regards
J Clark
|
|
|
|
|
Hi,
AFAIK the changes that you want require writing a custom allocator/presenter and use it in a multi graphs setting.
You would have to modify the custom A/P in Tutorial 9 (or use the A/P sample in DirectShowLib v1.1) and extend it as illustrated in the MultiVMR9 sample of the SDK. This sample is rather big (compare to other SDK samples). But I don't see why it couldn't be implemented in C#.
-daniel
|
|
|
|
|
I'm also looking for such an solution.. Did you made any breakthroughs?
|
|
|
|
|
I found a good example in the DirectShowLib Forums, which is quite useful.
http://members.home.nl/jcr83/myMultiVMR9.zip
http://directshownet.sourceforge.net/index.html
-- modified at 2:19 Tuesday 6th December, 2005
|
|
|
|
|
Hi
First of all I must appreciate the superb job done by you! Its a boon for naive programmers like us. Ok Here's my problem... I just wanted to know how can I modify your pip sample so that it is able to update Overlayed bitmap even when Video is paused state? Another thing I would like to do is Update overlayed bitmap in running video, How can I do that? I mean if bmp1 is being currently shown on video, user presses button which causes bmp1 to be swapped with bmp2. Please forgive me If i am not able to explain properly because
I am still The illiterate in DShow
Regds
The Illiterate
-- modified at 8:15 Monday 14th November, 2005
|
|
|
|
|
Hi,
If you've appreciated this submission, I hope that you've given it a 5 * for its evaluation .
For your first question, the short answer: it's not possible. When the graph is paused, you can't change the display. The longer answer, you can fudge it using IMediaSeeking and/or IVideoFrameStep. Remember the current position, stop the graph, change the bitmap and move one frame forward. (There might be other solutions but this the first one that comes to my mind).
For the second question, probably the easiest way is to
set three streams (one vid, two bitmaps). Set the same rectangle position for both bitmaps and modify the alpha level in a button handler (flip the values from 1.0 to 0.0 and 0.0 to 1.0, for example).
-daniel
|
|
|
|
|
Hi Daniel
You already got those 5* from me
Daniel could ou guide me rougly on what I have to do for Overlaying a revolving Cube onto a Video. Not only cube it could be just any polygon.
Although your tutorials have a sample where 3 videos are being rendered onto
a cube. What I would like is opposite. Overlaying revolving Polygon onto single video. Got any ideas? It could become another capter in your tutorials though
Regds
The Illiterate
______________________________________________________________________________
When will I become Literate?
|
|
|
|
|
Hi,
Look at the custom allocator/presenter sample. In particular, the IVMR9ImagePresenter PresentImage method. This method hands you a surface which contains the video frame. You can do whatever you want with this surface, including displaying a cube, polygon or any meshes in from of it, for example.
The main limitation of this approach is the frame rate of the video controls the animation, which is not always desirable.
-daniel
-- modified at 18:27 Thursday 17th November, 2005
|
|
|
|
|
Hi,
I am looking for to do this :
I connect to my input card a video splitter wich have 4 pictures.
For each picture, I would like to have one control panel.
For each control panel, I want to have a special functionality like click and double click mouse.
The control panel must to be transparent color with a color border.
Best Regards,
youssef
|
|
|
|
|
You'd get better results by asking in the newsgroup: microsoft.public.win32.programmer.directx.video since this is not specific to this article.
-daniel
|
|
|
|
|
I'm looking to do a textual overlay in Windows Mobile 5.0 for smartphone which doesn't supprot the IVMR interface. I'm trying to do a textual overlay on the preview function of my phone's camera. Could anyone help at all?
Thanks
Mike
|
|
|
|
|
Hi,
I am also looking for the same solution.
Did you manage to get text on top of running video?
I used IVMR9Render interface on Desktop but I want solution to work on Windows Mobile 6.
I am trying to overlay text and image on top of video.
my platform is Windows Mobile 6.
Can anybody help me regarding this?
How can I achieve this?
|
|
|
|
|
The help file does not seem to work. It only shows blank pages.
Sample 3, maybe all samples, cannot be directly opened and compiled in visual studio. The example is doesn't include a solution file and the project is missing a resx file, so the form cannot be viewed.
|
|
|
|
|
Hi,
You're the second person that have reported a similar problem. I've suggested to download the .chm file once again. The tutorials are just one big Html Help file.
When you click a link for a zip file in one of the tutorials, like the sample 3, you can save and unzip the files needed to run the sample. I've just unziped the Tutorial 3, and I don't provide a solution (.sln) file but a project (.csprj) file. So I double-cliked the project file and VS was able to build and run the sample without a hitch. If this doesn't work, you can try the batch file (.cmd) from a command line (where the location of the C# compiler is accesible from the path); you should also be able to build the sample this way.
Hope this helps,
-daniel
|
|
|
|
|
Daniel,
I'm having the same problem. Tried re-downloading...no luck. I can view the table of contents of the .chm file, but not the content itself. Would you mind posting in .pdf format or the equivalent?
Thanks very much!
David
|
|
|
|