BBMetalImage icon indicating copy to clipboard operation
BBMetalImage copied to clipboard

Writer fails while recording

Open shiwanithakur opened this issue 3 years ago • 4 comments

I start recording video, first few frames are written successful then writer fails with error code Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16364), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x28194a340 {Error Domain=NSOSStatusErrorDomain Code=-16364

it comes randomly, specially when app comes from background and start writing.

shiwanithakur avatar Aug 25 '20 09:08 shiwanithakur

I figured out it, sometimes CMTime for sample buffer is not correct, should be greater that previous frame.

shiwanithakur avatar Aug 27 '20 09:08 shiwanithakur

Could you please write a sample project to reproduce the problem? And what kind of device, iOS version, Xcode version do you use?

Silence-GitHub avatar Aug 28 '20 03:08 Silence-GitHub

I am using iPad 6th Generation, iOS 13.6. This issue was coming randomly. After putting so many logs i figured out problem in sampleTime was equal to previous frame. public func newTextureAvailable(_ texture: BBMetalTexture, from source: BBMetalImageSource) let sampleTime = texture.sampleTime

shiwanithakur avatar Aug 28 '20 03:08 shiwanithakur

@shiwanithakur how did you fixed it?

juanctecdam avatar Nov 04 '20 15:11 juanctecdam