incorrect video duration using image acquisition toolbox for recording

4 views (last 30 days)
Dear all,
I am using Matlab2014b on a 64-bit windows system. I would like to record videos using a webcam when people are performing my tasks via image acquisition toolbox.
In the task I programmed (see the following scripts), I capture the time when video starts to record and the time it stops. Therefore, the difference between these two timings should reflect the duration of the video recorded in the disk. However, I found that the recorded video is sometimes shorter than this time difference (e.g. time difference is calculated as 4min20sec whereas the duration of the video is 4min17sec). I tried different recording durations (shorter or longer) and different video formats (e.g. mp4, motion avi, uncompressed avi), but the duration inconsistency is still there (albeit sometimes it is consistent, when you re-run the programme, the inconsistency shows up again)
Although the timing difference is not significant, it is critical for my study to know the precise event epoch and people's corresponding performances in the video. It would be great someone could help out this problem. Thank you in advance!
% start the video recording start(vid) Data.videoStart = GetSecs;
% the time when video stops recording Data.videoStop = GetSecs; stop(vid);

Answers (0)

Community Treasure Hunt

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

Start Hunting!