rFlex / SCRecorder

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
Apache License 2.0
3.06k stars 583 forks source link

AVAssetWriter - Could not be decoded on this device #300

Closed ayurkows closed 8 years ago

ayurkows commented 8 years ago

Error Domain=AVFoundationErrorDomain Code=-11855 "Cannot Decode" UserInfo={NSUnderlyingError=0x157372050 {Error Domain=NSOSStatusErrorDomain Code=560226676 "(null)"}, NSLocalizedFailureReason=The media data could not be decoded on this device., NSLocalizedDescription=Cannot Decode}

Getting the above error when the writer tries to start writing. This only occurs on iphone 5s, and only occurs sometimes. The most reproducible case is when we move from a VC with an AVPlayer that is playing media straight to the VC that handles the recording. The same VC with the recorder works correctly with the same settings when not navigating from the VC with the AVPlayer. What can cause this error and where can I look to fix this?

mitchellporter commented 8 years ago

@ayurkows How did you solve this issue?

ayurkows commented 8 years ago

For some reason the sample rate was being changed, making it incompatible with the 5s. We hard coded in the sample rate in the pod to make sure it was always correct. We might look further into it later if we find the time.

priyeshmarvi commented 7 years ago

@ayurkows I can't understand how did you do that??? can you please give some more info.?