I was working on a program lately. The program extracts all the frames from a video and then processes them all...Nut, in the processing part, it's way too slow, so I thought to run those processing functions parallel...
But, as I'm new in Delphi and ain't got any experience in Multithreading, I was hoping someone would know how to do it.
Here is the function that I'm using currently:
sl.loadfromfile(log);
for i := 0 to (SL.Count div 2) - 1 do
begin
WriteLn('Processing extracted frames ' + IntToStr(i + 1) +
' of ' + IntToStr(SL2.Count div 2));
if FileExists(TempDir + IntToHex(i, 8) + '.jpg') then
ExecAndWait(SrcDir + 'packjpg.exe', AnsiRightStr(Str[2], 2) + ' ' +
'"' + TempDir + IntToHex(i, 8) + '.jpg' + '" "' + TempDir +
IntToHex(i, 8) + '.pjg' + '" , TempDir, true, true);
end;