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


I have the following code that is available in iOS 6 & amp; 7.x

In iOS 8.1, I have a strange problem, where you capture a session for about 13 seconds or more, resulting in AVAsset only 1 track (video), not an audio track yet. is.

If you record for a short duration, 2 tracks (video and audio) in AVAsset hope I have many disk space, the app is allowed to use the camera and microphone

I have created a new project with a minimum code, re-presented this issue.

Any ideas will be highly appreciated.

  #import "ViewController H" @ Interface View Controller () @ and @ Implementation View Controller {en RecordingState {recording, paused}; Enum recordingstate recordingtate; AVCapture session * session; AVCaptureMovieFileOutput * Output; AVPlayer * player; AVPlayerLayer * playerLayer; Bull audiegrated; } - (zero) viewDidoadload [[Super Viewedload]; [Auto setup]; Recording location = closed; } - (zero) setupAV {session = [[AVCaptureSession alloc] init]; [Starting session]; AVCaptureDevice * videoDevice = Zero; (AVCaptureDevice * device [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]) for {if (device.position == A wakeupdress device positionback) {videoDevice = device; break; }} AVCaptureDevice * Audiovisual = [AVCaptureDevice defaultDeviceWithMediaType: AVMediaTypeAudio]; If (VideoDivise and Audio Device) {AVCaptureDeviceInput * input = [AVCaptureDeviceInput DeviceInputWidth Device: VideoOvice Error: Zero]; [Session addInput: input]; AVCaptureDeviceInput * Audio Input = [AVCaptureDeviceInput DeviceInput withDevice: Audio Device Error: Zero]; [Session addInput: audioInput]; NSURL * recordURL = [auto tempUrlForRecording]; [[NSFileManager defaultManager] removeItemAtURL: recordURL error: zero]; Output = [[AVCaptureMovieFileOutput alloc] init]; Output.maxRecordedDuration = CMTimeMake (45, 1); Output.maxRecordedFileSize = 1028 * 1028 * 1000; [Session addOutput: output]; } [Session committed configuration]; } - (IBAction) recording buttonclaimed: (id) sender {if (recordingstate == is stopped) {[auto-initialization]; } And {[self-stop recording]; }} - (zero) initial recording {recordingState = recording; [Beginning session]; [Output StartersOutputUtputUpload URL: [Self tempUrlForRecording] Delegate Recording: Self]; } - (zero) stopRecording {recordingState = closed; [Output Stop Recording]; [Session stopping]; } CaptureOptput: (AVCaptureFileOutput *) Capture was optimized FinishRecordingToOutputFileAtURL: (NSURL *) Output file from URL connection: (NSArray *) Connection error: (NSError *) Error {AVAsset * cameraInput = [AVAsset assetWithURL: [Self tempUrlForRecording]] ; // How many records have been recorded on the Defensors (<14 SECS - 2 tracks,> 14 SECS - 1 track) NSLog (@ "Number of Tracks:% i", Camera Input.Track. } - (id) tempUrlForRecording {NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString * documentsDirectoryPath = [path objectAtIndex: 0]; NSSTING * path = @ "camerabuffer.mp4"; NSString * pathCameraInput = [Document Directory Path StringBappingDancePantCompanyant: Path]; NSURL * urlCameraInput = [NSWR file URLWithPath: pathCameraInput]; Return urlCameraInput; } - (zero) did risiv memorialisation [[super davidimmemi warning]; // Any resource settlement which can be reproduced. } @end  

This will help you fix it.

[movieOutput Set MovieFragmentInterval: kCMTimeInvalid];

I think this is a bug. The documentation says that if the recording has not been successfully completed then the sample table has not been written, it will be written automatically if it is successfully completed but now it seems that it is not so.

Any thoughts?


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -