How to get every frame from the camera when recording video in Windows Phone 8?

I am working on a telepresence application that uses a Windows Phone 8 device to send images back to the desktop / tablet. I found several examples that show how to record a video, even save it to a file, but not the one that shows me how to get each frame from the camera as it flows. I saw a sample that used a FileSink object to save the video to storage, but nothing like that to get each frame when creating it. I also do not see an event in the camera object that fires whenever a new raster / frame is generated. There is such an event for shooting, but shooting is very slow and is not used for video streaming.

How can I get every frame when it is created by the camera in the video recording mode? I need this, of course, so I can send every frame via the socket link that I have with my desktop / tablet.

+4
source share
1 answer

If you are using PhotoCaptureDevice or PhotoCamera, you can use this

camera.GetPreviewBufferArgb(previewBuffer);

or

  camera.GetPreviewBufferArgb32(previewBuffer);

where previewBufferis the pixel array of the frame. What can you assignWriteableBitmap.Pixels

or pass a raw array through a socket and assign it to the image on the desktop.

+2
source

Source: https://habr.com/ru/post/1542682/


All Articles