How to fix "The camera did not return a frame for this resolution" error when creating second webcam object?

37 views (last 30 days)
Background: I am using a Surface Pro 3 with an i3 and 4GB of RAM running WINDOWS 10. It has one USB port which I used to connect a USB 3.0 hub to it with 4 ports. I connect two (MicroSoft) LifeCam Cinema webcam devices to the USB hub. I am running Matlab 2016B with Image Acquisition, Image Processing, and webcam support package and many more toolboxes that I can list at request.
Code (which produces the error):
>> webcamlist
ans =
2×1 cell array
'Microsoft® LifeCam Cinema(TM)'
'Microsoft® LifeCam Cinema(TM)'
>> cam1=webcam(1)
cam1 =
webcam with properties:
Name: 'Microsoft® LifeCam Cine…'
Resolution: '640x480'
AvailableResolutions: {1×12 cell}
WhiteBalance: 4500
Saturation: 83
ExposureMode: 'auto'
Contrast: 5
Zoom: 0
Pan: 0
Brightness: 143
WhiteBalanceMode: 'auto'
FocusMode: 'manual'
Sharpness: 25
Focus: 14
Tilt: 0
Exposure: -6
BacklightCompensation: 0
>> cam2=webcam(2)
cam2 =
webcam with properties:
Name: 'Microsoft® LifeCam Cine…'
Resolution: '640x480'
AvailableResolutions: {1×12 cell}
WhiteBalance: 4500
Saturation: 83
ExposureMode: 'auto'
Contrast: 5
Zoom: 0
Pan: 0
Brightness: 143
WhiteBalanceMode: 'auto'
FocusMode: 'manual'
Sharpness: 25
Focus: 14
Tilt: 0
Exposure: -6
BacklightCompensation: 0
The camera did not return a frame for this
resolution.
What I've Tried/More Info: -Uninstalling the driversand reinstalling
-Connecting the cameras in a different order (I found out both work, it is always the second webcam object which doesnt work)
-Restarting my computer and matlab
-Downloading the Image Acquisition toolbox and adapters for that toolbox
-This works on my computer at school (don't know every detail about that computer; also it is in another country at the moment)
-Previewed the camera that gets the error and it is always black (no image) whereas the webcam that didn't get the error (always the first cam object) is previewable (displays video in real time).
-Not sure if Windows 10 is the problem since it partially works? I just realized the mathworks page says Windows 7 is the only Windows that is compatible with the USB Webcam Support Package....
Any help would be greatly appreciated! Thank you in advance! And sorry if I have broken any forum rules or haven't provided enough info; this is the first time I'm ever resorting to a forum haha.
Thanks!
  3 Comments
Shawn Saini
Shawn Saini on 25 Feb 2017
I found out the problem was using Windows 10. I didn't realize that could be a problem since it partially worked, as I could call webcamlist etc and it worked fine with one camera. I switched to a windows 7 system and it worked. Apparently windows 7 is the latest Windows OS that is supported, as per Mathworks page for Webcam Support Package
Hassan Mehmood Khan
Hassan Mehmood Khan on 10 Apr 2017
I found the same issue. I am using matlab R2016a. I am using two Logitech Cameras. and one of them was showing: " The camera did not return a frame for this resolution." . It was solved once i exit the default software of webcam, and exit all my applications which might be using Webcam like Skype OR Viber. Then i restart the Matlab.
Then the issue was solved. Both webcam can be read by Matlab for Image Processing.

Sign in to comment.

Accepted Answer

Shawn Saini
Shawn Saini on 25 Feb 2017
Answering my own question: Windows 10 was the problem. Apparently Windows 7 is the latest Windows OS that is supported by Webcam Support Package. That was a tricky answer to find since it installed without a problem and even partially worked since I could use the Webcam Support Package functions like webcamlist and even use it for one webcam, but not multiple (two) webcams... Hope this helps hundreds of other people not waste hours trying to fix this problem like I did.

More Answers (2)

Islam Gaied
Islam Gaied on 17 Nov 2019
This is happened to me a 100 times , 1 cam will work and the other no cause you have a logiciel on ur pc connect to one of the cameras , the solution is simple just block acess to ur cams for all ur programs except matlab ( like skype , google chrome safari ...)
For all ur navigators like chrome you need to delete all data on ur browser ( cache , history ....) then block the camera

Madhura Suresh
Madhura Suresh on 18 Apr 2017
Can you switch the resolution to a different one, using:
w.Resolution = '<insert value here>';
  2 Comments
machhindra bhamare
machhindra bhamare on 6 Jul 2018
i have same problem ,i connect three microsoft cameras ,to usb 3.0 hub ,at the time of processing its loses resolution,this is the hardware issue ,i remove the usb 3.0 hub then is ok

Sign in to comment.

Categories

Find more on MATLAB Support Package for IP Cameras in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!