vidFile = 'D:\filename.avi';
extInterval = 0.1; %extraction interval (seconds)
outFolder = 'F:\target folder';
 
vid = VideoReader(vidFile);
vidDuration = vid.duration;
[y,m,d] = ymd(datetime('today'));
curDate = datetime(y,m,d);
for t = 0: extInterval:vidDuration
    vid.CurrentTime = t;
    img = readFrame(vid);
 
    curDateTime = curDate + seconds(t);
    dt = datestr(curDateTime, 'yyyy-mm-dd (HH-MM-SS-FFF)');
    display(dt);
    imwrite(img, [outFolder '\' dt '.png']);
end
