summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Garcia-Dominguez <antonio.garciadominguez@uca.es>2012-02-11 13:24:12 +0100
committerAntonio Garcia-Dominguez <antonio.garciadominguez@uca.es>2012-02-11 13:24:12 +0100
commit125c5d92de9f71db5fd452ee0de9da085be6b819 (patch)
tree289f993b89932e3d9ffe21b03a4c3ecfd6581238
parentf26873abc4107743b8cc67883869808aa8404173 (diff)
prepare-videochat.sh: use latest /dev/video* file as webcam, for systems with multiple webcams
-rwxr-xr-xprepare-videochat.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/prepare-videochat.sh b/prepare-videochat.sh
index 16960f7..7f0ae5f 100755
--- a/prepare-videochat.sh
+++ b/prepare-videochat.sh
@@ -43,10 +43,6 @@ WIFI_IP=192.168.2.122
# Port on which IP Webcam is listening
PORT=8080
-# Device created by loading v4l2loopback. If you don't have any other webcam in your computer, the default will
-# be fine. Otherwise, you will have to try with /dev/video1, /dev/video2 and so on.
-DEVICE=/dev/video0
-
# URL on which the latest v4l2loopback DKMS .deb can be found
V4L2LOOPBACK_DEB_URL=http://ftp.us.debian.org/debian/pool/main/v/v4l2loopback/v4l2loopback-dkms_0.4.0-1_all.deb
@@ -127,6 +123,11 @@ if ! has_kernel_module v4l2loopback; then
fi
fi
+# Use the newest /dev/video* device as the webcam: this should help
+# when loading v4l2loopback on a system that already has a regular
+# webcam.
+DEVICE=$(ls -1t /dev/video* | head -1)
+
# Decide whether to connect through USB or through wi-fi
IP=$WIFI_IP
if ! can_run "$ADB"; then