1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| for i=1:20
vid = nom;
filmavi1 = mmreader(vid);
for h = 1:numel(Valeurs{i})-1
nFr = Valeurs{i}(h+1)-Valeurs{i}(h);
avi(1:nFr) = struct('cdata', zeros(filmavi1.Height, filmavi1.Width, 3, 'uint8'), 'colormap', []);
cpt = 1;
for k = Valeurs{i}(h):Valeurs{i}(h+1)
avi(cpt).cdata = read(filmavi1, k);
cpt = cpt+1;
end
nomf = sprintf('%s-%d.avi',filename,h);
if exist(fullfile('D:',nomRep),'dir')~=7
mkdir(fullfile('D:',nomRep));
end
nom = fullfile('D:\sub-vid', nomRep, nomf);
movie2avi(avi, nom, 'compression', 'indeo5', 'fps', 25)
clear avi
end
end |
Partager