ImageEn, unit imageenio

TImageEnIO.CreateAVIFile

TImageEnIO.CreateAVIFile


Declaration

function CreateAVIFile(const FileName: WideString; Rate: Double = 15.0; const codec: AnsiString='DIB '; const WavFilename: WideString = ''): TIECreateAVIFileResult;


Description

Creates a new, empty AVI file.


FileName

: Full destination path

Rate

: Specifies the number of frames per second

Code

: The compression codec to use (must be installed on system) as a four characters string.For example:
'cvid' : cinepak by Radius
'msvc' : Microsoft Video 1
'mp42' : Microsoft MPEG4 V2

More codecs are listed at www.fourcc.org or by searching for registered fourcc codes and wave formats on MSDN
If a codec is not specified, a dialog box appears to allow the user to select a compression.


WavFilename

: An optional audio file to include as an audio track. Must be WAV format. Output video will match length of the audio file if longer than the video content.
You can save each frame to the created AVI file using the SaveToAVI method.
Finally, call CloseAVIFile to close the file.


Demos

Demo  Demos\VideoCapture\DesktopToAvi\DesktopToAvi.dpr
Demo  Demos\VideoCapture\ImagesToAvi\ImagesToAvi.dpr


Example

ImageEnView.IO.CreateAVIFile('D:\output.avi', 20, 'DIB ');

// save frame 0
ImageEnView.IO.LoadFromFile('C:\frame0.jpg');
ImageEnView.IO.Params.BitsPerSample := 8;
ImageEnView.IO.Params.SamplesPerPixel := 1;
ImageEnView.IO.SaveToAVI;

// save frame 1
ImageEnView.IO.LoadFromFile('C:\frame1.jpg');
ImageEnView.IO.Params.BitsPerSample := 8;
ImageEnView.IO.Params.SamplesPerPixel := 1;
ImageEnView.IO.SaveToAVI;

// close the file
ImageEnView.IO.CloseAVIFile;