Skip to content

How to Filter console output #103

@FedeC87p

Description

@FedeC87p

0

`
I try to filter the output in console with the Medallion.Shell

var command = Command.Run( ffMpegBinaryPath, args); command.RedirectTo(Console.OpenStandardOutput()); command.RedirectFrom(Console.OpenStandardInput()); command.RedirectStandardErrorTo(Console.OpenStandardError());
In this way i can't filter the output...

before I used the ProcessInfo directly, is there a way to get the same result with that library Medallion?

`
using var FFmpegProcess = Process.Start(procStartInfo) ?? throw new InvalidOperationException("null process");

            FFmpegProcess.ErrorDataReceived += delegate (object sender, DataReceivedEventArgs received)
            {
                if (received?.Data is not null &&
                    received.Data.StartsWith("frame=", StringComparison.InvariantCulture))
                {
                    Console.WriteLine(received.Data);
                    Console.SetCursorPosition(0, Console.CursorTop - 1);
                }
            };

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions