avcapturemoviefileoutput

AVCaptureSession addInput issues with ios8

蓝咒 提交于 2020-01-14 10:37:09
问题 I have an application with AVCaptureSession which work correctly with previous iOS versions, but then I tried run it on device with ios8, application crashed sporadic. but the problem wasn't solved. Exception getting in "[session addInput:input];" . Please advice how to resolve. Please verify my below code and im getting error in [session addInput:input]; Printing description of error: Error Domain=AVFoundationErrorDomain Code=-11852 "Cannot use Back Camera" UserInfo=0x17c076e0

Getting actual NSString of AvCaptureVideoDataOutput availableVideoCVPixelFormatTypes

依然范特西╮ 提交于 2020-01-12 14:31:11
问题 I am trying to find the accepted formats on an AVFoundation output: self.theOutput=[[AVCaptureVideoDataOutput alloc]init]; if ([self.theSession canAddOutput:self.theOutput]) [self.theSession addOutput:self.theOutput]; I am then inserting a breakpoint right after and: po [self.theOutput availableVideoCVPixelFormatTypes] and I get this: (NSArray *) $5 = 0x2087ad00 <__NSArrayM 0x2087ad00>( 875704438, 875704422, 1111970369 ) How do I get the string values of these format types? Thanks 回答1: On an

NSURL isFileURL always returns NO

心已入冬 提交于 2020-01-01 04:20:27
问题 Can someone explain to me why the following code: NSString* filePathString = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; NSLog(@"%i", [[NSURL URLWithString:filePathString] isFileURL]); NSLog(@"%@", filePathString); outputs: 0 "/var/mobile/Applications/28ADFC19-874C-4304-94B5-F6441CAE9FAD/Documents" This means that this url isn't a file URL. Obviously, it is. Background: I'm trying to use an AVCaptureMovieFileOutput to write a movie recording to a file,

How do I record a video on iOS without using a preset?

大憨熊 提交于 2019-12-20 01:39:46
问题 The simpler way to record a video on iOS is by setting a AVCaptureSession.sessionPreset. But that doesn't work for me since I want to control parameters like binning, stabilization (cinematic, standard, or none) and ISO. I find the format I want and assign it to activeFormat, but when I try to start recording, I get an error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] No

How to save a movie from AVCapture

丶灬走出姿态 提交于 2019-12-13 04:34:04
问题 I've been trying to figure out AVCapture the last couple of days and am struggling to save a video. My understanding is that you call [movieFileOutput startRecordingToOutputFileURL:outputURL recordingDelegate:self]; and then at a later time you can call [movieFileOutput stopRecording]; And it should then call the delegate method -(void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:

How to record timelapse video from iPhone using AVCaptureDeviceFormat?

南笙酒味 提交于 2019-12-12 03:27:24
问题 I am trying to record a timelapse video via iphone. I have already got it working for slow motion (by capturing maximum frames possible), with 120 fps. Now I am trying to reverse the logic to capture least frames possible, to achieve timelapse functionality. Code flow is like this: Query all the supported frame range from the available device formats of the AVCaptureDevice. Check if the frame rate is below or equal to the desired 20 fps and dimensions are equal to or greater than 1920*1080.

AVCaptureSession and AVCaptureMovieFileOutput frame timestamp

天大地大妈咪最大 提交于 2019-12-10 01:34:04
问题 I am recording a movie with AVCaptureSession and AVCaptureMovieFileOutput. I am also recording acceleration data and trying to align the acceleration data with the video. I am trying to figure out a way to get the time the video file recording started. I am doing the following: currentDate = [NSDate date]; [output startRecordingToOutputFileURL:fileUrl recordingDelegate:self]; However, according to my tests, the video recording starts 0.12 seconds before the call to

How to superimpose views over each captured frame inside CVImageBuffer, realtime not post process

只谈情不闲聊 提交于 2019-12-06 17:58:31
问题 I have managed to setup a basic AVCaptureSession which records a video and saves it on device by using AVCaptureFileOutputRecordingDelegate . I have been searching through docs to understand how we can add statistics overlays on top of the video which is being recorded. i.e. As you can see in the above image. I have multiple overlays on top of video preview layer. Now, when I save my video output I would like to compose those views onto the video as well. What have I tried so far? Honestly, I

IOS adding UIProgressView to AVFoundation AVCaptureMovieFileOutput

a 夏天 提交于 2019-12-06 13:35:55
问题 I am using AVCaptureMovieFileOutput to record videos and I want to add a UIProgressView to represent how much time there is left before the video stops recording. I set a max duration of 15 seconds: CMTime maxDuration = CMTimeMakeWithSeconds(15, 50); [[self movieFileOutput] setMaxRecordedDuration:maxDuration]; I can't seem to find if AVCaptureMovieFileOutput has a callback for when the video is recording or for when recording begins. My question is, how can I get updates on the progress of

Play video with AVPlayer after AVCaptureMovieFileOutput

寵の児 提交于 2019-12-05 08:38:41
I've created a custom camera similar to snapchat with AVFoundation. The picture aspect works: take a picture and I display the picture. Now I'm trying to take a video and display the video. I have captured a successful video file, tested and works with MPMoviePlayer, but am unable to play it back on AVPlayer. - (void)takeVideoAction:(id)sender { NSString *outputPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"output.mp4"]; NSFileManager *manager = [[NSFileManager alloc] init]; if ([manager fileExistsAtPath:outputPath]){ [manager removeItemAtPath:outputPath error:nil]; }