0

I have and application that uses TCP Sockets to send data over to a second app, in this case images in form of byte[], I'm already compressing the bytes, but I'm wondering if there is a way to cache the bytes and compare the new bytes changes, and only send those the difference (the new changes)?, this way I can reduce the data I send. The sending intervals is 50 milliseconds

I'm capturing Bitmaps saving the MemoryStream to format .png, then I'm compress the bytes using GZipStream before sending to TCP, but the average image bytes is 150000, and for both the sending the receiving applications it's taking a lot of memory to handle it seems.

Note: I'm not posting any of my code as this is just a question based on facts.

Any inputs or ideas are greatly appreciated.

Thanks.

AJ152
  • 671
  • 2
  • 12
  • 28
  • _" I'm not posting any of my code as this is just a question based on facts."_ - then the answer is _"Yes, that is possible"_. Are you sure you want to re-invent a video codec? – CodeCaster May 24 '14 at 11:09

1 Answers1

0

I'm already compressing the bytes, but I'm wondering if there is a way to cache the bytes and compare the new bytes changes, and only send those the difference (the new changes)?

Yes, it is called programming. As in: NOTHING in TCP will do that, but your program can do it on top.

I'm capturing Bitmaps saving the MemoryStream to format .png, then I'm compress the bytes using GZipStream before sending to TCP,

And why not using one of the video formats that are around? VIdeo compression - which deploys this approach - is not exactly a new problem. Tons of literature out there.

TomTom
  • 61,059
  • 10
  • 88
  • 148
  • Thanks @TomTom Doesn't video compression take longer to deliver the data?, I'm sharing a desktop with the second application, and that's why I thought using image formats should be faster, and delay is very small it seems in my current implementation. – AJ152 May 24 '14 at 11:29
  • Longer than transmitting tons of more information? How long is a piece of string. It depends. On how you set things up. – TomTom May 24 '14 at 11:29