简体   繁体   English

WCF直播视频流

[英]WCF live video streaming

I'm trying to stream a live video from a capture device via WCF. 我正在尝试通过WCF从捕获设备流式传输实时视频。

I use directX.capture dll. 我使用directX.capture dll。

I've tried to capture it frame by frame and send each frame in NetTcpBinding. 我试图逐帧捕获它并在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. 当绑定传输模式为'Buffered'时,它抛出了一个异常,即数据对于要读取的xml quotat来说是大的。 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". 当传输模式为'Stream'时,我收到了流,但是当我调用Image.Save(fileName,Stream)(或其他任何试图访问流的内容)时,我得到“参数无效”的异常。 I've tried to send Bitmap or Stream, same results. 我试图发送Bitmap或Stream,结果相同。

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. 请参阅: 从流中创建字节数组,以了解如何将流转换为字节数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM