I got it working after copying all sample buffer metadata. Somehow it must have been modified somewhere in my code and that occasionally made recording break.
Topic:
Media Technologies
SubTopic:
Streaming