I see, you can use [ConvertToContiguousBuffer][1] and IMFMediaBuffer::Lock to get the byte buffer.
IMFMediaBuffer *mediaBuffer = NULL;
BYTE *pData = NULL;
pSample->ConvertToContiguousBuffer(&mediaBuffer);
hr = mediaBuffer->Lock(&pData, NULL, NULL);
```*************************************************************************
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our [documentation][3] to enable e-mail notifications if you want to receive the related email notification for this thread.
[3]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html
[1]: https://learn.microsoft.com/en-us/windows/win32/api/mfobjects/nf-mfobjects-imfsample-converttocontiguousbuffer
[2]: https://learn.microsoft.com/en-us/windows/win32/api/mfobjects/nf-mfobjects-imfmediabuffer-lock