Why do I get a time out while getting a from a USB webcam?

조회 수: 14 (최근 30일)
Bharath Lohray
Bharath Lohray 2015년 10월 4일
답변: Enoch 2016년 9월 18일
How do I fix this problem. I webcam works fine on skype and I had all my chat apps off too. Preview gets me a window with a black image.
>> cam= webcam(1);
>> cam
cam =
webcam with properties:
Name: 'Logitech HD Pro Webcam C920'
Resolution: '640x480'
AvailableResolutions: {1x17 cell}
WhiteBalance: 4000
Saturation: 128
Exposure: -4
Zoom: 100
Gain: 0
Focus: 0
Brightness: 100
Tilt: 0
Contrast: 128
Sharpness: 128
Pan: 0
ExposureMode: 'auto'
BacklightCompensation: 0
>> img = snapshot(cam);
Error using matlab.webcam.internal.WebcamController/getCurrentFrame
Time out occured while trying to get a frame from the webcam.
Error in webcam/snapshot (line 227)
[image, timestamp] = obj.CamController.getCurrentFrame();
I am using 2015b on Windows 10. I have skype and google hangouts installed. I have 2 webcams - the notebook inbuilt webcam and a C920 Logitech external camera.
The video chat app test shows the preview fine. I made sure that these apps were closed while trying to capture images.
The issue occurs with both cameras. Also, the problem persisted even after a reboot.
  댓글 수: 1
Bharath Lohray
Bharath Lohray 2015년 10월 6일
The problem mysteriously vanished. I attached the webcam to my computer instead of the self powered USB3 hub. It worked. Then attached it back to the hub. It still worked.
Undetirministic Machine!

댓글을 달려면 로그인하십시오.

답변 (2개)

Madhura Suresh
Madhura Suresh 2015년 10월 5일
Hi Bharath,
What version of MATLAB are you using and what OS are you on? Can you also confirm that other apps that might be using the webcam(like Skype/ Logitech software) are closed before you run this in MATLAB?
  댓글 수: 1
Bharath Lohray
Bharath Lohray 2015년 10월 5일
I am using 2015b on Windows 10. I have skype and google hangouts installed. I have 2 webcams - the notebook inbuilt webcam and a C920 Logitech external camera.
The video chat app test shows the preview fine. I made sure that these apps were closed while trying to capture images.
The issue occurs with both cameras. Also, the problem persisted even after a reboot.

댓글을 달려면 로그인하십시오.


Enoch
Enoch 2016년 9월 18일
I do it by running matlab as administrator

Community Treasure Hunt

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

Start Hunting!

Translated by