0

I am trying to make a remote desktop protocol that runs in your web browser. This is what I have so far in order to capture the desktop (on windows):

ffmpeg -f gdigrab -framerate 60 -i desktop -c:v libx264rgb -preset ultrafast -f mp4 out.mp4

Which seems to work great to capture to a file.

I have tried just piping the data out from ffmpeg to a web server and playing it in a web browser, but the video just spins and fails to load. I've also tried changing the video format but then I lose a lot of my FPS and the video still fails to load.

wesley
  • 49
  • 1
  • 6

1 Answers1

1

Your best bet is to use Media Source Extensions (MSE). You can either use WebP or fMP4 with h.264. In case of using h.264, you have to use fragmented output and pipe the fragments as you get them in a named pipe for example.

Check my answer https://stackoverflow.com/a/30643655/83169 which explains the FFmpeg parameters you need to generate correct fragmented output usable with MSE.

Pablo Montilla
  • 2,941
  • 1
  • 31
  • 35