Skip to content

Commit

Permalink
Issue #3: Enable 720p resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Sep 30, 2020
1 parent e7a9850 commit f2a2538
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion piwebcam
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions uvc-gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2043,8 +2043,8 @@ static void usage(const char *argv0)
"1 = USER_PTR\n");
fprintf(stderr,
" -r <resolution> 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 <speed> Select USB bus speed (b/w 0 and 2)\n\t"
"0 = Full Speed (FS)\n\t"
Expand Down

0 comments on commit f2a2538

Please sign in to comment.