0

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?

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
Avi Thalker
  • 49
  • 3
  • 14
  • You might save more band width by compressing a couple of frames into one package as frames will be quite similar (that is what video codecs use) jpeg is already compressed. – Emond Mar 15 '14 at 17:56
  • Don't go reinvent a video codec: use a video codec. – CodeCaster Mar 15 '14 at 18:00
  • @CodeCaster - of course but if we all used software that already exists there would be no need for SO at all. – Emond Mar 15 '14 at 18:02
  • 1
    @Erno it's not trivial to implement that yourself and obviously OP has no clue about video and compression. Hence my advice: pick something off the shelf instead of rolling your own. – CodeCaster Mar 15 '14 at 18:05

1 Answers1

2

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.

Community
  • 1
  • 1
TypeIA
  • 16,916
  • 1
  • 38
  • 52