I have this rough sample code that does the following:
1. captures 4K video and audio from the camera
2. crops a window inside the 4K video and applies a comic effect to it.
3. tries to save that resulting image and audio into a video file on disk.
4. fails miserably with error -12738. Resulting video on disk is 0 megabytes.
.I have opened a paid technical incident support on this. After weeks analysing the problem, engineer sees nothing wrong and escalates that to the AVFoundation team that did nothing until now. I have filled a bug request on this, #29915084.
You can try the code by downloading it from here: http://www.filedropper.com/test_162