|
Hello,
Can anybody tell me how can send the video input from the webcam to another computer through a TCP/IP connection, and stream the video output there real time?
Thanks
|
|
|
|
|
If you can live with Windows Media files (i.e. wma, wmv and asf), you should look into the the Windows Media Encoder SDK from MS. I recall that some of its samples are very close to what you want.
-daniel
|
|
|
|
|
I have tried Broadcasting a Live Stream Using the Predefined UI they had on msdn website, but it's really slow, and the client sees the video with at least 10 seconds delay. How else can I create a direct connection which will be fast and simple.
Thanks.
|
|
|
|
|
It's not your lucky day. If you've done your (maths) homework, for example, I recall that someone was trying to stuff 8 webcam feeds into a USB1 port and wonder why it was so slow (and you can check viewing the video on the local machine to see if the problem is related to the network). Then there is no easy solution to low latency.
The standard reply is "Google search win32.programmer.directx.video" for low latency. But AFAIK no one has found a silver bullet.
-daniel
|
|
|
|
|
Has anyone got the code for this that they could send me. I just want a program that takes webcam images and sends them to remote client either using internet site or preferably tcp/ip. Images can be received in windows media player (or similar) or own app.
mail me at bignev72@hotmail.com
|
|
|
|
|
Could you send me the link to the Live Stream with the Predefined UI on msdn. For my application, latency is not a problem. Meanwhile, is there ANY way to feed the data to the direct show application through a byte []? Perhaps, something that is similar to the framework used in:
http://www.codeproject.com/cs/media/cswavplay.asp?df=100&forumid=13779&exp=0&fr=26&select=736865
|
|
|
|
|
|
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
|
|
|
|