diff --git a/FFMpegCore.Test/ArgumentBuilderTest.cs b/FFMpegCore.Test/ArgumentBuilderTest.cs index 1c9cb5c..9772054 100644 --- a/FFMpegCore.Test/ArgumentBuilderTest.cs +++ b/FFMpegCore.Test/ArgumentBuilderTest.cs @@ -75,7 +75,7 @@ public void Builder_BuildString_HardwareAcceleration_Auto() { var str = FFMpegArguments.FromFileInput("input.mp4") .OutputToFile("output.mp4", false, opt => opt.WithHardwareAcceleration()).Arguments; - Assert.AreEqual("-i \"input.mp4\" -hwaccel \"output.mp4\"", str); + Assert.AreEqual("-i \"input.mp4\" -hwaccel auto \"output.mp4\"", str); } [TestMethod] diff --git a/FFMpegCore/FFMpeg/Arguments/HardwareAccelerationArgument.cs b/FFMpegCore/FFMpeg/Arguments/HardwareAccelerationArgument.cs index da4b9ee..c0a2182 100644 --- a/FFMpegCore/FFMpeg/Arguments/HardwareAccelerationArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/HardwareAccelerationArgument.cs @@ -11,8 +11,6 @@ public HardwareAccelerationArgument(HardwareAccelerationDevice hardwareAccelerat HardwareAccelerationDevice = hardwareAccelerationDevice; } - public string Text => HardwareAccelerationDevice != HardwareAccelerationDevice.Auto - ? $"-hwaccel {HardwareAccelerationDevice.ToString().ToLower()}" - : "-hwaccel"; + public string Text => $"-hwaccel {HardwareAccelerationDevice.ToString().ToLower()}"; } } \ No newline at end of file diff --git a/FFMpegCore/FFMpeg/FFMpegArguments.cs b/FFMpegCore/FFMpeg/FFMpegArguments.cs index fad42ce..e4396fe 100644 --- a/FFMpegCore/FFMpeg/FFMpegArguments.cs +++ b/FFMpegCore/FFMpeg/FFMpegArguments.cs @@ -45,6 +45,7 @@ public FFMpegArguments WithGlobalOptions(Action configure public FFMpegArguments AddFileInput(string filePath, bool verifyExists = true, Action? addArguments = null) => WithInput(new InputArgument(verifyExists, filePath), addArguments); public FFMpegArguments AddFileInput(FileInfo fileInfo, Action? addArguments = null) => WithInput(new InputArgument(fileInfo.FullName, false), addArguments); public FFMpegArguments AddUrlInput(Uri uri, Action? addArguments = null) => WithInput(new InputArgument(uri.AbsoluteUri, false), addArguments); + public FFMpegArguments AddDeviceInput(string device, Action? addArguments = null) => WithInput(new InputDeviceArgument(device), addArguments); public FFMpegArguments AddPipeInput(IPipeSource sourcePipe, Action? addArguments = null) => WithInput(new InputPipeArgument(sourcePipe), addArguments); public FFMpegArguments AddMetaData(string content, Action? addArguments = null) => WithInput(new MetaDataArgument(content), addArguments); public FFMpegArguments AddMetaData(IReadOnlyMetaData metaData, Action? addArguments = null) => WithInput(new MetaDataArgument(MetaDataSerializer.Instance.Serialize(metaData)), addArguments); diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index ecd0b85..7c3f7bb 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -12,12 +12,12 @@ - + - - + +