Avi Thalker
Avi Thalker

Reputation: 59

How to compress JPEG bytes array

I am working on C# app that need to send video stream from webcam from server to client. I am capturing the frames with directshow, save them into a MemoryStream in JPEG format with the bitmap.save method. Now before I am sending the frame to the client I want to compress the data, to zip it, and in the client side unzip it. Tried to use gzip but it seems like the compresstion does't help at all.

Any suggestion for an appropriate compress algoritem? Or the JPEG format is kind of compresstion that is enough?

Upvotes: 0

Views: 1101

Answers (1)

TypeIA
TypeIA

Reputation: 17258

JPEG data is already compressed. Further attempts to compress it with other algorithms like gzip will usually not make it any smaller. So just transmit the JPEG contents directly.

Upvotes: 2

Related Questions