convert jpg file to animation problem

2 visualizaciones (últimos 30 días)
Yu Li
Yu Li el 1 de Ag. de 2018
Comentada: Dinesh Iyer el 3 de Ag. de 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 comentario
Dinesh Iyer
Dinesh Iyer el 3 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by