Skip to content
Discussion options

You must be logged in to vote

You'll have to create your own PipeTarget. Rough sketch:

FfMpegToolJsonSchema.PacketInfo packetInfo;

var stdOutTarget = PipeTarget.Create(async (stdOutStream, cancellationToken) =>
{
    packetInfo = await JsonSerializer.DeserializeAsync<FfMpegToolJsonSchema.PacketInfo>(
        stdOutStream,
        ConfigFileJsonSchema.JsonReadOptions,
        cancellationToken
    );
});

var cmd = command
  .WithStandardOutputPipe(stdOutTarget)
  .WithStandardErrorPipe(PipeTarget.ToStringBuilder(stdErrorBuffer))
  .WithValidation(CommandResultValidation.None);

You can also just derive from PipeTaget and override CopyAsync(...) if you'd rather define your own type instead of using a one-off anonymous …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ptr727
Comment options

@Tyrrrz
Comment options

@ptr727
Comment options

@Tyrrrz
Comment options

Answer selected by ptr727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants