作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
在创建 RTCVideoframe 方面需要帮助
这是RTCVideoframe的初始化方法RTCVideoFrame(缓冲区:RTCVideoFrameBuffer,旋转:RTCVideoRotation,timeStampNs:Int64)
我能够将输入缓冲区作为 CVPixelBuffer
如何将 CVpixelBuffer
转换为 RTCVideoFrameBuffer
。
谢谢,非常感谢任何帮助
最佳答案
使用我们从
收到的 cmSampleBuffer`
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))
}
} )}
`
关于swift - 使用 CVPixelBuffer 创建 RTCVideoframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50617480/
在创建 RTCVideoframe 方面需要帮助 这是RTCVideoframe的初始化方法RTCVideoFrame(缓冲区:RTCVideoFrameBuffer,旋转:RTCVideoRotat
我是一名优秀的程序员,十分优秀!