Hello,
Currently, using the Media Foundation Framework, I am able to encode a custom sequence.
basically, I build IMFSamples for each of my frames, submit them to an IMFSinkWriter that was properly initialized with inputMediaType and outputMediaType, and see the result written to a IMFByteStream made from a file. (I do not need any media session)
However, I would like to catch the output samples from the encoding scheme. For instance, I would like to get H264 packets and analyze the fact that they are I/P/B frames. It would be great to also retrieve the Time and Duration parameters as set to the
input IMFSample.
I have ideas, but I do not know how to achieve that.
My ideas :
-find somewhere the way to set an "encoding callback" that would provide me the output samples. So far I found nothing like that.
-Subclassing the IMFByteStream so that I overload the "Write" method. However, it will only work if the encoding topology does not perform internal buffering, either by grouping or splitting the writes. I could not find any guarantee about that.
-build an encoding topology by hand (or find a way to get the one from the sinkwriter), add a tee node (is it possible ?), and add a custom node (how to build one ?) that would receive the encoded samples.
Would anyone have some guidance or clues about the recommended practice and the way to do it ?
Regards,
Pierre Chatelier