【问题标题】:Core Image getting sample buffer from video on disk?Core Image 从磁盘上的视频中获取样本缓冲区?
【发布时间】:2014-03-31 11:01:17
【问题描述】:

所以在录制直播视频的时候,可以使用一个AVCaptureSession,通过委托方法过滤直播视频:

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection

使用它,您可以从缓冲区中获取 CIImage,稍后您可以将图像过滤器应用到:

CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
CIImage *sourceImage = [CIImage imageWithCVPixelBuffer:(CVPixelBufferRef)imageBuffer options:nil];

我的问题是,如何过滤磁盘中的视频?由于我没有那种委托方法自动给我输出缓冲区的奢侈,我必须手动完成。

我需要的是一种从磁盘上的视频中逐帧获取并对其应用核心图像过滤器的方法。

【问题讨论】:

    标签: ios core-image


    【解决方案1】:

    试试看这个AVCaptureSession_Class

    有很多样本,对我来说"SquareCam""StopNGo for iOS" 就够了。

    它会在内存中逐帧为您提供,而不是在磁盘上。如果你需要它 - 你可以自己做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-16
      • 1970-01-01
      • 2016-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多