For live streaming purposes, I have written custom mp4 container and I am facing few issues.
First: I have noticed, that IMFMediaSink somehow skips some of samples(frames). While testing, running both MF MediaSink and my custom 'sink', they both differs in total sample count. While I am outputting all received samples, MF sink is short on few. Question is: what and why is happening? This of course leads to my file being broken, unable to be played. Yeah, I even viewed sample list of both files and they are just missing, not merged or anything.
Second: I have difficulties of understanding how presentation time is calculated? I have tried to count total sum of IMFSample::GetSampleTime and IMFSample::GetSampleDuration. Converted them to ms, but they are still different from those in MF MediaSink file.