[Mono-osx] OutputDataReceived event not raised when using the Process class together with Ffmpeg?

Michael Hutchinson m.j.hutchinson at gmail.com
Fri Jun 8 23:26:49 UTC 2012


On 7 June 2012 06:36, johot <johan.otterud at gmail.com> wrote:
> As you can see all the "frame =" parts comes in a single call that is why it
> is starting with the string "ERR" which I add before the output.
>
> Can you read the output buffer without waiting for new line characters?

You may be able to get more granular reads by reading the process's
stdout/stderr streams directly from threads. Beware that the threading
and cancellation support is easy to mess up. Here's an example that
works, though it's more complicated than it needs to be because it
includes workarounds for long-ago-fixed Mono bugs:

https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-osx mailing list