appendSampleBuffer reutrns false, writer.error property shows:
"
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x14f542f40 {NSUnderlyingError=0x17205a3d0 "The operation couldn’t be completed. (OSStatus error -12983.)", NSLocalizedFailureReason=An unknown error occurred (-12983), NSLocalizedDescription=The operation could not be completed}
"
I searched for -12983, but couldn't find it - what does it mean?
It's impossible to say specifically why you're having this problem without much more code context (and I can't find the error either), BUT I can say that I was in your shoes earlier today and in the end, the problem was that I had used the API members in the wrong order. My steps were
1. Start writing
2. start session at source time 0
3. end session at time X
4. request media data when ready using block.....
5. etc.
my sample-feeding block failed to add in a way similar to yours UNTIL I (quite accidentally) changed to
1. Start writing
2. start session at source time 0
3 request media data when ready using block...
(set the end session time in my feeding block, when my input frames were exhausted).
I don't know what's going on in your code. My only point is that the API is unfortunately fragile, and not particularly friendly in terms of feedback. In other words, my old step 3 did not return an error saying, "Hey dummy, don't set your end time here.". In stead, I just couldn't append perfectly good samples on to my movie. If I hadn't gotten lucky, I probably wouldn't have found my problem. Try some permutations of the operations you do, and see what happens. Wish I could help more.