2

I am using this java library to access camera in laptop/pc. Webcam-capture

Webcam webcam = Webcam.getDefault();
webcam.open();
ImageIO.write(webcam.getImage(), "PNG", new File(path));

Above code giving me back camera streaming, i want to switch both front/back cameras programatically.

I am following this Webcam-capture Guide but unable to find any related documentation for switching cameras.

THE INN-VISIBLE
  • 155
  • 1
  • 8

1 Answers1

2

WebCam.getWebcams() returns a list of available Webcams which you can iterate and use, instead of using the one getDefault() returns.

1615903
  • 32,635
  • 12
  • 70
  • 99