[Lazarus] Problems using RunCommandIndir with Lazarus 2.0.0

info at voiceliveeditor.com info at voiceliveeditor.com
Tue Mar 5 20:57:58 CET 2019


Just done a quick google,
would telling ffmpeg to log output to errlog or nul help.

https://superuser.com/questions/555289/is-there-a-way-to-disable-or-hide-output-thrown-by-ffmpeg

Just a thiught


Josh

-----Original Message----- 
From: Bo Berglund via lazarus
Sent: Tuesday, March 5, 2019 7:48 PM
To: lazarus at lists.lazarus.freepascal.org
Cc: Bo Berglund
Subject: Re: [Lazarus] Problems using RunCommandIndir with Lazarus 2.0.0

On Sat, 02 Mar 2019 09:56:07 +0100, Bo Berglund via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>Now for another RunCommandInDir problem:
>----------------------------------------
>When I run the command to extract the information a black command
>window is briefly flashed on screen and then disappears.
>
>Is there some way to make this window minimized or invisible while it
>runs?

So I have solved the general problems of using RunCommandInDir with
ffmpeg. It does work.

But if I command a video edit with multiple cuts being extracted and
later combined there is a succession of many black command windows
being shown on top of the main GUI form for a fraction of a second up
to a couple of seconds.
It really looks very ugly.

Is there absolutely no way to hide or minimize these windows during
execution?

I am using Lazarus 2.0.0 with fpc 3.0.4 (64 bit versions) in Windows 7
x64.

This is till a problem that fits the topic of this thread...

This is the function I call in a loop once for each cutout part of the
video file:

function ExtractVideoSection(InputFile, OutputFile: string; Start,
Duration: integer; OverwriteOutput: boolean = true): boolean;
var
  arguments: array of string;
  returnstr: string;
  executable: string;
begin
  Result := false;
  if not FileExists(InputFile) then exit;
  if (not OverwriteOutput) and FileExists(OutputFile) then exit;

  if FileExists(OutputFile) then DeleteFile(OutputFile);

  SetLength(arguments, 10);
  executable := 'ffmpeg.exe';
  arguments[0] := '-ss';
  arguments[1] := FormatTimeDiff(Start);
  arguments[2] := '-i';
  arguments[3] := InputFile;
  arguments[4] :=  '-to';
  arguments[5] :=  FormatTimeDiff(Duration);
  arguments[6] :=  '-c';
  arguments[7] :=  'copy';
  arguments[8] :=  OutputFile;
  arguments[9] :=  '-hide_banner';

  Result := RunCommandIndir(ExtractFileDir(OutputFile), executable,
arguments, returnstr, [poWaitOnExit,poStderrToOutPut]);
end;

Every invocation of RunCommandInDir() causes a command window to be
shown on screen.


-- 
Bo Berglund
Developer in Sweden

-- 
_______________________________________________
lazarus mailing list
lazarus at lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 



More information about the lazarus mailing list