Questions tagged [avcapturemoviefileoutput]

70 questions
17
votes
2 answers

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

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…
Si-N
  • 1,495
  • 1
  • 13
  • 27
16
votes
1 answer

NSURL isFileURL always returns NO

Can someone explain to me why the following code: NSString* filePathString = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; NSLog(@"%i", [[NSURL URLWithString:filePathString] isFileURL]); NSLog(@"%@",…
eric.mitchell
  • 8,817
  • 12
  • 54
  • 92
15
votes
1 answer

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

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…
TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
15
votes
2 answers

Problems with AVCaptureSession in landscape mode on iPad

I have been trying to capture frames from front camera and present it on the view. Here is my code _session = [[AVCaptureSession alloc] init]; _session.sessionPreset = AVCaptureSessionPreset640x480; AVCaptureDevice *device = [AVCaptureDevice…
MegaManX
  • 8,766
  • 12
  • 51
  • 83
14
votes
5 answers

`[AVCaptureSession canAddOutput:output]` returns NO intermittently. Can I find out why?

I am using canAddOutput: to determine if I can add a AVCaptureMovieFileOutput to a AVCaptureSession and I'm finding that canAddOutput: is sometimes returning NO, and mostly returning YES. Is there a way to find out why a NO was returned? Or a way to…
Drew
  • 12,578
  • 11
  • 58
  • 98
13
votes
1 answer

Using maxRecordedFileSize to limit AVCaptureSession record time

I've been writing a camera app for iOS 8 that uses AVFoundation to set up and handle recording and saving (not ImagePickerController). I'm trying to save use the maxRecordedFileSize attribute of the AVCaptureMovieFileOutput class to allow the user…
12
votes
2 answers

AVCaptureSession and AVCaptureMovieFileOutput frame timestamp

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…
Roland Rabien
  • 8,750
  • 7
  • 50
  • 67
11
votes
4 answers

Getting actual NSString of AvCaptureVideoDataOutput availableVideoCVPixelFormatTypes

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…
9
votes
1 answer

How to find the highest resolution AVCaptureDeviceFormat suitable for recording to a file?

I'm using AVFoundation to record from the device's camera to a movie file, using AVCaptureMovieFileOutput. I want to allow the user to switch between high frame rate and high resolution modes before recording begins, but I can't work out how you're…
Robert
  • 5,735
  • 3
  • 40
  • 53
8
votes
1 answer

No audio is played after saving video with AVCaptureMovieFileOutput

I try to save a video file from the iphone camera with that following code: class Camera { ... private func loadDeviceInput() { let devices = AVCaptureDevice.devices() as! [AVCaptureDevice] for device in devices { if…
jrmgx
  • 719
  • 8
  • 24
5
votes
1 answer

Is audioSettings property missing in AVCaptureAudioDataOutput in the Swift header?

I'm working on iOS app where I want to record segmented video. I have read https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html and I have a working solution with…
5
votes
0 answers

Change camera position Front/Rear while recording a video

My camera was taking pictures and recording videos perfectly (using AVCaptureMovieFileOutput) and I was able to toggle camera position to front/rear normally. However, as in Instagram, Snapchat, and myriad of other apps, I wanted to also allow the…
rgoncalv
  • 5,825
  • 6
  • 34
  • 61
5
votes
1 answer

Play video with AVPlayer after AVCaptureMovieFileOutput

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…
Peter
  • 1,053
  • 13
  • 29
5
votes
0 answers

Can't call startRecordingToOutputFileURL more than once on instance of AVCaptureMovieFileOutput

I am currently testing on iOS 8, on an iPhone 6. I am calling these APIs from Swift. I'm trying to figure out why I can't call startRecordingToOutputFileURL more than once on a single instance of AVCaptureMovieFileOutput. I am calling stopRecording…
5
votes
0 answers

Error while recording multiple screens using AVFoundation

I am trying to record primary and secondary monitor screens into two separate files using below code. const uint32_t MAX_DISPLAY = 2; CGDirectDisplayID displays[MAX_DISPLAY] = {0}; CGGetActiveDisplayList(MAX_DISPLAY, displays,…
1
2 3 4 5