I am using AVAssetWriter to create an MPEG4 file.
I start a video session with:
[assetWriter startSessionAtSourceTime:kCMTimeZero];
Now the video file is written fine if I finish the session with this:
[assetWriter finishWritingWithCompletionHandler:^{
}];
But if I call [assetWriter endSessionAtSourceTime:endTime];
before [assetWriter finishWritingWithCompletionHandler
then it doesn't write the file.
This is how I call endSessionAtSourceTime
:
endTime = CMTimeMakeWithSeconds(secondsRecorded, 30);
[assetWriter endSessionAtSourceTime:endTime];
Any ideas what i am doing wrong?