Image acquisition with videoinput - timing inconsistencies

1 回表示 (過去 30 日間)
claire
claire 2014 年 11 月 21 日
I'm using the videoinput function to acquire data from a webcam. I set the duration of the movie to 30 sec, but when I compare to the EventLog it appears there were 37 sec between the trigger and the end of the logging. Which one should I believe? Thanks!!
I set webcam parameters as follows
vid = videoinput('winvideo', 1,'RGB24_1280x720');
vid.LoggingMode = 'disk';
triggerconfig(vid, 'manual');
vid.DiskLogger = VideoWriter(movN, 'Motion JPEG AVI');
src = getselectedsource(vid);
frameRates = set(src, 'FrameRate');
src.FrameRate = frameRates{1};
vid.FramesPerTrigger = str2num(src.FrameRate)*durationWebcam;
The FrameRate is 30 fps, and durationWebcam is 30s. The movie writes correctly to file and lasts 30 sec. However, when I look into the event logs for vid, I get the following. event{2} is the trigger, and event{3} is the Stop. AbsTime(3) - AbsTime(2) = 37 sec.
{elog.Type}
ans =
'Start' 'Trigger' 'Stop'
>> elog(2).Data
ans =
AbsTime: [2014 11 20 17 30 14.2441]
FrameMemoryLimit: 2.1475e+09
FrameMemoryUsed: 5529600
FrameNumber: 0
RelativeFrame: 0
TriggerIndex: 1
>> elog(3).Data
ans =
AbsTime: [2014 11 20 17 30 51.9069]
FrameMemoryLimit: 2.1475e+09
FrameMemoryUsed: 0
FrameNumber: 900
RelativeFrame: 900
TriggerIndex: 1

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by