Réponse acceptée !
MathUZalem
Salut, AviFileInfo permet de récupèrer qqs Informations sur le contenus du fichier __.avi.
Exemple: faire une application (TForm1) avec 1 OpenDialog & 4 TLabel; +
var pf: PAVIFILE; hr: HRESULT;
procedure TForm1.FormCreate(Sender: TObject);
var AFI: TAVIFILEINFO;
procedure Zut(ouvert: boolean);
begin
Form1.Label1.Caption:= 'Pbs avec '+ExtractFileName(Form1.OpenDialog1.FileName);
if ouvert then AVIFileRelease(pf); // on ferme...
AVIFileExit; HALT;
end;
begin
if OpenDialog1.Execute then begin
AVIFileInit;
hr:= AVIFileOpen(pf, PChar(OpenDialog1.FileName), OF_SHARE_DENY_WRITE, nil);
if (hr <> AVIERR_OK) then Zut(False);
Label1.Caption:= ExtractFileName(OpenDialog1.FileName)+' ouvert ';
hr := AVIFileInfo(pf, @AFI, SizeOf(TAVIFILEINFO));
if (hr <> AVIERR_OK) then Zut(True); // Tout va bien...
with AFI do begin
Label2.Caption:= 'Nb de ''Flux'':'+IntToStr(dwStreams);
Label3.Caption:= 'Taille:'+IntToStr(dwWidth)+'x'+IntToStr(dwHeight);
Label4.Caption:= 'Longueur:'+IntToStr(dwLength);
end;
AVIFileRelease(pf); AVIFileExit;
end;
end;
désolé pour le retard, je passe pas souvent par ici, bon code 