Azzera filtri
Azzera filtri

convert jpg file to animation problem

1 visualizzazione (ultimi 30 giorni)
Yu Li
Yu Li il 1 Ago 2018
Commentato: Dinesh Iyer il 3 Ago 2018
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 Commento
Dinesh Iyer
Dinesh Iyer il 3 Ago 2018
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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Animation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by