0

I have an application having screen capture to video functionalities which developed in uwp platform. I have to read the data buffer from the MediaStreamSource(Windows.Graphics.Capture) and save those buffer data to separate chunk files. and i have to do a parallel upload to server while recording happening. I can get the each frames from the MediaStreamSource, but i didn't see any option to get the buffer data. I have used below given documentation to implement this. Is there any way to get the buffer data and save it separate files.

https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture-video

Could anyone help me on this.

Thanks in Advance !

Mahesh cm
  • 77
  • 2
  • 9
  • You could save the each frame to a SoftWareBitmap object and create a new WriteableBitmap object, then you could use [CopyToBuffer()](https://docs.microsoft.com/en-us/uwp/api/windows.graphics.imaging.softwarebitmap.copytobuffer?view=winrt-20348) method to copy the software bitmap pixel data into the PixelBuffer of WriteableBitmap. Then you could convert the buffer to the stream and use ToArray() method to get a byte array. Please refer to [this question](https://stackoverflow.com/questions/31188479/converting-a-videoframe-to-a-byte-array) to know the detailed code. – dear_vv Jun 15 '21 at 09:00

0 Answers0