1
votes

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 trying to start writing with an AVAssetWriter. 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 might cause this error and where can I look to fix this?

The asset writer code is part of the SCRecorder pod: https://github.com/rFlex/SCRecorder https://github.com/rFlex/SCRecorder/blob/master/Library/Sources/SCRecordSession.m

1
Just a guess, have you checked if VC receives correct data/format from AVPlayer container VC? There can be some issue while receiving data on other VC probably. - NightFury
The VCs are not related - they don't pass any info from one to the other. - Alex Yurkowski
Please post relevant code, so others can better analyze your issue. - NightFury
I added the recorder pod and where start writing is called. - Alex Yurkowski

1 Answers

0
votes

We solved this after finding that the audio sample rate was being changed, causing this error. We recheck the audio sample rate prior to recording and correct it if it has for some reason been changed.