views:

41

answers:

2

Hi all, I am capturing video from my webcam and it is processed by a C# program then i want to stream it to a C++ program. this C++ program can be configured to get a video stream from a webcam so is it possible to send/stream my processed video to this program where the C++ program detect that stream as a video which is coming from the webcam.

Thanks !

EDIT : My C# program access the webcam and do some processing. on the other side i have CCV which accepts either input from a webcam or a video file. so i want to send(stream) my processed video to CCV.

+1  A: 

You seem to be looking for how to do Interprocess Communication on Windows.

Code Project also has a great article about it.

karlphillip
Why Interprocess?
SaeedAlg
@Kenshan Ideally, you should have only one program to grab the frames from the camera, process them and do whatever else you might find necessary. Breaking your solution into 2 applications will bring some overhead you might not want at your final solution. By the way, have you heard of OpenCV?
karlphillip
@SaeedAlg Why not?
karlphillip
If you are going to vote down you should add a note explaining why.
karlphillip
@karlphillip : yes, i am using CCV which uses OpenCV for image processing and i am agree with you but the problem is i don't have much time to hack into CCV code base and write a patch for my needs and i found out i can do that processing part with C# easily (but i am really really new to C#) so, i write the processing part with C#
Keshan
@karlphillip, I can't understand when u can use interoperability you suggest Interprocess? you can simply write a com object in c++ and refrence it in C# so you can use both language benefits, Capturing from web cam and doing process and connecting to other application does not need 2 different application. if you are not familiar with c++ its not good to do this suggestion.
SaeedAlg
@Keshan I still think you should seriously consider the *standalone* solution since both IPC and interoperability approaches requires more work. This link contains a complete C program (that uses OpenCV) that reads frames from the camera and defines a function to be executed on every frame. It does grayscale conversion of the frames and displays them on a window: http://stackoverflow.com/questions/3907028/opencv-every-frame-processing/3919216#3919216
karlphillip
Thank you very much karl however i overcame my problem. appreciate your help.. :)
Keshan
A: 

I think you want interoperability, You can use com objects for interop, also there are some tools to work and process with video, the best one is DirectShow and you can see the set of toturial in c# in this article. Its base is on C++, see this.

SaeedAlg
As mentioned by the 1st link pointed on my answer, COM is only one of the IPC mechanisms supported by Windows.
karlphillip
@karliphillip, COM is one of way of IPC, Also its a interop, its RPC and too many other abbrivations, but in this problem when u work with huge amount of data, the IPC is a wrong way.
SaeedAlg
@SaeedAlg IPC through sockets is a valid approach for the bandwidth required by modern webcams.
karlphillip
if you prefer to use distinct projects and make a connection with them via socket when you can use one running application to this, i didn't prefer your solution, the COM you saying is IPC is a OLE Server you can see its usage in office, ... you trying to add another problem to the current problem when you can use a simple approach,do you like CASP?
SaeedAlg