Главная страница | назад





Article #17075: Frame count of an AVI

 Question and Answer Database

FAQ2075D.txt   Frame count of an AVI
Category   :VCL
Platform    :All
Product    :All 32 bit  

Question:
How can I tell how many frames are in a given AVI file and how long
the AVI file will play?


Answer:
The TMediaPlayer provides this information by setting the
TimeFormat property and querying the Length property. The 
following example demonstrates retrieving the number of 
frames and the play time of a given AVI file.

Example:

procedure TForm1.Button1Click(Sender: TObject);
begin
  MediaPlayer1.TimeFormat := tfFrames;
  ShowMessage('Number of frames = ' + 
    IntToStr(MediaPlayer1.Length));
  MediaPlayer1.TimeFormat := tfMilliseconds;
  ShowMessage('Number of milliseconds = ' +
              IntToStr(MediaPlayer1.Length));
end;

7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99