How to buffer video in MediaCapture - for streaming over a network using MediaCapture

I am writing a simple application that is supposed to broadcast video from one PC / phone to another through a network. I use Windows 10, this is a universal application (think Skype)

I would like the latency of the video to be as low as possible, even if that means you are dropping frames

Feel free to tell me if I am doing it wrong

  • Create MediaCapture on the device using the camera
  • create network connection
  • StartRecordingToStreamAsync () using a custom IRandomAccessStream that flows through the network.

this works fine until there is a delay on the receiving side. Everything works fine, but latency is introduced

What is the right way to get the starting point for starting frame deletion?

My technique is still

  • enter "flow control" in the network protocol so that the end of the sending knows how far ahead of the reader it is.
  • lock WriteAsync () in my IRandomAccessStream until the reader catches

it seems that the MediaCapture object on the device with the camera has its own internal buffers, is there a way to indicate the size of the buffer used, as well as tips on what to do if this buffer is triggered by pressure?

+4
source share

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


All Articles