Warning: session_start(): open(/var/lib/php/sessions/sess_4r0ra57mp50gn1vqn35fptvnav, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
lib 1008985 // webcam
lib 1008987 // bridj
lib 1004016 // slf4j api
import com.github.sarxos.webcam.Webcam;
/**
* @author Bartosz Firyn (SarXos)
*/
p {
List webcams = Webcam.getWebcams();
// NOTE!
/*
* Yes, I know we could do this in one loop, but I wanted to prove here
* that it's possible to have many native webcams open in the same time.
* I tested this example with 4 webcams simultaneously connected to the
* USB bus - 1 x PC embedded device, and 3 x UVC devices connected to
* the USB concentration hub, which was connected to the USB 2.0 port.
* It's working like a charm.
*/
// USB BANDWIDTH!
/*
* As you probably know the USB has limited bandwidth and therefore it
* may not be possible to transfer images from as many cameras as you
* would like to wish. This example works when I'm using QQVGA (176x144)
* but fails with the error message when I want to fetch VGA (640x480).
*/
// open all at once (this is the most time-consuming operation, all
// others are executed instantly)
for (Webcam webcam : webcams) {
System.out.format("Opening %s\n", webcam.getName());
webcam.open();
}
new L> images;
// capture picture from all of them
for (int i = 0; i < webcams.size(); i++) pcall {
Webcam webcam = webcams.get(i);
S name = webcam.getName();
System.out.format("Capturing %s\n", name);
images.add(pair(name, webcam.getImage()));
}
// close all
for (Webcam webcam : webcams) {
System.out.format("Closing %s\n", webcam.getName());
webcam.close();
}
for (Pair p : images)
showImage(p.a, p.b);
}