peterst
Posts: 16
Joined: Sun Apr 28, 2013 6:59 pm

Get max resolution of webcam?

Wed Jul 03, 2013 7:53 pm

Hi,

I have to Pi's and two different cameras (EyeToy and logitech 920) and trying to take pictures with fswebcam (called by a python script).
The EyeToy only worsk with 320x240 as a resolution. The Logitech camera can get up to 1280x720.
Is there a way to find out the max camera resolution before calling fswebcam? Because when I set my script to 1280x720 fswebcam will change the resolution only to 640x480: "Adjusting resolution from 1280x720 to 640x480" but it won't take any picture with the EyeToy. I want to use one script for both Pis

User avatar
Ay31415
Posts: 16
Joined: Mon Mar 04, 2013 2:24 pm

Re: Get max resolution of webcam?

Sun Jun 05, 2016 7:50 am

Hi,

actually I have the same "Adjusting resolution from 1280x720 to 640x480" problem.

How can I find out the possible resolutions (e.g. the maximum one) of my new USB webcam?
("eBay" says it is a "WD108 12 Mega Pixel USB Webcam")

Any hints?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6342
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Get max resolution of webcam?

Sun Jun 05, 2016 8:29 am

Code: Select all

v4l2-ctl --list-formats-ext
("sudo apt-get install v4l-utils" if it isn't already installed).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
Ay31415
Posts: 16
Joined: Mon Mar 04, 2013 2:24 pm

Re: Get max resolution of webcam?

Sun Jun 05, 2016 8:56 am

@6by9: Thank you very much! :D Your hint was very helpful.
$ v4l2-ctl -D
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB2.0 PC CAMERA
Bus info : usb-20980000.usb-1.3.3
Driver version: 4.4.11
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format

$ v4l2-ctl --list-formats-ext
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)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 176x144
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
If I understand aright, my "webcam" seems to be not a "12 Mega Pixel" camera. Because of 640 x 480 = 307,200 pixel. :(

IanS
Posts: 217
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Get max resolution of webcam?

Wed Jun 08, 2016 1:03 pm

If you search online for the WD108 camera (e.g. https://www.amazon.com/Megapixel-Webcam ... entries*=0) you can find the word 'interpolated' in the resolution description. This means that the (probably Windows only) driver guesses an additional 38 pixels for every single real pixel that the camera has.
If you want to buy a camera with a decent real resolution then you should look at the supported video resolutions rather than the still image resolution - it is more likely to be the true one. On that basis, real resolutions beyond 1920x1080 (HD resolution) are rare.

Return to “Graphics, sound and multimedia”