0

I am trying to access video frames.I have registered LocalCameraFrameListener but the function - (void)onLocalCameraFrame:(VCLocalCamera *)localCamera VideoFrame:(VCVideoFrame *)videoFrame is not getting called.

I am using the code given in the getting started "Access Raw Frames".

Thanks in advance

somnath121
  • 21
  • 4

1 Answers1

0

I found how to get videoFrame: 1) Your viewController should be like:

class StreamController: UIViewController, VCConnectorIConnect, VCConnectorIRegisterLocalCameraEventListener,  VCConnectorIRegisterLocalCameraFrameListener {
    ...
}

2) Then you should register cameraframelistener in func onLocalCameraSelected:

func onLocalCameraSelected(_ localCamera: VCLocalCamera!) {
    self.connector?.registerLocalCameraFrameListener(self, localCamera: localCamera, width: UInt32(width), height: UInt32(height), frameInterval: 0)
}

3) So in onLocalCameraFrame func you will get videoFrame:

func onLocalCameraFrame(_ localCamera: VCLocalCamera!, videoFrame: VCVideoFrame!) {
   print(videoFrame)
}

But my problem is that I couldn't get Image from this videoFrame. If you will find how to get UIImage or base64encoded image, please let me know.