Bonjour
je cherche a diviser une vidéo en des sub-vidéo puis les enregistrer dans un répertoire qui a le même nom que la vidéo. alors pour ce faire j'utilise la boucle suivante:
alors j'ai deux questions SVP:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 %20 vidéos for i=1:20 filename=['actioncliptest0000',int2str(i)]; fileinfo = aviinfo(filename); tab = [1 21 40]; filmavi1=mmreader(vid); nFrames= get(filmavi1,'numberOfFrames'); vidHeight = filmavi1.Height; vidWidth = filmavi1.Width; for i=1: length(tab)-1 p=tab(i); z=tab(i+1)-tab(i); for jj=p:(tab(i+1))-1 % Preallocate movie structure. avi(p:z)= struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap', []); % lire 1 image à la fois. j=1; for k = 1:z avi(j).cdata = read(filmavi1, k); j=j+1; end end nom=['test2modif',int2str(i),'.avi']; nom movie2avi(avi,nom,'compression', 'indeo5','fps',50) end end
La 1ère : comment rediriger ces subvideo dans un répertoire qui porte le nom de la vidéo.
La 2ème: j'ai l'erreur suivante:
lors de l’exécution de cette ligne:Indeo codecs are not supported in this version of Windows. You must specify a different codec. See Mathworks Technical Solution 1-4G50RI for more information. Error in ==> movie2avi at 63 avimov = avifile(filename,varargin{:}); Error in ==> sub_video at 52 movie2avi(avi,nom,'compression', 'indeo5','fps',50)
c'est un problème liée au codec utilisé j'ai lu ici http://www.mathworks.com/support/sol...0RI/index.html mais je n'ai pas pu trouver une solution
Code : Sélectionner tout - Visualiser dans une fenêtre à part movie2avi(avi,nom,'compression', 'indeo5','fps',50)
(j'ai windows7 et MATLAB R2010a)
Partager