convert jpg file to animation problem
2 ビュー (過去 30 日間)
古いコメントを表示
Hi:
I tried to convert a series of jpg files to a movie. but the created .avi file could not be open.
I attached the sample code and test file, could someone give me some suggestions?
clear all
clc
load test_name
v = VideoWriter('test.avi');
open(v);
for ii = 1:length(test_name)
fprintf('operating on file: %s.\n',test_name{ii})
F=imread(test_name{ii});
writeVideo(v,F)
end
close(v);
by the way, the test code I attached operate the file one by one. assuming that I have 1000 frames, is there anyway to optimize it to parallel computing?
Thanks! Yu
1 件のコメント
Dinesh Iyer
2018 年 8 月 3 日
In your animation since the images have to be written to video in a specific order, parallelization will not really help as you still have to wait for the nth image to be read and written until the (n+1)th frame is written. I believe VideoWriter has made some performance improvements in 18a as per the release notes. Maybe this should help speed up yyour operation.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!