From 125c5d92de9f71db5fd452ee0de9da085be6b819 Mon Sep 17 00:00:00 2001 From: Antonio Garcia-Dominguez Date: Sat, 11 Feb 2012 13:24:12 +0100 Subject: prepare-videochat.sh: use latest /dev/video* file as webcam, for systems with multiple webcams --- prepare-videochat.sh | 9 +++++---- 1 file 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 -- cgit v1.2.3