1

I am using Replay Kit 2 (Broadcast Upload Extension) for screen sharing in my application.

It works fine on iPhone but error comes after few seconds as it crosses memory limit 50 MB when i run it on iPAD.

The issue is because of resolution which is high for iPAD. Also i have to use vp8 due to server side limitation so can't use H264.

I have tried minimizing resolution for CMSampleBuffer before sending it to server but memory still increases with same pace and stops.

   func didCapture(_ sampleBuffer: CMSampleBuffer){

   if CMSampleBufferGetNumSamples(sampleBuffer) != 1 || 
   !CMSampleBufferIsValid(sampleBuffer) || 
      !CMSampleBufferDataIsReady(sampleBuffer) {
        return
     }

    let rtcPixelBuffer = RTCCVPixelBuffer(pixelBuffer: pixelBuffer)
    rtcPixelBuffer.toI420()

  //  let value = rtcPixelBuffer.cropAndScale(to: CVPixelBuffer, withTempBuffer: <#T##UnsafeMutablePointer<UInt8>#>)

    let timeStampNs = Int64(CMTimeGetSeconds(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) * Double(NSEC_PER_SEC))
    let videoFrame = RTCVideoFrame(buffer: rtcPixelBuffer , rotation: ._0, timeStampNs: timeStampNs)

    delegate?.capturer(self, didCapture: videoFrame)

}

  • Hey, I am working on Broadcast Upload Extension. Can you provide your iPhone Demo? I faced one issue "Live Broadcast to Portal stopped due to: (null)" – Parth Patel Aug 19 '19 at 11:07
  • Hi @utkarsh, i'm facing the same error, have you managed to resolve the "due to: (null) issue"? – sharon Oct 31 '19 at 13:52

0 Answers0