Writing jpeg images to movie - .avi size and timestamp on image
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
The code below creates a .avi movie from a collection of jpeg files. The code works fine but I want to do two things:
(i)Reduce the size of the resulting video - quality of video is not that important
(ii)Add a visual timestamp to images (video)
Any suggestions on how best to go about this?
Thanks, Dom
if true
% Create a VideoWriter object, in order to write video data to an .avi file using a jpeg compression.
VideoFile = ['op1_mx',num2str(mx),'_',files(f).name];
writerObj = VideoWriter(VideoFile);
fps = 10; % Define the video frames per second speed (fps)
writerObj.FrameRate = fps;
open(writerObj); % Open file for writing video data
% Running over all the files, converting them to movie frames using im2frame and writing the video data to file using writeVideo
for t = 1:length(jpegFilesS)
disp(t);
Frame = imread(strcat(ImagesFolder,'/',jpegFilesS(t).name));
writeVideo(writerObj,im2frame(Frame));
end
% Close the file after writing the video data
close(writerObj);
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!