mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-29 23:39:31 -06:00
FF-171 - added ability to disable hardware encoders/decoders
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>FileFlows.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
@@ -108,6 +108,9 @@ namespace FileFlows.VideoNodes.FfmpegBuilderNodes
|
||||
|
||||
foreach(var hw in decoders)
|
||||
{
|
||||
|
||||
if (CanUseHardwareEncoding.DisabledByVariables(Args, string.Join(" ", hw)))
|
||||
continue;
|
||||
try
|
||||
{
|
||||
var arguments = new List<string>()
|
||||
|
||||
@@ -139,8 +139,48 @@ public class CanUseHardwareEncoding:Node
|
||||
/// <returns>true if can use it, otherwise false</returns>
|
||||
internal static bool CanProcess_Vaapi_H264(NodeParameters args) => CanProcess(args, "h264_vaapi");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets if a encoder/decoder has been disabled by a variable
|
||||
/// </summary>
|
||||
/// <param name="args">the node parameters</param>
|
||||
/// <param name="parameters">the parameters to check</param>
|
||||
/// <returns>if a encoder/decoder has been disabled by a variable</returns>
|
||||
internal static bool DisabledByVariables(NodeParameters args, string parameters)
|
||||
{
|
||||
|
||||
if (parameters.ToLower().Contains("nvenc"))
|
||||
{
|
||||
if (args.GetVariable("NoNvidia") as bool? == true)
|
||||
return true;
|
||||
if (args.GetVariable("NoNVIDIA") as bool? == true)
|
||||
return true;
|
||||
}
|
||||
else if (parameters.ToLower().Contains("qsv"))
|
||||
{
|
||||
if (args.GetVariable("NoQSV") as bool? == true)
|
||||
return true;
|
||||
}
|
||||
else if (parameters.ToLower().Contains("vaapi"))
|
||||
{
|
||||
if (args.GetVariable("NoVAAPI") as bool? == true)
|
||||
return true;
|
||||
}
|
||||
else if (parameters.ToLower().Contains("amf"))
|
||||
{
|
||||
if (args.GetVariable("NoAMF") as bool? == true)
|
||||
return true;
|
||||
if (args.GetVariable("NoAMD") as bool? == true)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool CanProcess(NodeParameters args, string encodingParams)
|
||||
{
|
||||
if (DisabledByVariables(args, encodingParams))
|
||||
return false;
|
||||
|
||||
string ffmpeg = args.GetToolPath("FFMpeg");
|
||||
if (string.IsNullOrEmpty(ffmpeg))
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<FileVersion>0.8.5.94</FileVersion>
|
||||
<ProductVersion>0.8.5.94</ProductVersion>
|
||||
<FileVersion>0.8.4.101</FileVersion>
|
||||
<ProductVersion>0.8.4.101</ProductVersion>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<Company>FileFlows</Company>
|
||||
<Authors>John Andrews</Authors>
|
||||
|
||||
Reference in New Issue
Block a user