locked
Capturing from webcam to mp4 (H.264+AAC) produces choppy video files on Win 7 RRS feed

  • Question

  • I'm tying to capture webcam stream to mp4 (H.264+AAC). I'm using MFCaptureToFile sample as a basis (I've added audio recording to it). Everything works fine on Windows 8 OS, however on Windows 7 quite often the file has much less audio samples that webcam feeds into the encoder. This results in faster and choppy playback than normal.

    When calling GetStatistics from IMFSinkWriter for audio, and examining MF_SINK_WRITER_STATISTICS structure I can see that number of samples encoded is less than number of samples fed into it. And it gets less and less with time (dwAverageSampleRateEncoded also decreases). The samples are absolutely valid, the timestamps and content are ok.

    This happens on 80% of recording runs. Sometimes it may record successfully. This happens only on Win 7.

    Anyone knows why the audio encoder may skip some of the samples?

    If not - could someone point to a working sample for capturing webcam to mp4 file? Thanks


    Monday, November 17, 2014 1:05 AM

All replies

  • One more note - the CPU usage is low, so this is not a problem
    Monday, November 17, 2014 1:05 AM