0

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?
Mehmet Baykar
  • 367
  • 3
  • 11
  • We dont have a "robust" solution but we usually recommend folks to try changing the resolution/fps settings on their publishers to try manage memory usage. Ill reach out to engineering to get the sample updated. – abdulajet Aug 25 '21 at 08:48
  • @abdulajet Thank you very much for your quick response. The problem is not just the sample code. Other platforms (like Twilio, Agora) process the sampleBuffers themselves without extra compression by the developer. It would be great if OpenTok could update its framework and adjust buffers in the framework instead of wasting time on CoreImage-CoreVideo by the developer. – Mehmet Baykar Aug 25 '21 at 10:41

0 Answers0