0

I seen this queston, but can't leave a comment there.

How to interrupt encoding from delphi? Example, on my form existing a "Cancel" button. How to send a interrupt command? In ffmpeg it's q key, but I don't know, how to send key codes from delphi to console application for it.

And also second queston about progressbar: I need, that it show state of encoding process (example, seeking from 0 to 100 percent while encoding, i.e. follow ffmpeg's progress values).

ascripter
  • 5,665
  • 12
  • 45
  • 68

1 Answers1

0

If, as indicated in the question you linked to, you are running ffmpeg as a spawned process (ShellExecute / CreateProcess / WinExec etc) then to quit that running process you would simply kill it.

To display progress in your UI you would need to capture the stdout/stderr output of the ffmpeg process and parse that output to extract the progress information to determine what and how to reflect that in your UI.

Running processes and capturing output is relatively straightforward but there are libraries that can help simplify and allow you to focus on your specific application needs. Examples (but not specific to ffmpeg) can be found in this SO question and answers (among numerous other sources that google will help you find).

Deltics
  • 22,162
  • 2
  • 42
  • 70
  • 1
    Note: ffmpeg logs to stderr - this is because ffmpeg can pipe its processed output. – Gyan Jul 05 '18 at 20:00