Search code examples
c#wcfvideostreamlive

WCF live video streaming


I'm trying to stream a live video from a capture device via WCF.

I use directX.capture dll.

I've tried to capture it frame by frame and send each frame in NetTcpBinding. when the binding transfer mode was on 'Buffered', it threw an exception that the data is to large for the xml quotat to read. and when the transfer mode was 'Stream' I received the stream, but when i called Image.Save(fileName,Stream) (or anything else that try to access the stream) i get an exception of "parameter is not valid". I've tried to send Bitmap or Stream, same results.


Solution

  • You cannot save a stream directly. But you can convert a stream to a byte array, and then save the byte array.

    See : Creating a byte array from a stream for how to convert a stream to a byte array.