图像传输不稳定
我现在尝试将相机捕获的图像从我的地方发送到另一个远程城市的另一台服务器。 远程城市的服务器会将收到的图像发回,我将在本地显示图像。 我正在使用 python tcp 套接字。我显示两个相机捕获的图像。一种通过局域网,一种通过远程服务器。本地的效果很好。问题是从远程位置获取的图像有时显示速度非常慢,然后突然变得更快并且与本地图像具有相同的速度。 我测量了性能,每秒可以捕获30张图像,并且在本地可以每秒发送30张图像,但是当经过远程部分时,有时会发送20张图像,有时会发送40张......有时会发送40张图像。 30. 有人知道原因吗?
I am now trying to send camera captured images from my place to another server at another remote city.
And the the server at remote city will send the received images back and I will display the images locally.
I am using python tcp socket. I display two camera captured images. One go through local area network, one go through the remote server. The local one works fine. The problem is the image get from the remote place some times displayed very slow and then suddenly gets faster and have the same speed with the local images.
I measured the performance, I can capture 30 images persecond, and it is able to sends 30 images/s in local area, but when go through the remote part, sometime it sends 20 images, some time 40.... and some time 30.
Anyone knows the reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您正在传输实时视频,我想您可以承受丢失一两帧的损失。如果是,那么我建议您尝试使用UDP协议传输视频帧。 TCP 确实保证了传输,但有时会以更长的数据传输时间为代价。
以下是有关可用于从相机传输实时图像的协议的一些信息
Since you are transferring live video I suppose you can afford to loose a frame or two. If yes, then I suggest you try transferring video frames using UDP protocol. TCP indeed guarantees delivery but sometimes at a cost of longer times for data delivery.
Here's some info about protocols that can be used to transfer live images from camera