error in video recording on a windows

6 views (last 30 days)
Ana Guerrero Rosario
Ana Guerrero Rosario on 10 Dec 2020
Answered: Gouri Chennuru on 15 Dec 2020
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);

Answers (1)

Gouri Chennuru
Gouri Chennuru on 15 Dec 2020
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!

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!