Closed jakejin closed 8 years ago
This can be caused by various things and depends on your situation, but the root cause is a memory issue. I had the same thing happen last week. The view controller that owned my recorder was not being deallocated due to a custom transition error.
Check this out: http://stackoverflow.com/a/34649381/3344977
AV Foundation
limits the number of instances you can have of certain classes. So if i had to guess I'd say that you've created too many SCAssetExportSessions
.
Hey thanks for your response, I agree that the root cause is a memory issue. However, I could not get down to the solution yet. The delegate method:
- (void)player:(SCPlayer *__nonnull)player itemReadyToPlay:(AVPlayerItem *__nonnull)item
{
DDLogDebug(@"Player is ready to play: %@ -> %@", player, item);
}
gets called three times when I try to save the 2nd time and the 3rd time. Do you know why that might be happening?
Appreciate the help, thanks.
Its probably getting called 3 times because there are 3 separate players in existence, and they are each calling their delegate method. You can use a tool like FLEX to easily see how many instances of a specific class are currently in memory. Try using it real quick and see if you have more than one player in existence.
Thanks a lot, that library really helped. I was creating instances of the recorder every time that view controller popped up and it never deallocated.
Thanks!
Glad I could help!
Saving a video first two time works fine. However, the third time it always gives an error:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1db05250 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1db155d0 "The operation couldn’t be completed. (OSStatus error -12983.)", NSLocalizedFailureReason=An unknown error occurred (-12983)}
I looked at issue post #183 which had the same error message, but the solution they found did not work for me.
Does anyone know the issue that I am facing?
Here is my code: