Salman Khakwani
Salman Khakwani

Reputation: 6714

Changing Max Duration of Video while Recording iOS

I am initially starting recording with a specified Maximum Time Threshold.

AVCaptureMovieFileOutput* output;
//initialisations, other configurations...

//Here i am setting up my MaxDuration before starting recording.
[output setMaxRecordedDuration:CMTimeMakeWithSeconds(MY_MAX_LENGTH, 600)];

//Starting recording here
[output startRecordingToOutputFileURL:MY_FILE_URL recordingDelegate:self];

I need to change the Maximum Recording Time Threshold while recording is going on.

What i have tried so far:

[output setMaxRecordedDuration:kCMTimeInvalid];

I am calling the above line of code while recording is going on, but the recording stops at the previous MY_MAX_LENGTH time mark and then after the recording is restarted the new Maximum duration kCMTimeInvalid is set on the AVCaptureMovieFileOutput Object.

Am i doing anything wrong here? Please point me into right direction.
Any Help is highly appreciated.

Upvotes: 2

Views: 1329

Answers (1)

Salman Khakwani
Salman Khakwani

Reputation: 6714

For achieving this, i used manual start-recording/stop-recording technique (instead of Maximmum Time logic) using a timer and some flags.

I hope this helps anyone who is into the similar problem.

Upvotes: 2

Related Questions