How to read live output from another process ?
Ferhat Kurtulmuş
aferust at gmail.com
Thu Jun 29 10:30:47 UTC 2023
On Friday, 23 June 2023 at 23:37:29 UTC, Vinod K Chandran wrote:
> Hi all,
> I am trying to create a program which burns time codes to a
> video. I am using ffmpeg for this. So far, I can successfully
> start ffmpeg in another thread and stop it when I need. But I
> can't read the live outputs from ffmpeg. This is my code.
> ```d
> void onBtnBurnClick(Control c, EventArgs e) {
> if (!burnStarted) {
> burnStarted = true;
> btnBurn.text = "Stop Burning";
> auto ffCmd = makeFFMPEGCommand(selVideo);
> // ffPipe is a global ProcessPipes
> auto tsk = task!runFFMPEG(ffCmd, &ffPipe, frm.handle);
> tsk.executeInNewThread();
> } else {
> ffPipe.stdin.writeln("q");
> ffPipe.stdin.close();
> btnBurn.text = "Burn Time Code";
> }
> }
> ```
> This is a button's click event.
I used something similar here:
https://github.com/aferust/oclcv/blob/main/examples/threshold-video/source/app.d
More information about the Digitalmars-d-learn
mailing list