MATLAB: Time stamp in video files (image to video file conversion)

image to video conversiontime stamp in video files

Hi,
I a making video file from set of 500 .bmp image files, the time gap between each image is 0.0002 sec. Here, I would like to add time stamp in my video, please help me with this.. I am using the below standard code for image to video conversion
myFolder = 'Y:\Processing\';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.bmp');
Files = dir(filePattern);
writerObj = VideoWriter('video1');
writerObj.FrameRate = 5;
open(writerObj);
for frameNumber = 1 : length(Files)
baseFileName = pngFiles(frameNumber).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
thisimage = imread(fullFileName);
imshow(thisimage);
drawnow;
writeVideo(writerObj, thisimage);
end
close(writerObj);

Best Answer

If you have the Computer Vision Toolbox, use insertText().
If not, you have to use text() and then getframe() but the image size will be changed (since it's a screenshot) so then you need to follow that by imresize() to resize it back to the original size.