TVideoGrabber.AVIInfo

Prev

Next

TVideoGrabber

Methods

 




































































































Returns information about the specified video clip.


Declaration
function AVIInfo (AVIFile: string; out Duration: LargeInteger; out FrameCount: LargeInteger; out VideoWidth: LongInt; out VideoHeight: LongInt; out VideoFrameRateFps: Double; out AvgBitRate: LongInt; out AudioChannels: LongInt; out AudioSamplesPerSec: LongInt; out AudioBitsPerSample: LongInt; out VideoCodec: string; out AudioCodec: string): Boolean;


bool __fastcall AVIInfo (wchar_t *AVIFile, __int64 &Duration, __int64 &FrameCount, int &VideoWidth, int &VideoHeight, double &VideoFrameRateFps, int &AvgBitRate, int &AudioChannels, int &AudioSamplesPerSec, int &AudioBitsPerSample, wchar_t *&VideoCodec, wchar_t *&AudioCodec)


Function AVIInfo(AVIFile As String, Duration, FrameCount, VideoWidth, VideoHeight, VideoFrameRateFps, AvgBitRate, AudioChannels, AudioSamplesPerSec, AudioBitsPerSample, VideoCodec, AudioCodec) As Boolean

Description

Used to retrieve information about the video clip specified as parameter.

Duration: returns the duration of the AVI file, expressed in 100 nanoseconds units, returns 0 upon failure,
FrameCount: returns the total frame count if available, otherwise returns 0,
VideoWidth: returns the width of the video
VideoHeight: returns the height of the video
VideoFrameRateFps: returns the frame rate in frames per second
AvgBitRate: returns the average bit rate of the clip
AudioChannels: returns the number of audio channels
AudioSamplesPerSec: returns the audio sample frequency in Hz
AudioBitsPerSample: returns the number of bits per sample
VideoCodec:/cf0 returns the name of the video codec in which the video stream of the clip is encoded (if any)
AudioCodec:/cf0 returns the name of the audio codec in which the audio stream of the clip is encoded (if any)

E.g.:

procedure TForm1.Button1Click(Sender: TObject);
var
   Duration: int64;
   FrameCount: int64;
   VideoWidth: LongInt;
   VideoHeight: LongInt;
   VideoCodec: string;
   AudioCodec: string;
   VideoFrameRateFps: Double;
   AvgBitRate: LongInt;
   AudioChannels: LongInt;
   AudioSamplesPerSec: LongInt;
   AudioBitsPerSample: LongInt;
begin
   if VideoGrabber.AVIInfo (edtPlayerClip.Text, Duration, FrameCount, VideoWidth, VideoHeight, VideoFrameRateFps, AvgBitRate, AudioChannels, AudioSamplesPerSec, AudioBitsPerSample, VideoCodec, AudioCodec) then begin
      ShowMessage('');
      ShowMessage(edtPlayerClip.Text + ':');
      ShowMessage('duration (in sec): ' + FormatFloat ('0.00', Duration / 10000000));
      ShowMessage('frame count: ' + IntToStr (FrameCount));
      ShowMessage('video width: ' + IntToStr (VideoWidth));
      ShowMessage('video height: ' + IntToStr (VideoHeight));
      ShowMessage('video frame rate (fps): ' + FormatFloat ('0.00', VideoFrameRateFps));
      ShowMessage('average bit rate (kb/s): ' + IntToStr (AvgBitRate div 1024));
      ShowMessage('audio channels: ' + IntToStr (AudioChannels));
      ShowMessage('audio samples/sec: ' + IntToStr (AudioSamplesPerSec));
      ShowMessage('audio bits per sample: ' + IntToStr (AudioBitsPerSample));
      ShowMessage('video codec: ' + VideoCodec);
      ShowMessage('audio codec: ' + AudioCodec);
   end
   else begin
      ShowMessage(edtPlayerClip.Text + ' clip not found.');
   end;end;


See Also
Player features Recording methods and properties TAVIMuxConfig TOnPlayerStateChanged TPlayerState TASFDeinterlaceMode TAutoFileName TOnPlayerBufferingData TOnRecordingCompleted TOnRecordingReadyToStart TRecordingMethod TSyncPreview AudioChannelRenderMode AudioRecording AudioStreamNumber AudioSyncAdjustment AutoFileNameMinDigits AutoStartPlayer AVIDuration AVIDurationUpdated AVIFormatOpenDML AVIHeaderInfo AVIInfo2 ClosePlayer Encoder_SetInt FastForwardPlayer HoldRecording IsPlayerAudioStreamAvailable IsPlayerVideoStreamAvailable IsRecordingPaused Last_Clip_Played Last_Recording_FileName OnBacktimedFramesCountReached OnCopyPreallocDataCompleted OnCopyPreallocDataProgress OnCopyPreallocDataStarted OnCreatePreallocFileCompleted OnCreatePreallocFileStarted OnDiskFull OnPlayerBufferingData OnPlayerEndOfStream OnPlayerStateChanged OnPlayerUpdateTrackbarPosition OnRecordingCompleted OnRecordingPaused OnRecordingReadyToStart OnRecordingStarted OnReencodingCompleted OnReencodingStarted OpenPlayer OpenPlayerAtFramePositions OpenPlayerAtTimePositions PausePlayer PauseRecording PlayerAudioCodec PlayerAudioRendering PlayerDuration PlayerDVSize PlayerFastSeekSpeedRatio PlayerFileName PlayerForcedCodec PlayerFrameCount PlayerFramePosition PlayerFrameRate PlayerFrameStep PlayerRefreshPausedDisplay PlayerRefreshPausedDisplayFrameRate PlayerSpeedRatio PlayerTimePosition PlayerTrackBar PlayerTrackBarScale PlayerTrackBarSynchrone PlayerVideoCodec PreallocCapFileCopiedAfterRecording PreallocCapFileEnabled PreallocCapFileName PreallocCapFileSizeInMB RecordingBacktimedFramesCount RecordingCanPause RecordingDuration RecordingFileName RecordingFileSizeMaxInMB RecordingFourCC RecordingHeight RecordingInNativeFormat RecordingKBytesWrittenToDisk RecordingMethod RecordingSize RecordingTimer RecordingTimerInterval RecordingWidth ResumeRecording RewindPlayer RunPlayer RunPlayerBackwards SaveCompressorSettingsToDataString SetMultiplexerFilterByName ShowDialog SourceStream StartAudioRecording StartRecording StartSynchronized StopPlayer StopRecording StoragePath SynchronizationRole Synchronized SyncPreview VideoHeight_PreferredAspectRatio VideoWidth_PreferredAspectRatio