Error while using webcam from my laptop

14 ビュー (過去 30 日間)
Rashmi GP
Rashmi GP 2017 年 1 月 29 日
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 件のコメント
Star Strider
Star Strider 2017 年 1 月 29 日
Did you install and use the MATLAB Support Package for USB Webcams?
What version of MATLAB are you using?

サインインしてコメントする。

回答 (2 件)

Prannay Jain
Prannay Jain 2017 年 2 月 7 日
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.
  1 件のコメント
Jonathan Gadiel Ramírez Martínez
Jonathan Gadiel Ramírez Martínez 2023 年 5 月 15 日
Hello, after using my code successfully, I opened the camera app for other reasons, and then when I wanted to continue using my code I started experiencing the same problem of the post. I have all the packages installed, but something weird is happening. First, it doesn't show me anything and gives me the same warning as in the post. However, after using this code that you provided:
>> v = videoinput('winvideo',1);
>> preview(v)
the camera starts working again. I don't know what the problem is. Can you please help me?

サインインしてコメントする。


Xinpeng Du
Xinpeng Du 2019 年 8 月 30 日
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.
  2 件のコメント
Xinyuan ZHANG
Xinyuan ZHANG 2019 年 9 月 26 日
This problem confuses me more than one hours. Thanks for your advice and my problem solved.
Jonathan Gadiel Ramírez Martínez
Jonathan Gadiel Ramírez Martínez 2023 年 5 月 15 日
How did you found the other application using the webcam?

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by