Error while using webcam from my laptop

34 views (last 30 days)
Rashmi GP
Rashmi GP on 29 Jan 2017
Commented: Xinyuan ZHANG on 26 Sep 2019
I have installed OS Generic Video Interface Support package to use laptop camera.By running 'webcam' in command window, The camera details in my laptop are displayed with the fol. error:The camera did not return a frame for this resolution.So I am not able to preview camera capturing video nor Matlab is able to detect my webcam.can i know soln for this at the earliest?
  1 Comment
Star Strider
Star Strider on 29 Jan 2017
Did you install and use the MATLAB Support Package for USB Webcams?
What version of MATLAB are you using?

Sign in to comment.

Answers (2)

Prannay Jain
Prannay Jain on 7 Feb 2017
OS Generic Video Interface Support package is used for Image Acquisition Toolbox which does not provide 'webcam' command. To use 'webcam' command, install 'MATLAB Support Package for USB Webcams' instead of 'OS Generic Video Interface Support package'.
Refer to the following documentation link to install Webcam support package:
Since you would like to use laptop camera, you can still use 'OS Generic Video Interface' to preview the camera using the following MATLAB code:
>> v = videoinput('winvideo',1);
>> preview(v)
I am assuming you are on Windows machine. If you are on mac, replace 'winvideo' with 'macvideo'.
I hope this will help you in previewing the camera.

Xinpeng Du
Xinpeng Du on 30 Aug 2019
I had the same issue. Then I found the reason is because another application is using the webcam. After I turned it off, it works.
  1 Comment
Xinyuan ZHANG
Xinyuan ZHANG on 26 Sep 2019
This problem confuses me more than one hours. Thanks for your advice and my problem solved.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by