Reputation: 5232
I am trying to capture video using AVCaptureMovieFileOutput
. For that I am using sample code of apple. I don't have great uderstanding on this but for start video capture I am using following code:
-(void)startRecordingWithOrientation:(AVCaptureVideoOrientation)videoOrientation;
{
AVCaptureConnection *videoConnection = [AVCamUtilities connectionWithMediaType:AVMediaTypeVideo fromConnections:[[self movieFileOutput] connections]];
if ([videoConnection isVideoOrientationSupported])
[videoConnection setVideoOrientation:videoOrientation];
[[self movieFileOutput] startRecordingToOutputFileURL:[self outputFileURL] recordingDelegate:self];
// After this method my session say recording is yes.
}
Here:
[self movieFileOutput]
returning a object of AVCaptureMovieFileOutput
.
Now I have delegate methods for handling further things.
The problamatic part is Delegate Methods for AVCaptureMovieFileOutput
are being called sometime and some time this doesn't.
Max probably when I pop this page after first recording and then I come back on this screen I face that delegate methods are not being called.
I have to Kill application and this works for new recording.
Please tell me the solution.
EDIT: The delegate method calls only once when I delete application and than reinstall app. After that this never get called. Even If I don't capture video and come on the screen and go back delegate don't get called. I am using apple's AVCam demo and added a screen before recorder screen.
Upvotes: 3
Views: 2851
Reputation: 323
Are you sure that the file you trying to save doesnt exist yet? If it does, movie capture will fail to start, hence no delegane methods will be called.
Upvotes: 2