Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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
Objective c 如何允许用户拍摄视频并在viewcontroller中显示?_Objective C_Xcode_Video_Storyboard_Video Capture - Fatal编程技术网

Objective c 如何允许用户拍摄视频并在viewcontroller中显示?

Objective c 如何允许用户拍摄视频并在viewcontroller中显示?,objective-c,xcode,video,storyboard,video-capture,Objective C,Xcode,Video,Storyboard,Video Capture,我正在开发一个应用程序,希望用户可以选择录制视频,然后将该视频显示在视图控制器中。我是一个非常新的编程和任何帮助将不胜感激 这是一张图片,让你了解我的意思 图1-使用GPUImage怎么样? 您可以使用AVFoundation.framework,但使用GPUImage更容易。 您可以使用下面的代码来显示捕获的视频,并可以保存视频以使用GPUImageMovieWriter self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessi

我正在开发一个应用程序,希望用户可以选择录制视频,然后将该视频显示在视图控制器中。我是一个非常新的编程和任何帮助将不胜感激

这是一张图片,让你了解我的意思

图1-

使用GPUImage怎么样? 您可以使用AVFoundation.framework,但使用GPUImage更容易。 您可以使用下面的代码来显示捕获的视频,并可以保存视频以使用GPUImageMovieWriter

self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
self.videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
self.videoCamera.horizontallyMirrorFrontFacingCamera = YES;

GPUImageSepiaFilter *filter = [[GPUImageSepiaFilter alloc] init];
[self.videoCamera addTarget:filter];

GPUImageView *filterView = [[GPUImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.view addSubview:filterView];
[filter addTarget:filterView];

[self.videoCamera startCameraCapture];

您是从中添加GPUImage静态库的吗?是的,我使用cocoapods在这里添加itI创建和上载的示例项目。请试试这个。