accessing stills pin of a webcam

I have a webcam, which outputs 5MP images as stills, but can only output VGA as a video stream. Both are encoded using the same JPG encoder. I have a "Matlab support package for USB webcams" installed, and it does not list the 5MP resolution as an option. How can I access this high resoution?
Unfortunately, it is not relevant to my case, as the 5MP still images are truly 5MP, not upscaled from VGA. Furtheremore, the mentioned thread seems dead.
I checked using other software if the cam can output still images in the claimed resolution, and it does. That resolution is available through "Still capture pin". It seems, that webcam objects in Matlab on Windows only support a subset of UVC interface, with the stills capture part totally omitted. Are there any alternatives or workarounds that would help me with my problem?

Answers (1)

Jinal
Jinal on 15 Mar 2023
Hey Maksim,
As per my understanding you are trying to connect to your webcam using the MATLAB support package for USB webcams. While doing so you are unable to get 5MP as an available resolution. At higher resolutions, most webcams support only compressed formats like MJPEG. As of MATLAB R2022b release, the MATLAB support package for USB webcams did not support any compressed video formats, resulting in the Available Resolutions being limited to lower resolutions.
The webcam support package will have the functionality to support MJPEG format from MATLAB R2023a release. Thus, from MATLAB R2023a, the webcam support package will be able to access the highest resolution with all webcams supporting MJPEG at higher resolutions.
Hope this helps.

3 Comments

Dear Jinal,
The camera I am referring to has only one encoding format, and that is MJPG. The same encoding at all resolutions. I am using MATLAB R2022b and I am able to preview all video streams from the camera.
Looking at the camera properties from different software (e.g. AmCap) I can see, that camera's video capture pin contains two resolutions - 320x240 and 640x480. Still capture pin contains 640x480 and 2560x1920. All four formats are encoded using MJPG. The already mentioned AmCap works will all four formats, both video pin and still pin.
It is the still pin resolutions which are not available from the MATLAB support package for USB webcams, only 320x240 and 640x480 are listed as AvailableResolutions. How can I access 2560x1920 from Matlab?
Jinal
Jinal on 16 Mar 2023
Edited: Jinal on 16 Mar 2023
Hi Maksim,
As mentioned, as of 2022b release the web package support package does not support compressed formats. A workaround for this could be using Image acquisition toolbox using winvideo adaptor. You may refer the following link for more information regarding this.
Hope this helps.
Maksim
Maksim on 16 Mar 2023
Edited: Maksim on 16 Mar 2023
It is strange, then. If R2022b does not support compressed formats, why do I see compressed video in Matlab?
I am still interested if R2022b supports still capture pin.

Sign in to comment.

Products

Release

R2022b

Asked:

on 2 Mar 2023

Edited:

on 16 Mar 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!