mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 00:24:14 +01:00
Merge pull request #334 from lostmsu/lost
`AddDeviceInput` similar to `AddFileInput` and `FromDeviceInput`
Former-commit-id: ce7ebe0cff
This commit is contained in:
commit
910ec6c759
4 changed files with 6 additions and 7 deletions
|
@ -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]
|
||||
|
|
|
@ -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()}";
|
||||
}
|
||||
}
|
|
@ -45,6 +45,7 @@ public FFMpegArguments WithGlobalOptions(Action<FFMpegGlobalArguments> configure
|
|||
public FFMpegArguments AddFileInput(string filePath, bool verifyExists = true, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new InputArgument(verifyExists, filePath), addArguments);
|
||||
public FFMpegArguments AddFileInput(FileInfo fileInfo, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new InputArgument(fileInfo.FullName, false), addArguments);
|
||||
public FFMpegArguments AddUrlInput(Uri uri, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new InputArgument(uri.AbsoluteUri, false), addArguments);
|
||||
public FFMpegArguments AddDeviceInput(string device, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new InputDeviceArgument(device), addArguments);
|
||||
public FFMpegArguments AddPipeInput(IPipeSource sourcePipe, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new InputPipeArgument(sourcePipe), addArguments);
|
||||
public FFMpegArguments AddMetaData(string content, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new MetaDataArgument(content), addArguments);
|
||||
public FFMpegArguments AddMetaData(IReadOnlyMetaData metaData, Action<FFMpegArgumentOptions>? addArguments = null) => WithInput(new MetaDataArgument(MetaDataSerializer.Instance.Serialize(metaData)), addArguments);
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\README.md" Pack="true" PackagePath="\"/>
|
||||
<None Include="..\README.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Instances" Version="3.0.0"/>
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.1"/>
|
||||
<PackageReference Include="Instances" Version="3.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue