- Posts: 17
- Joined: Mon Apr 22, 2019 7:15 am
- Real Name: Shilpi Rustagi
Thanks for providing your code sample, I can see 2 potential issues:
- Assuming that you have enabled audio input with 2 channels, your calculation for _audioSamplesPerframe is actually the bit length (as bmdAudioSampleType16bitInteger = 16), whereas the call to fwrite is expecting byte count
- I would avoid performing any file writes within the context of VideoInputFrameArrived callback, This operation has potential to delay subsequent VideoInputFrameArrived callback and if continual callback delay, this would eventually lead to drop frames. Increment the reference to IDeckLinkAudioInputPacket, store in a queue and handle in a different thread context. Refer to the FileCapture sample for example of how to do this (Desktop Video SDK 11.3).
Regards
Cameron