diff --git a/piwebcam b/piwebcam index ce19fc4..2a2a984 100755 --- a/piwebcam +++ b/piwebcam @@ -1,7 +1,13 @@ #!/bin/bash + +# Run multi-gadget setup script. sudo /home/pi/uvc-gadget/multi-gadget.sh + +# Set some camera control options. /usr/bin/v4l2-ctl -c auto_exposure=0 /usr/bin/v4l2-ctl -c auto_exposure_bias=8 /usr/bin/v4l2-ctl -c contrast=20 /usr/bin/v4l2-ctl -c video_bitrate=25000000 -sudo /home/pi/uvc-gadget/uvc-gadget -f1 -s2 -r1 -u /dev/video1 -v /dev/video0 + +# Configure the stream with uvc-gadget. +sudo /home/pi/uvc-gadget/uvc-gadget -f1 -s1 -r0 -u /dev/video1 -v /dev/video0 diff --git a/uvc-gadget.c b/uvc-gadget.c index 9971183..4c711e0 100644 --- a/uvc-gadget.c +++ b/uvc-gadget.c @@ -39,8 +39,8 @@ #include "uvc.h" -#define WIDTH1 640 -#define HEIGHT1 360 +#define WIDTH1 1280 +#define HEIGHT1 720 #define WIDTH2 1920 #define HEIGHT2 1080 @@ -2043,8 +2043,8 @@ static void usage(const char *argv0) "1 = USER_PTR\n"); fprintf(stderr, " -r Select frame resolution:\n\t" - "0 = HEIGHT1p, VGA (WIDTH1xHEIGHT1)\n\t" - "1 = 720p, (WIDTH2xHEIGHT2)\n"); + "0 = HEIGHT1p, (WIDTH1xHEIGHT1)\n\t" + "1 = HEIGHT2p, (WIDTH2xHEIGHT2)\n"); fprintf(stderr, " -s Select USB bus speed (b/w 0 and 2)\n\t" "0 = Full Speed (FS)\n\t"