You could use OpenMediaFile method to open the AVI (or any other multipage file format) for reading and CreateAVIFile of the same object to open an AVI for writing, like in this example:
// writes "Hello!" in each frame of "input.avi" and writes the resulting video to "output.avi"
var
frameIndex:integer;
bmp:TIEBitmap;
io:TImageEnIO;
begin
bmp := TIEBitmap.Create();
io := TImageEnIO.CreateFromBitmap(bmp);
try
io.OpenMediaFile('input.avi');
io.CreateAVIFile('output.avi');
for frameIndex:=100 to 200 do
begin
io.LoadFromMediaFile(frameIndex);
with bmp.Canvas do
begin
Pen.Color := clRed;
Font.Size := 40;
TextOut(0, 0, 'Hello!');
end;
io.SaveToAVI();
end;
io.CloseAVIFile();
io.CloseMediaFile();
finally
io.Free();
bmp.Free();
end;
end;
Just two notes:
1) timings could be differents
2) audio is not supported
3) you need the right codec installed