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;

05-11 11:03