필터 지우기
필터 지우기

WAIT timeout on image acquisition toolbox

조회 수: 6 (최근 30일)
AT_HYZ
AT_HYZ 2023년 7월 12일
댓글: AT_HYZ 2023년 7월 14일
Hi, I would like to record a video for 5 min using Image acquisition toolbox. I got the error "WAIT reached its timeout before OBJ stopped running." If I remove wait(v), video is not acquired. Could anyone please advise? thanks.
v = videoinput("gentl", 1, "Mono8");
filelocation = "D:\test\mouse 1";
filename = "recording4.mp4";
fullFilename = fullfile(filelocation, filename);
% Create and configure the video writer
logfile = VideoWriter(fullFilename, "MPEG-4");
logfile.FrameRate = 10;
% Configure the device to log to disk using the video writer
v.LoggingMode = "disk";
v.DiskLogger = logfile;
% v.ROIPosition = [0 300 1920 400];
durationinmin = 5;
numFrames = logfile.FrameRate * 60 * durationinmin;
v.FramesPerTrigger = numFrames;
start(v);
% set(v, 'Timeout', 600);
wait(v);
stop(v);
% Wait for all frames to be written to disk
while v.FramesAcquired ~= v.DiskLoggerFrameCount
pause(.1);
end
delete(v)
clear v

채택된 답변

Malay Agarwal
Malay Agarwal 2023년 7월 13일
편집: Malay Agarwal 2023년 7월 13일
Could you try uncommenting the set() line that changes the timeout for v? That will set the timeout to 600 seconds (10 minutes) and should allow the wait(v) to run through without exhausting the timeout. The default timeout is 10 seconds, which is not enough time to capture the 5-minute video. Please see this resource for more information: Create video input object - MATLAB - MathWorks India.
  댓글 수: 2
AT_HYZ
AT_HYZ 2023년 7월 13일
I tried uncommenting th set() line and error showed "Timeout: the property cannot be set while Running is set to "on"" .... how can I solve it? thanks.
AT_HYZ
AT_HYZ 2023년 7월 14일
I put it after "v = videoinput("gentl", 1, "Mono8");" and it works.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by