Need help in creating RTCVideoframe
This is the init method for RTCVideoframe
RTCVideoFrame(buffer: RTCVideoFrameBuffer, rotation: RTCVideoRotation, timeStampNs: Int64)
I am able to get input buffer as CVPixelBuffer
How can I convert CVpixelBuffer to RTCVideoFrameBuffer.
Thanks and any help is much appreciated
Using cmSampleBuffer we received from
`
sharedRecorder.startCapture(handler: { (cmSampleBuffer, rpSampleType, error) in
switch rpSampleType {
case RPSampleBufferType.video:
{
let pixelBuffer = CMSampleBufferGetImageBuffer(cmSampleBuffer)!
let rtcpixelBuffer = RTCCVPixelBuffer(pixelBuffer: pixelBuffer)
videoFrame = RTCVideoFrame(buffer: rtcpixelBuffer, rotation: RTCVideoRotation._0, timeStampNs: Int64(timestamp))
}
} )}
`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With