Skip to content

Screen Capture on Windows

Nackloose edited this page Mar 26, 2018 · 1 revision

'dshow' vs 'gdigrab'

gdigrab

For windows GdiGrab should be preferred as the ffmpeg documentation clearly states it is for windows.

https://ffmpeg.org/ffmpeg-devices.html#gdigrab

This should be a pretty reliable way to do so:

  FrameGrabber grabber = new FFmpegFrameGrabber("desktop");
  grabber.setFormat("gdigrab");
  grabber.setFrameRate(30);
  grabber.start();`

dshow

ffmpeg supports screen capture however there seem to be some inconsistencies in the compatibility of dshow. In the case one of your devices registers as screen recorder, (see bottom) you can use dshow. Dshow can be used for any device provided the device specified in the call is registered.

List ffmpeg Devices

You can obtain a list of ffmpeg devices by running ffmpeg -list_devices true -f dshow -i dummy using a CLI. From which, if you see any device listed as screen recorder you can infact use dshow.

More Info / Issues

https://github.com/bytedeco/javacv/issues/31