How to read live output from another process ?

Vinod K Chandran kcvinu82 at gmail.com
Fri Jun 23 23:37:29 UTC 2023


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.


More information about the Digitalmars-d-learn mailing list