1

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Manish Pathak
  • 3,224
  • 1
  • 18
  • 22

1 Answers1

1

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).
p10ben
  • 425
  • 1
  • 6
  • 17
Tim Bull
  • 2,375
  • 21
  • 25
  • Tim Bull - Thanks for the response what I will do is look into it try to implement the same and get back to this thread with results. Thanks – Manish Pathak Nov 01 '16 at 06:49
  • One more thing the frame which I will get is of local feed or remote feed ? – Manish Pathak Nov 01 '16 at 07:30
  • In our case we're grabbing the local feed, but you can probably intercept the remote one too if you like. – Tim Bull Nov 01 '16 at 15:52
  • I was able to record and save the file but here is the thing When I flip the camera the final output recorded video doesn't capture the rear camera it only shows the recording of front camera. IInd - I also want to record the audio with video So can you please help me on this further. – Manish Pathak Nov 04 '16 at 13:59
  • https://groups.google.com/forum/#!topic/discuss-webrtc/TZ23ei0P7pU I am thinking this above link can help me ? – Manish Pathak Nov 04 '16 at 14:08
  • Okay If you could help me on this ? Where can I initialize externalVideoBufferDelegate ? I want to send my buffer to RTC , see this below link https://groups.google.com/forum/#!topic/discuss-webrtc/TZ23ei0P7pU Thanks – Manish Pathak Nov 10 '16 at 13:26