Chunk png compression
PNG is the bottleneck for performance. Using a single thread and depending on the nature of the depth map, it can take more than 1/25th of a second to compress even on the fastest setting (at 720p). Therefore, it is necessary to attempt two things: 1) chunk the image and distribute compression across multiple threads, and 2) for some chunks send only a delta and rotate the delta/original chunk choice between frames.
Note: these chunks are then also suitable for UDP transmission if sufficiently small. Note: the receiver needs to cleverly patch its rgb+depth data, discarding old chunks. The result might be that some regions of the image contain an old frame. Another option is to block the grab until all chunks have be received for the current frame.