I am developing an app that has a Live Streaming of screen feature using OpenTok API. I have to do memory management on sending the buffers to OpenTok servers since they do not accept original buffers from SampleHandler. Therefore, I need to find a way to compress the CVPixelBufferRefs that I receive from processSampleBuffer but I am getting MEMORY (limit = 50 MB, unused = 0x0) errors all the time even though I used their official git repo, it crashes because of the memory limit. I have been searching about resizing and scaling pixelBuffers but it costs a lot on CPU - GPU usage with CIContext and eventually broadcast extension ends up to memory limit crash again. Lastly, I saw that Telegram has a screen share feature(It works perfectly fine on iPad and iPhone with high resolution) and I looked it up but It is way out of my field because I am not familiar with the kernel level adjustment on pixelBuffer using CoreMedia.
- My question is Do you guys have a robust solution for sending pixel buffers to servers from Sample Handler without exceeding the memory limit?