This example is based on the Webcam Capture API. This library allows you to use your build-in or external webcam directly from Java. It's designed to abstract commonly used camera features and support various capturing farmeworks.
Clone the project form GitHub and move to the project directory.
git clone https://github.com/teocci/multicam-webcontroller
cd multicam-webcontroller
Using your IDEA complile the project. The libraries needed to complile this project are:
<orderEntry type="library" name="com.github.sarxos:webcam-capture:0.3.11" level="project" />
<orderEntry type="library" name="com.github.sarxos:webcam-capture-driver-ipcam:0.3.11" level="project" />
<orderEntry type="library" name="org.eclipse.jetty.aggregate:jetty-all:9.2.7.v20150116" level="project" />
<orderEntry type="library" name="com.fasterxml.jackson.core:jackson-databind:2.5.1" level="project" />