Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.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
Ios 如何在视图控制器上显示经过处理的视频数据?_Ios_Objective C_Uiimageview_Uiimage - Fatal编程技术网

Ios 如何在视图控制器上显示经过处理的视频数据?

Ios 如何在视图控制器上显示经过处理的视频数据?,ios,objective-c,uiimageview,uiimage,Ios,Objective C,Uiimageview,Uiimage,我正在使用AVFoundation做一个动态音调项目。我使用AVCaptureVideoDataOutputSampleBufferDelegate从相机获取视频数据,并尝试使用setImageWithTexture:方法处理它,该方法将返回带有色调样式的UIImage。但是,当我试图用下面的代码在UIImageView上显示它时,它的内存将快速增长,并且程序将因为使用了大量内存而被终止。我如何解决这个问题 - (void)captureOutput:(AVCaptureOutput *)cap

我正在使用AVFoundation做一个动态音调项目。我使用AVCaptureVideoDataOutputSampleBufferDelegate从相机获取视频数据,并尝试使用setImageWithTexture:方法处理它,该方法将返回带有色调样式的UIImage。但是,当我试图用下面的代码在UIImageView上显示它时,它的内存将快速增长,并且程序将因为使用了大量内存而被终止。我如何解决这个问题

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:    (CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{
     // Create a UIImage from the sample buffer data
     UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
     NSLog(@"get pic");
     UIImage * imageOut = [[ToneTool sharedManager] setImageWithTexture:image];
     self.imgView.image = imageOut;
}

尝试注释出
UIImage*imageOut=[[ToneTool sharedManager]设置纹理图像:图像]并添加
self.imgView.image=image
。然后,您可以看到UIImageView/UIImage或set-tone操作是否会导致内存上升。@jojoT“你如何找到我:)试试看,它可能会帮助您。