gpt4 book ai didi

iphone - 将 sampleBuffer 保存在数组中(AVFoundation)

转载 作者:搜寻专家 更新时间:2023-10-30 19:56:45 24 4
gpt4 key购买 nike

我尝试将示例缓冲区而不是 UIImage 保存到数组中,以便稍后转换它。这样可以加快图像捕获速度,并且可能不会收到内存警告。我只是不知道如何将它保存到数组,然后再次使用它来调用 [self imageFromSampleBuffer:sampleBuffer]。我试过类似的方法,但如何将数据转换回 CMSampleBufferRef 对象?

- (void)captureOutput:(AVCaptureOutput *)captureOutput 
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection {
// Create a UIImage from the sample buffer data
// UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
// [arrCaptures addObject:image];

[arrImageBuffer addObject:[NSData dataWithBytes:sampleBuffer length:sizeof(sampleBuffer)] ];}

最佳答案

为什么不直接使用 CFArray 并直接将 CMSampleBufferRef 对象放在那里?

关于iphone - 将 sampleBuffer 保存在数组中(AVFoundation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7674892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com