[英]Streaming large amounts of data from sql server to an Excel file via c# web service
[英]Streaming jpegs via a web service
我正在从IP摄像机捕获jpeg。 我通过网络服务将其上传到服务器。 然后,我将图像渲染到画布上。 然后,用户可以通过浏览器查看动作。
我一直在使用4个IP摄像机,每个通道的分辨率为360x288。 字节数组大小通常为15kb。
切换到分辨率为720x576的单个IP摄像机,会将字节数组的有效负载增加到360x288单个摄像机的4倍。
我在这里注意到这个问题并回答:
给出答案的人建议根本不要使用字节数组。 只是流。 当前,我正在使用WCF TCP绑定,并且想知道如何在此设置中实现此流选项?
我如何将其用于连续图像(而不是单个视频文件)?
代码是什么样的? 我在输入时正在谷歌搜索,但是将大字节数组拆分为2个较小的数组并上传独立性然后在服务器上重新组合会更好吗?
我正在使用C#
我建议使用流传输方法,因为它比在服务器端重建图像文件要简单得多。
NetTcpBinding支持流的TransferMode 。 主要限制是您不能使用Message的SecurityMode 。
您可以这样配置它:
<configuration>
<system.serviceModel>
<services>
<service name="PhotoUploadService">
<endpoint name="" binding="netTcpBinding"
address="net.tcp://localhost:8000"
contract="IPhotoUploadService"
bindingConfiguration="streamedTcpBinding" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="streamedTcpBinding"
transferMode="Streamed"
maxReceivedMessageSize="2147483647"
maxBufferSize="65536" />
</netTcpBinding>
</bindings>
</system.serviceModel>
</configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.