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 Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by