Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 如何将CMSampleBuffer转换为原始帧(例如UYVY)?_Swift_Video Streaming_Foundation - Fatal编程技术网

Swift 如何将CMSampleBuffer转换为原始帧(例如UYVY)?

Swift 如何将CMSampleBuffer转换为原始帧(例如UYVY)?,swift,video-streaming,foundation,Swift,Video Streaming,Foundation,因此,我正在接收一个视频CMSampleBuffer-s流,我想通过NDI(网络设备接口)将其推送,所以我需要将其转换为一些常见格式。(如UYVY) 我该怎么做?你这么说是什么意思:视频流CMSampleBuffer-s?你能分享你的流的例子吗?@vpoltave我希望我能回答你的问题。我对这一切都很陌生。 class SampleHandler: RPBroadcastSampleHandler { override func processSampleBuffer(_ sampleB

因此,我正在接收一个视频CMSampleBuffer-s流,我想通过NDI(网络设备接口)将其推送,所以我需要将其转换为一些常见格式。(如UYVY)


我该怎么做?

你这么说是什么意思:视频流CMSampleBuffer-s?你能分享你的流的例子吗?@vpoltave我希望我能回答你的问题。我对这一切都很陌生。
class SampleHandler: RPBroadcastSampleHandler {
    override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
        switch sampleBufferType {
        case RPSampleBufferType.video:
          var imageBuffer: CVImageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)!
          // now I need to get a reference to a framebuffer (of type uint8_t*) in UYVY format