mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
Compare commits
23 commits
7a2b09bf17
...
c38c308630
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c38c308630 | ||
|
|
55d526ce92 | ||
|
|
ebe60ef5da | ||
|
|
e12bc2a148 | ||
|
|
736420e916 | ||
|
|
f9a3f2b0dc | ||
|
|
1442c08e37 | ||
|
|
cdf2dd5b65 | ||
|
|
3c6cb1fb43 | ||
|
|
df03c58081 | ||
|
|
2a16824e69 | ||
|
|
adfc781e4c | ||
|
|
b10cf5fd76 | ||
|
|
0956870875 | ||
|
|
c60e217a2f | ||
|
|
ca305cd8cd | ||
|
|
dac8f97e8b | ||
|
|
52ed136459 | ||
|
|
b063d37464 | ||
|
|
935980568c | ||
|
|
91e8e1e18d | ||
|
|
f71e172f66 | ||
|
|
a6e90e2078 |
12 changed files with 368 additions and 12 deletions
|
|
@ -19,8 +19,25 @@ public class VideoTest
|
|||
{
|
||||
private const int BaseTimeoutMilliseconds = 60_000;
|
||||
|
||||
private string _segmentPathSource = "";
|
||||
|
||||
public TestContext TestContext { get; set; }
|
||||
|
||||
[TestInitialize]
|
||||
public void Setup()
|
||||
{
|
||||
_segmentPathSource = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}-");
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void Cleanup()
|
||||
{
|
||||
foreach (var file in Directory.EnumerateFiles(Path.GetDirectoryName(_segmentPathSource), Path.GetFileName(_segmentPathSource) + "*"))
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||
public void Video_ToOGV()
|
||||
|
|
@ -154,7 +171,7 @@ public class VideoTest
|
|||
{
|
||||
using var outputFile = new TemporaryFile($"out{VideoType.Mp4.Extension}");
|
||||
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, pixelFormat, 256, 256));
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(64, pixelFormat, 256, 256));
|
||||
var success = FFMpegArguments
|
||||
.FromPipeInput(videoFramesSource)
|
||||
.OutputToFile(outputFile, false, opt => opt
|
||||
|
|
@ -474,7 +491,7 @@ public class VideoTest
|
|||
private static async Task Video_ToTS_Args_Pipe_Internal(dynamic pixelFormat, CancellationToken cancellationToken)
|
||||
{
|
||||
using var output = new TemporaryFile($"out{VideoType.Ts.Extension}");
|
||||
var input = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, pixelFormat, 256, 256));
|
||||
var input = new RawVideoPipeSource(BitmapSource.CreateBitmaps(64, pixelFormat, 256, 256));
|
||||
|
||||
var success = await FFMpegArguments
|
||||
.FromPipeInput(input)
|
||||
|
|
@ -511,7 +528,7 @@ public class VideoTest
|
|||
public void RawVideoPipeSource_Ogv_Scale(SKColorType pixelFormat)
|
||||
{
|
||||
using var outputFile = new TemporaryFile($"out{VideoType.Ogv.Extension}");
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, pixelFormat, 256, 256));
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(64, pixelFormat, 256, 256));
|
||||
|
||||
FFMpegArguments
|
||||
.FromPipeInput(videoFramesSource)
|
||||
|
|
@ -565,7 +582,7 @@ public class VideoTest
|
|||
private static void Video_ToMP4_Resize_Args_Pipe_Internal(dynamic pixelFormat, CancellationToken cancellationToken)
|
||||
{
|
||||
using var outputFile = new TemporaryFile($"out{VideoType.Mp4.Extension}");
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, pixelFormat, 256, 256));
|
||||
var videoFramesSource = new RawVideoPipeSource(BitmapSource.CreateBitmaps(64, pixelFormat, 256, 256));
|
||||
|
||||
var success = FFMpegArguments
|
||||
.FromPipeInput(videoFramesSource)
|
||||
|
|
@ -927,7 +944,7 @@ public class VideoTest
|
|||
{
|
||||
using var resStream = new MemoryStream();
|
||||
var reader = new StreamPipeSink(resStream);
|
||||
var writer = new RawVideoPipeSource(BitmapSource.CreateBitmaps(128, pixelFormat, 128, 128));
|
||||
var writer = new RawVideoPipeSource(BitmapSource.CreateBitmaps(64, pixelFormat, 128, 128));
|
||||
|
||||
FFMpegArguments
|
||||
.FromPipeInput(writer)
|
||||
|
|
@ -1122,13 +1139,12 @@ public class VideoTest
|
|||
|
||||
[TestMethod]
|
||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||
public void Video_Cancel_CancellationToken_Before_Throws()
|
||||
public void Video_Cancel_CancellationToken_BeforeProcessing_Throws()
|
||||
{
|
||||
using var outputFile = new TemporaryFile("out.mp4");
|
||||
|
||||
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||
|
||||
cts.Cancel();
|
||||
var task = FFMpegArguments
|
||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||
.WithCustomArgument("-re")
|
||||
|
|
@ -1139,8 +1155,29 @@ public class VideoTest
|
|||
.WithSpeedPreset(Speed.VeryFast))
|
||||
.CancellableThrough(cts.Token);
|
||||
|
||||
Assert.ThrowsExactly<OperationCanceledException>(() => task.CancellableThrough(TestContext.CancellationToken)
|
||||
.ProcessSynchronously());
|
||||
cts.Cancel();
|
||||
Assert.ThrowsExactly<OperationCanceledException>(() => task.ProcessSynchronously());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||
public void Video_Cancel_CancellationToken_BeforePassing_Throws()
|
||||
{
|
||||
using var outputFile = new TemporaryFile("out.mp4");
|
||||
|
||||
using var cts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.CancellationToken);
|
||||
cts.Cancel();
|
||||
|
||||
var task = FFMpegArguments
|
||||
.FromFileInput("testsrc2=size=320x240[out0]; sine[out1]", false, args => args
|
||||
.WithCustomArgument("-re")
|
||||
.ForceFormat("lavfi"))
|
||||
.OutputToFile(outputFile, false, opt => opt
|
||||
.WithAudioCodec(AudioCodec.Aac)
|
||||
.WithVideoCodec(VideoCodec.LibX264)
|
||||
.WithSpeedPreset(Speed.VeryFast));
|
||||
|
||||
Assert.ThrowsExactly<OperationCanceledException>(() => task.CancellableThrough(cts.Token));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
|
@ -1174,4 +1211,99 @@ public class VideoTest
|
|||
Assert.AreEqual("h264", outputInfo.PrimaryVideoStream.CodecName);
|
||||
Assert.AreEqual("aac", outputInfo.PrimaryAudioStream!.CodecName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||
public void Video_Segmented_File_Output()
|
||||
{
|
||||
using var input = File.OpenRead(TestResources.WebmVideo);
|
||||
var success = FFMpegArguments
|
||||
.FromPipeInput(new StreamPipeSource(input))
|
||||
.OutPutToSegmentedFiles(
|
||||
new SegmentArgument($"{_segmentPathSource}%Y-%m-%d_%H-%M-%S.mkv", true, segmentOptions => segmentOptions
|
||||
.Strftime(true)
|
||||
.Wrap()
|
||||
.Time()
|
||||
.ResetTimeStamps()),
|
||||
options => options
|
||||
.CopyChannel()
|
||||
.WithVideoCodec("h264")
|
||||
.ForceFormat("matroska")
|
||||
.WithConstantRateFactor(21)
|
||||
.WithVideoBitrate(3000)
|
||||
.WithFastStart()
|
||||
.WithVideoFilters(filterOptions => filterOptions
|
||||
.Scale(VideoSize.Hd)
|
||||
.DrawText(DrawTextOptions.Create(@"'%{localtime}.%{eif\:1M*t-1K*trunc(t*1K)\:d\:3}'",
|
||||
@"C:/Users/yan.gauthier/AppData/Local/Microsoft/Windows/Fonts/Roboto-Regular.ttf")
|
||||
.WithParameter("fontcolor", "yellow")
|
||||
.WithParameter("fontsize", "40")
|
||||
.WithParameter("x", "(w-text_w)")
|
||||
.WithParameter("y", "(h - text_h)")
|
||||
.WithParameter("rate", "19")
|
||||
)
|
||||
)
|
||||
)
|
||||
.CancellableThrough(TestContext.CancellationToken)
|
||||
.ProcessSynchronously(false);
|
||||
Assert.IsTrue(success);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
|
||||
public void Video_MultiOutput_With_Segmented_File_Output()
|
||||
{
|
||||
using var input = File.OpenRead(TestResources.WebmVideo);
|
||||
var success = FFMpegArguments
|
||||
.FromPipeInput(new StreamPipeSource(input))
|
||||
.MultiOutput(args => args
|
||||
.OutputToFile($"{_segmentPathSource}2", true, options => options
|
||||
.CopyChannel()
|
||||
.WithVideoCodec("mjpeg")
|
||||
.ForceFormat("matroska")
|
||||
.WithConstantRateFactor(21)
|
||||
.WithVideoBitrate(4000)
|
||||
.WithFastStart()
|
||||
.WithVideoFilters(filterOptions => filterOptions
|
||||
.Scale(VideoSize.Hd)
|
||||
.DrawText(DrawTextOptions.Create(@"'%{localtime}.%{eif\:1M*t-1K*trunc(t*1K)\:d\:3}'",
|
||||
@"C:/Users/yan.gauthier/AppData/Local/Microsoft/Windows/Fonts/Roboto-Regular.ttf")
|
||||
.WithParameter("fontcolor", "yellow")
|
||||
.WithParameter("fontsize", "40")
|
||||
.WithParameter("x", "(w-text_w)")
|
||||
.WithParameter("y", "(h - text_h)")
|
||||
.WithParameter("rate", "19")
|
||||
)
|
||||
)
|
||||
)
|
||||
.OutPutToSegmentedFiles(
|
||||
new SegmentArgument($"{_segmentPathSource}%Y-%m-%d_%H-%M-%S.mkv", true, segmentOptions => segmentOptions
|
||||
.Strftime(true)
|
||||
.Wrap()
|
||||
.Time()
|
||||
.ResetTimeStamps()),
|
||||
options => options
|
||||
.CopyChannel()
|
||||
.WithVideoCodec("h264")
|
||||
.ForceFormat("matroska")
|
||||
.WithConstantRateFactor(21)
|
||||
.WithVideoBitrate(3000)
|
||||
.WithFastStart()
|
||||
.WithVideoFilters(filterOptions => filterOptions
|
||||
.Scale(VideoSize.Hd)
|
||||
.DrawText(DrawTextOptions.Create(@"'%{localtime}.%{eif\:1M*t-1K*trunc(t*1K)\:d\:3}'",
|
||||
@"C:/Users/yan.gauthier/AppData/Local/Microsoft/Windows/Fonts/Roboto-Regular.ttf")
|
||||
.WithParameter("fontcolor", "yellow")
|
||||
.WithParameter("fontsize", "40")
|
||||
.WithParameter("x", "(w-text_w)")
|
||||
.WithParameter("y", "(h - text_h)")
|
||||
.WithParameter("rate", "19")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
.CancellableThrough(TestContext.CancellationToken)
|
||||
.ProcessSynchronously(false);
|
||||
Assert.IsTrue(success);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ public class FFMetadataBuilder
|
|||
|
||||
public FFMetadataBuilder WithChapter(string title, double durationSeconds)
|
||||
{
|
||||
Chapters.Add(new FFMetadataChapter(title, Convert.ToInt64(durationSeconds * 1000)));
|
||||
return this;
|
||||
return WithChapter(title, Convert.ToInt64(durationSeconds * 1000));
|
||||
}
|
||||
|
||||
public string GetMetadataFileContent()
|
||||
|
|
|
|||
114
FFMpegCore/FFMpeg/Arguments/OutputSegmentArgument.cs
Normal file
114
FFMpegCore/FFMpeg/Arguments/OutputSegmentArgument.cs
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
using FFMpegCore.Exceptions;
|
||||
|
||||
namespace FFMpegCore.Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Represents output parameter
|
||||
/// </summary>
|
||||
public class OutputSegmentArgument : IOutputArgument
|
||||
{
|
||||
public readonly SegmentArgumentOptions Options;
|
||||
public readonly bool Overwrite;
|
||||
public readonly string SegmentPattern;
|
||||
|
||||
public OutputSegmentArgument(SegmentArgument segmentArgument)
|
||||
{
|
||||
SegmentPattern = segmentArgument.SegmentPattern;
|
||||
Overwrite = segmentArgument.Overwrite;
|
||||
var segmentArgumentobj = new SegmentArgumentOptions();
|
||||
segmentArgument.Options?.Invoke(segmentArgumentobj);
|
||||
Options = segmentArgumentobj;
|
||||
}
|
||||
|
||||
public void Pre()
|
||||
{
|
||||
if (int.TryParse(Options.Arguments.FirstOrDefault(x => x.Key == "segment_time").Value, out var result) && result < 1)
|
||||
{
|
||||
throw new FFMpegException(FFMpegExceptionType.Process, "Parameter SegmentTime cannot be negative or equal to zero");
|
||||
}
|
||||
|
||||
if (Options.Arguments.FirstOrDefault(x => x.Key == "segment_time").Value == "0")
|
||||
{
|
||||
throw new FFMpegException(FFMpegExceptionType.Process, "Parameter SegmentWrap cannot equal to zero");
|
||||
}
|
||||
}
|
||||
|
||||
public Task During(CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void Post()
|
||||
{
|
||||
}
|
||||
|
||||
public string Text => GetText();
|
||||
|
||||
private string GetText()
|
||||
{
|
||||
var arguments = Options.Arguments
|
||||
.Where(arg => !string.IsNullOrWhiteSpace(arg.Value) && !string.IsNullOrWhiteSpace(arg.Key))
|
||||
.Select(arg =>
|
||||
{
|
||||
return arg.Value;
|
||||
});
|
||||
|
||||
return $"-f segment {string.Join(" ", arguments)} \"{SegmentPattern}\"{(Overwrite ? " -y" : string.Empty)}";
|
||||
}
|
||||
}
|
||||
|
||||
public interface ISegmentArgument
|
||||
{
|
||||
string Key { get; }
|
||||
string Value { get; }
|
||||
}
|
||||
|
||||
public class SegmentArgumentOptions
|
||||
{
|
||||
public List<ISegmentArgument> Arguments { get; } = new();
|
||||
|
||||
public SegmentArgumentOptions ResetTimeStamps(bool resetTimestamps = true)
|
||||
{
|
||||
return WithArgument(new SegmentResetTimeStampsArgument(resetTimestamps));
|
||||
}
|
||||
|
||||
public SegmentArgumentOptions Strftime(bool enable = false)
|
||||
{
|
||||
return WithArgument(new SegmentStrftimeArgument(enable));
|
||||
}
|
||||
|
||||
public SegmentArgumentOptions Time(int time = 60)
|
||||
{
|
||||
return WithArgument(new SegmentTimeArgument(time));
|
||||
}
|
||||
|
||||
public SegmentArgumentOptions Wrap(int limit = -1)
|
||||
{
|
||||
return WithArgument(new SegmentWrapArgument(limit));
|
||||
}
|
||||
|
||||
public SegmentArgumentOptions WithCustomArgument(string argument)
|
||||
{
|
||||
return WithArgument(new SegmentCustomArgument(argument));
|
||||
}
|
||||
|
||||
private SegmentArgumentOptions WithArgument(ISegmentArgument argument)
|
||||
{
|
||||
Arguments.Add(argument);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public class SegmentArgument
|
||||
{
|
||||
public readonly Action<SegmentArgumentOptions> Options;
|
||||
public readonly bool Overwrite;
|
||||
public readonly string SegmentPattern;
|
||||
|
||||
public SegmentArgument(string segmentPattern, bool overwrite, Action<SegmentArgumentOptions> options)
|
||||
{
|
||||
SegmentPattern = segmentPattern;
|
||||
Overwrite = overwrite;
|
||||
Options = options;
|
||||
}
|
||||
}
|
||||
14
FFMpegCore/FFMpeg/Arguments/SegmentCustomArgument.cs
Normal file
14
FFMpegCore/FFMpeg/Arguments/SegmentCustomArgument.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace FFMpegCore.Arguments;
|
||||
|
||||
public class SegmentCustomArgument : ISegmentArgument
|
||||
{
|
||||
public readonly string Argument;
|
||||
|
||||
public SegmentCustomArgument(string argument)
|
||||
{
|
||||
Argument = argument;
|
||||
}
|
||||
|
||||
public string Key => "custom";
|
||||
public string Value => Argument ?? string.Empty;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
namespace FFMpegCore.Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Represents reset_timestamps parameter
|
||||
/// </summary>
|
||||
public class SegmentResetTimeStampsArgument : ISegmentArgument
|
||||
{
|
||||
public readonly bool ResetTimestamps;
|
||||
|
||||
/// <summary>
|
||||
/// Represents reset_timestamps parameter
|
||||
/// </summary>
|
||||
/// <param name="resetTimestamps">true if files timestamps are to be reset</param>
|
||||
public SegmentResetTimeStampsArgument(bool resetTimestamps)
|
||||
{
|
||||
ResetTimestamps = resetTimestamps;
|
||||
}
|
||||
|
||||
public string Key { get; } = "reset_timestamps";
|
||||
public string Value => ResetTimestamps ? "-reset_timestamps 1" : string.Empty;
|
||||
}
|
||||
23
FFMpegCore/FFMpeg/Arguments/SegmentStrftimeArgument.cs
Normal file
23
FFMpegCore/FFMpeg/Arguments/SegmentStrftimeArgument.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace FFMpegCore.Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Use the strftime function to define the name of the new segments to write. If this is selected, the output segment name must contain a
|
||||
/// strftime function template. Default value is 0.
|
||||
/// </summary>
|
||||
public class SegmentStrftimeArgument : ISegmentArgument
|
||||
{
|
||||
public readonly bool Enable;
|
||||
|
||||
/// <summary>
|
||||
/// Use the strftime function to define the name of the new segments to write. If this is selected, the output segment name must contain a
|
||||
/// strftime function template. Default value is 0.
|
||||
/// </summary>
|
||||
/// <param name="enable">true to enable strftime</param>
|
||||
public SegmentStrftimeArgument(bool enable)
|
||||
{
|
||||
Enable = enable;
|
||||
}
|
||||
|
||||
public string Key { get; } = "strftime";
|
||||
public string Value => Enable ? "-strftime 1" : string.Empty;
|
||||
}
|
||||
21
FFMpegCore/FFMpeg/Arguments/SegmentTimeArgument.cs
Normal file
21
FFMpegCore/FFMpeg/Arguments/SegmentTimeArgument.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
namespace FFMpegCore.Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Represents segment_time parameter
|
||||
/// </summary>
|
||||
public class SegmentTimeArgument : ISegmentArgument
|
||||
{
|
||||
public readonly int Time;
|
||||
|
||||
/// <summary>
|
||||
/// Represents segment_time parameter
|
||||
/// </summary>
|
||||
/// <param name="time">time in seconds of the segment</param>
|
||||
public SegmentTimeArgument(int time)
|
||||
{
|
||||
Time = time;
|
||||
}
|
||||
|
||||
public string Key { get; } = "segment_time";
|
||||
public string Value => Time <= 0 ? string.Empty : $"-segment_time {Time}";
|
||||
}
|
||||
21
FFMpegCore/FFMpeg/Arguments/SegmentWrapArgument.cs
Normal file
21
FFMpegCore/FFMpeg/Arguments/SegmentWrapArgument.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
namespace FFMpegCore.Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Represents segment_wrap parameter
|
||||
/// </summary>
|
||||
public class SegmentWrapArgument : ISegmentArgument
|
||||
{
|
||||
public readonly int Limit;
|
||||
|
||||
/// <summary>
|
||||
/// Represents segment_wrap parameter
|
||||
/// </summary>
|
||||
/// <param name="limit">limit value after which segment index will wrap around</param>
|
||||
public SegmentWrapArgument(int limit)
|
||||
{
|
||||
Limit = limit;
|
||||
}
|
||||
|
||||
public string Key { get; } = "segment_wrap";
|
||||
public string Value => Limit <= 0 ? string.Empty : $"-segment_wrap {Limit}";
|
||||
}
|
||||
|
|
@ -297,7 +297,7 @@ public static class FFMpeg
|
|||
{
|
||||
if (Path.GetExtension(input) != Path.GetExtension(output))
|
||||
{
|
||||
output = Path.Combine(Path.GetDirectoryName(output), Path.GetFileNameWithoutExtension(output), Path.GetExtension(input));
|
||||
output = Path.ChangeExtension(output, Path.GetExtension(input));
|
||||
}
|
||||
|
||||
return FFMpegArguments
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ public class FFMpegArgumentProcessor
|
|||
|
||||
public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
_cancellationTokenRegistration?.Dispose();
|
||||
_cancellationTokenRegistration = token.Register(() => Cancel(timeout));
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -157,6 +157,11 @@ public sealed class FFMpegArguments : FFMpegArgumentsBase
|
|||
return ToProcessor(new OutputPipeArgument(reader), addArguments);
|
||||
}
|
||||
|
||||
public FFMpegArgumentProcessor OutPutToSegmentedFiles(SegmentArgument segmentArgument, Action<FFMpegArgumentOptions>? addArguments = null)
|
||||
{
|
||||
return ToProcessor(new OutputSegmentArgument(segmentArgument), addArguments);
|
||||
}
|
||||
|
||||
private FFMpegArgumentProcessor ToProcessor(IOutputArgument argument, Action<FFMpegArgumentOptions>? addArguments)
|
||||
{
|
||||
var args = new FFMpegArgumentOptions();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ public class FFMpegMultiOutputOptions
|
|||
return AddOutput(new OutputPipeArgument(reader), addArguments);
|
||||
}
|
||||
|
||||
public FFMpegMultiOutputOptions OutPutToSegmentedFiles(SegmentArgument segmentArgument, Action<FFMpegArgumentOptions>? addArguments = null)
|
||||
{
|
||||
return AddOutput(new OutputSegmentArgument(segmentArgument), addArguments);
|
||||
}
|
||||
|
||||
public FFMpegMultiOutputOptions AddOutput(IOutputArgument argument, Action<FFMpegArgumentOptions>? addArguments)
|
||||
{
|
||||
var args = new FFMpegArgumentOptions();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue