diff --git a/FFMpegCore/FFMpeg/Arguments/OutputStreamArgument.cs b/FFMpegCore/FFMpeg/Arguments/OutputStreamArgument.cs new file mode 100644 index 0000000..5581929 --- /dev/null +++ b/FFMpegCore/FFMpeg/Arguments/OutputStreamArgument.cs @@ -0,0 +1,26 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace FFMpegCore.Arguments +{ + /// + /// Represents output stream parameter + /// + public class OutputStreamArgument : IOutputArgument + { + public readonly string Stream; + + public OutputStreamArgument(string stream) + { + Stream = stream; + } + + public void Post() { } + + public Task During(CancellationToken cancellationToken = default) => Task.CompletedTask; + + public void Pre() { } + + public string Text => Stream; + } +} diff --git a/FFMpegCore/FFMpeg/FFMpegArguments.cs b/FFMpegCore/FFMpeg/FFMpegArguments.cs index 57ff68c..cdce6be 100644 --- a/FFMpegCore/FFMpeg/FFMpegArguments.cs +++ b/FFMpegCore/FFMpeg/FFMpegArguments.cs @@ -50,6 +50,8 @@ private FFMpegArguments WithInput(IInputArgument inputArgument, Action? addArguments = null) => ToProcessor(new OutputArgument(file, overwrite), addArguments); public FFMpegArgumentProcessor OutputToFile(Uri uri, bool overwrite = true, Action? addArguments = null) => ToProcessor(new OutputArgument(uri.AbsolutePath, overwrite), addArguments); + public FFMpegArgumentProcessor OutputToStream(string uri, Action? addArguments = null) => ToProcessor(new OutputStreamArgument(uri), addArguments); + public FFMpegArgumentProcessor OutputToStream(Uri uri, Action? addArguments = null) => ToProcessor(new OutputStreamArgument(uri.ToString()), addArguments); public FFMpegArgumentProcessor OutputToPipe(IPipeSink reader, Action? addArguments = null) => ToProcessor(new OutputPipeArgument(reader), addArguments); private FFMpegArgumentProcessor ToProcessor(IOutputArgument argument, Action? addArguments)