Writing jpeg images to movie - .avi size and timestamp on image

조회 수: 5 (최근 30일)
Initial Conditions
Initial Conditions 2015년 4월 17일
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개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by