简体   繁体   English

接收图像时缺少UDP数据包

[英]UDP packets missing while receiving images

I am using UDP protocol to transfer images between monitor and device.I splitted the images into bytes and sending. 我正在使用UDP协议在显示器和设备之间传输图像,我将图像分成字节并发送。 In device side bytes received with loss.Some UDP packets gets lost. 在设备端接收到的字节丢失,有些UDP数据包丢失。 So when rearranging the image, it becomes blur and some times mixed up. 因此,在重新排列图像时,图像会变得模糊并且有时会混淆。

My question is, 我的问题是

While rearranging the bytes how to fill the image with empty bytes. 在重新排列字节时,如何用空字节填充图像。 (Fill the missed bytes with empty packets).So that the missing sequences are shown as white space. (用空数据包填充丢失的字节)。这样,丢失的序列显示为空白。

How to do that.?? 怎么做。??

Which image format are you sending? 您要发送哪种图像格式? I suspect that in a compressed image there is no way to know how many pixels were lost. 我怀疑在压缩的图像中无法知道丢失了多少像素。

What you could do instead is to dissect the image and compress those tiles and send the compressed tiles. 相反,您可以做的是解剖图像并压缩这些图块并发送压缩后的图块。 That way when you rebuild the image you know exactly which tiles are missing eg think google maps. 这样,当您重建图像时,您可以确切知道缺少哪些图块,例如,考虑使用Google地图。

Just use TCP. 只需使用TCP。 If you need 100% correct reception, in order and intact, it's not a candidate application for UDP. 如果您需要100%正确且完整的接收,则它不是UDP的候选应用程序。

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

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