error in video recording on a windows

12 次查看(过去 30 天)
clear all; %% clear all privious variables
clc;
close all
cam = webcam('Integrated Webcam')
vid = videoinput('winvideo',1);
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb');
% vid.FrameRate =30;
vid.FrameGrabInterval = 1; % distance between captured frames
%start(vid)
aviObject = VideoWriter('myVideo.avi'); % Create a new AVI file
open(aviObject)
for iFrame = 1:150 % Capture 150 frames
% ...
% You would capture a single image I from your webcam here
% ...
I=getsnapshot(vid);
%imshow(I);
F = im2frame(I); % Convert I to a movie frame
writeVideo(aviObject,F); % Add the frame to the AVI file
pause(0.1)
end
close(aviObject); % Close the AVI file
stop(vid);
But I keep getting this error: Error using videoinput (line 532)
winvideo: Image acquisition device is not accessible.
Insufficient system resources exist to complete the requested service.
Make sure no other objects or applications are accessing the same device.
Error in AcquireVideo (line 11)
vid = videoinput('winvideo',1);

回答(1 个)

Gouri Chennuru
Gouri Chennuru 2020-12-15
Hi Ana,
As per my understanding, you have to install the support packages for Image accquisition toolbox adapters.
If the usb webcam doesnt wanna install winvideo, I would recommend you to install Image Acquisition Toolbox Support Package for "OS Generic Video Interface".
Refer to these Link for more information.
Hope this Helps!

标签

Community Treasure Hunt

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

Start Hunting!

Translated by