ImageEn, unit imageenio

TImageEnIO.DShowParams

TImageEnIO.DShowParams


Declaration

property DShowParams: TIEDirectShow;


Description

DShowParams is a TIEDirectShow instance which allows control of some Direct Show features, such as video capture, audio capture, multimedia files capture as well video rendering, and multimedia file writing.




Demos

Demo  Demos\VideoCapture\DirectShow1\DShow.dpr
Demo  Demos\VideoCapture\DirectShow2\DShowCap.dpr
Demo  Demos\VideoCapture\VideoEffects\VideoEffects.dpr
Demo  Demos\Display\VideoPlayer\VideoPlayer.dpr

Note: To use DShowParams, You must use a TImageEnView with a parent


Examples

Capture Skeleton

// Fills ComboBox1 with the names of all video capture inputs
ComboBox1.Items.Assign( ImageEnView1.IO.DShowParams.VideoInputs );

// Select the first video input available
ImageEnView1.IO.DShowParams.SetVideoInput( 0 );

// Enables frame grabbing
// ImageEnView1.OnDShowNewFrame event occurs for each frame acquired
ImageEnView1.IO.DShowParams.EnableSampleGrabber := True;

// connect to the video input: this begins video capture
ImageEnView1.IO.DShowParams.Connect;

...

// Disconnect the video input
ImageEnView1.IO.DShowParams.Disconnect;

Capture a frame

// We are inside the OnDShowNewFrame event:
procedure Tfmain.ImageEnView1DShowNewFrame(Sender: TObject);
begin
   // copy current sample to ImageEnView bitmap
   ImageEnView1.IO.DShowParams.GetSample(ImageEnView1.IEBitmap);
   // refresh ImageEnView1
   ImageEnView1.Update();
end;

Setting video capture size

// We'd like to acquire 640x480 frames
ImageEnView1.IO.DShowParams.SetCurrentVideoFormat( 640, 480, '' );

Select a TV Tuner channel

// We want channel 15
ImageEnView1.IO.DShowParams.TunerChannel := 15;

Showing capture card dialogs

// Show video dialog
ImageEnView1.IO.DShowParams.ShowPropertyPages(iepVideoInput, ietFilter);

// Show video source dialog
ImageEnView1.IO.DShowParams.ShowPropertyPages(iepVideoInputSource, ietFilter);

// Show tuner dialog
ImageEnView1.IO.DShowParams.ShowPropertyPages(iepTuner, ietFilter);

// Show format dialog
ImageEnView1.IO.DShowParams.ShowPropertyPages(iepVideoInput, ietOutput);

// Read from a multimedia file, and save with another compression

ImageEnView1.IO.DShowParams.FileInput := 'input.avi';
ImageEnView1.IO.DShowParams.FileOutput := 'output.avi';
ImageEnView1.IO.DShowParams.SetVideoCodec( ... );
ImageEnView1.IO.DShowParams.SetAudioCodec( ... );

ImageEnView1.IO.DShowParams.EnableSampleGrabber := True;
ImageEnView1.IO.DShowParams.Connect;

See the \VideoCapture\DirectShow1\ and \VideoCapture\DirectShow2\ demos for more info.