Board index » delphi » know the media info

know the media info


2006-01-31 02:56:19 AM
delphi43
Hello:
I have to know about media files (avi, asf, mpg and so on) the lenght and
other info that I can get. Which components or functions can use to get this
data.
Best regards,
Owen.
 
 

Re:know the media info

Hello Owen,
You can use the AVIInfo function of TVideoGrabber, that returns the frame
count, duration, video size, and the video and audio codecs used.
E.g.:
procedure TForm1.Button1Click(Sender: TObject);
var
Duration: int64;
FrameCount: int64;
VideoWidth: LongInt;
VideoHeight: LongInt;
VideoCodec: string;
AudioCodec: string;
AVIFile: String;
begin
AVIFile := 'c:\YourFolder\YourVideoClip...';
if VideoGrabber.AVIInfo (AVIFile, Duration, FrameCount, VideoWidth,
VideoHeight, VideoCodec, AudioCodec) then begin
Memo1.lines.Add ('file name: ' + AVIFile);
Memo1.lines.Add ('duration (in sec): ' + FormatFloat ('0.00', Duration
/ 10000000));
Memo1.lines.Add ('frame count: ' + IntToStr (FrameCount));
Memo1.lines.Add ('video width: ' + IntToStr (VideoWidth));
Memo1.lines.Add ('video height: ' + IntToStr (VideoHeight));
Memo1.lines.Add ('video codec: ' + VideoCodec);
Memo1.lines.Add ('audio codec: ' + AudioCodec);
end;
end;
You can find TVideoGrabber here: www.datastead.com/vidgrab/
Michel.
"Owen" <XXXX@XXXXX.COM>a écrit dans le message de news:
XXXX@XXXXX.COM...
Quote
Hello:

I have to know about media files (avi, asf, mpg and so on) the lenght and
other info that I can get. Which components or functions can use to get
this
data.

Best regards,
Owen.


 

Re:know the media info

Owen writes:
Quote
Hello:

I have to know about media files (avi, asf, mpg and so on) the lenght and
other info that I can get. Which components or functions can use to get this
data.

Best regards,
Owen.


TRy the free DSPack components
Venkatesh