views:

26

answers:

4

Hi there

I've succeeded to capture live video stream from my camera with directshow.

But how can I share the stream to another process, any ideas?

RGS!

UPDATE

Can illustrate with some code samples?

A: 

through a file?

rogerdpack
Hard to make it live that way..
A: 

Just from an information-flow point of view, it seems you've got 2 primary options:

  1. An app broadcasts the stream to multiple clients.
  2. Each app forms a link in a chain and the stream is read and passed on.

option 1 is more complex to write but more robust - You'd effectively write a video server, option 2 is easy to implement but if one link in the chain crashes, all the clients after that would lose video.

Unfortunately, I don't know enough about the Directshow format to give you an example but at its most fundamental, you need to be reading and re-transmitting the stream.

Inter-process communication can be done a number of ways but it will depend on the programming language you're using - If .Net, I'd suggest WCF. Something a little lower-level would simply be communicating via a loopback TCP/IP connection.

I'd avoid using the hard disk to transfer the data as you'll a) lose considerable performance and b) thrash the hard disk to no advantage

Basiclife
A: 

You can capture the stream to several shared memory regions. This way you can see the contents of this memory in other processes too.

You have to implement some kind of interprocess communication, so that your other process get notified which buffer should be displayed.

This should be relatively easy when you write your own sample grabber, maybe even with an own memory allocator. That way you wouldn't even suffer from one less copy. Maybe Boost.Interprocess would help you implementing this system, otherwise see the memory mapping functions in win32.

Christopher
A: 

Use VLC to stream it over HTTP.

rogerdpack