I have a Ubuntu 18 desktop system I am using (among other things) as a front door camera DVR
The camera I am using is a cheap USB 2.0 device made out of plastic that I forget where it came from (probably out of a cereal box or something) it shows up as the following:
root@beachserver:~# lsusb
Bus 001 Device 002: ID 1e4e:0102 Cubeternet GL-UPC822 UVC WebCam
root@beachserver:~#
In googling that I come up with "Etron Technology, Inc." as the actual chip maker (Cubeternet is, of course, nothing more than a Chinese company that buys camera chips and sticks them in a case)
Code:
root@beachserver:~# v4l2-ctl -D -d /dev/video0
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB2.0 Camera: USB2.0 Camera
Bus info : usb-0000:00:1a.7-1
Driver version: 4.18.20
Capabilities : 0x84A00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
root@beachserver:~#
root@beachserver:~# v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 176x144
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
root@beachserver:~#
In short, I have a "generic USB 2.0 camera" that can do 640x480 at 30fps
I am using this with the "motion" program to watch the door. That program works quite well.
The problem I'm having is with the auto-exposure of the camera. If I just leave it set to auto then during the day the picture is way overexposed to the point that the screen is basically just white.
The auto exposure on the camera sets it to around 625. If I run the command:
v4l2-ctl -d /dev/video0 --set-ctrl=exposure_absolute=20
Then the picture during the day is correct. The problem though is that at dusk (between 7:30-9:30 roughly) and dawn (430-630am roughly) the picture is now underexposed - setting it to 2500 then sets the exposure properly and I get a decent picture.
Of course I could do a cron job to set this but is there any software out there which would do this automatically? Or is there a better camera. I've done much googling on this and I found tons of complaints about this with all makes of cameras plus a ton of corn-pone solutions (like taking a bunch of pictures really fast) that purport to "fix" the problem. My conclusion is 99% of the camera chips out there are garbage and only really work properly when shooting indoors. Does anyone who has had some experience with this have anything to add?