AbedElazizShe / LightCompressor_iOS

A powerful and easy-to-use video compression swift package for iOS.
MIT License
97 stars 18 forks source link

Got crash while compression multiple file in loop, more than 4 media file #5

Open ghimireprashant opened 3 years ago

ghimireprashant commented 3 years ago

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '** -[AVAssetReader startReading] cannot be called again after reading has already started' First throw call stack: (0x19c817298 0x1b0571480 0x1a3c92638 0x100ac49d0 0x100ac4e48 0x10060cf04 0x1a3cb3834 0x1026b7ae8 0x1026b932c 0x1026c038c 0x1026c1010 0x1026cc820 0x1e4d3d5bc 0x1e4d4086c) libc++abi: terminating with uncaught exception of type NSException Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: ' -[AVAssetReader startReading] cannot be called again after reading has already started' terminating with uncaught exception of type NSException

ghimireprashant commented 3 years ago

crash on audioReader?.startReading()

harikrishnabista7 commented 3 years ago

Screen Shot 2021-07-09 at 15 49 30 I got the same crash issue. At audioReader?.startReading() If i check in the console the audioReader status is already reading.

so i changed the code like this. Screen Shot 2021-07-09 at 15 54 07 after that I got crash at audioWriterInput.requestMediaDataWhenReady(on: processingQueue, using: {() -> Void in stating you cannot requestMediaData again

kirtirc commented 3 years ago

Hello any one find solution for crash when multiple file compression in loop thanks

ghimireprashant commented 3 years ago

yes, I did by doing 3 compression at a time. that fixed my crash

AbedElazizShe commented 2 years ago

I'd appriciate anyone's contribution to build multiple video compression, i don't have access to a Mac at the moment. I have added the feature to Android .. you can use it as a referenece. https://github.com/AbedElazizShe/LightCompressor/commit/8d8a35d9733b78724cd4466608075ca01742a78e

Ayyarappan commented 8 months ago

yes, I did by doing 3 compression at a time. that fixed my crash

No, I also tried compressing three videos at a time. But the issue still exists. Can someone suggest any alternate library for video compression with multiple files at a time in swift ios

laxman-iroid commented 5 months ago

if audioReader?.status == .unknown{ }

Please add this line and check

I hope issue will be fix