Manish Pathak
Manish Pathak

Reputation: 3304

How I can record and save RTCVideoTrack locally in appRTC iOS?

I am using replay kit to record the screen, what I want to achieve is recording or capturing the screen with Audio while I am doing a call using webRTC SDK. I have used appRTC from github.

I think I can achieve this by AVCaptureSession! as I want to exclude replayKit There is no relevant code to provide.

Upvotes: 1

Views: 3275

Answers (1)

Tim Bull
Tim Bull

Reputation: 2505

This is challenging, but it can be done. I can't provide the detailed answers on this because it's pretty core to our app and what we're building and it's A LOT of code, but hopefully it helps to know it can be done.

A couple of pointers for you:

  1. Take a look at http://cocoadocs.org/docsets/GoogleWebRTC/1.1.20266/Classes/RTCCameraVideoCapturer.html This will let you access the AVCaptureSession that WebRTC is using, you can successfully hook up your AVAssetWriter to this.
  2. Look into the RTCVideoRenderer protocol reference. http://cocoadocs.org/docsets/Quickblox-WebRTC/2.2/Protocols/RTCVideoRenderer.html It will enable you to take the frames as WebRTC renders them and process them before sending passing them back to WebRTC. You'll need to convert the RTCI420Frame you receive to a CVPixelBufferRef (which is a YUV420 to RGB conversion).

Upvotes: 1

Related Questions