avcapturemoviefileoutput

IOS adding UIProgressView to AVFoundation AVCaptureMovieFileOutput

元气小坏坏 提交于 2019-12-04 18:53:22
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 the recording? Or if this isn't something that is available, how can I tell when recording begins in

Modify AVCaptureSession before saving with AVCaptureMovieFileOutput

眉间皱痕 提交于 2019-12-04 14:00:16
问题 Use Case: I want to capture input from the camera, draw on top of the captured frames (and sound) and save the result as a .mov file. I see that I can capture input for the camera using AVCaptureSession. I can save this to a .mov file using AVCaptureMovieFileOutput. AVVideoComposition can be used to add Core Animation for playback. I assume for recording somehow too? Problem: I can't see how to modify the input before it is saved to file. 回答1: The RosyWriter was almost doing what I wanted.

Getting actual NSString of AvCaptureVideoDataOutput availableVideoCVPixelFormatTypes

限于喜欢 提交于 2019-12-04 03:18:28
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 On an iPhone5 running iOS6, here are the AVCaptureVideoDataOuput availableVideoCVPixelFormatTypes:

Modify AVCaptureSession before saving with AVCaptureMovieFileOutput

╄→尐↘猪︶ㄣ 提交于 2019-12-03 08:49:06
Use Case: I want to capture input from the camera, draw on top of the captured frames (and sound) and save the result as a .mov file. I see that I can capture input for the camera using AVCaptureSession. I can save this to a .mov file using AVCaptureMovieFileOutput. AVVideoComposition can be used to add Core Animation for playback. I assume for recording somehow too? Problem: I can't see how to modify the input before it is saved to file. The RosyWriter was almost doing what I wanted. Adding the following code to captureOutput:didOutputSampleBuffer:fromConnection: enabled me to draw onto the

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

一个人想着一个人 提交于 2019-12-01 21:39:55
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 active/enabled connections' Here is my initialisation code: let device = AVCaptureDevice.defaultDevice(

iOS 8 iPad AVCaptureMovieFileOutput drops / loses / never gets audio track after 13 - 14 seconds of recording

六月ゝ 毕业季﹏ 提交于 2019-11-30 17:24:13
I have the following code which works for iOS 6 & 7.x. In iOS 8.1 I have a strange issue where if you capture a session for about 13 seconds or longer, the resulting AVAsset only has 1 track (video), the audio track is just not there. If you record for a shorter period the AVAsset has 2 tracks (video and audio) as expected. I have plenty of disk space, the app has permission to use camera and microphone. I created a new project with minimal code, it reproduced the issue. Any ideas would be greatly appreciated. #import "ViewController.h" @interface ViewController () @end @implementation

iOS 8 iPad AVCaptureMovieFileOutput drops / loses / never gets audio track after 13 - 14 seconds of recording

▼魔方 西西 提交于 2019-11-30 01:03:49
问题 I have the following code which works for iOS 6 & 7.x. In iOS 8.1 I have a strange issue where if you capture a session for about 13 seconds or longer, the resulting AVAsset only has 1 track (video), the audio track is just not there. If you record for a shorter period the AVAsset has 2 tracks (video and audio) as expected. I have plenty of disk space, the app has permission to use camera and microphone. I created a new project with minimal code, it reproduced the issue. Any ideas would be