Skip to content

Commit

Permalink
Add GPU acceleration option
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Nov 15, 2024
1 parent 284244e commit 552db66
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Source/CLI/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,18 @@ int global::SetOption(const char* argv[], int& i, int argc)
License.Encoder(encoder::FFV1);
return 0;
}
if (!strncmp(argv[i], "ffv1_vulkan", 11) && (!argv[i][11] || (argv[i][11] == ':' && argv[i][12] >= '0' && argv[i][12] <= '9' && !argv[i][13])))
{
OutputOptions["c:v"] = "ffv1_vulkan";
if (argv[i][11])
OutputOptions["init_hw_device"] = "\"vulkan=vk" + string(argv[i] + 11) + '\"';
else
OutputOptions["init_hw_device"] = "\"vulkan=vk:0\"";
OutputOptions["vf"] = "hwupload";
License.Encoder(encoder::FFV1);
License.Feature(feature::HwAccel);
return 0;
}
return Error_NotTested(argv[i - 1], argv[i]);
}
if (!strcmp(argv[i], "-coder"))
Expand Down
1 change: 0 additions & 1 deletion Source/CLI/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,3 @@ int output::FFmpeg_Command(const char* FileName, global& Global, bool IgnoreReve

return 0;
}

1 change: 1 addition & 0 deletions Source/Lib/License/License.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENUM_BEGIN(feature)
EncodingOptions,
MultipleTracks,
SubLicense,
HwAccel,
ENUM_END(feature)

//---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions Source/Lib/License/License_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const feature_info FeatureInfos[] =
{ "Encoding options" },
{ "More than 2 tracks" },
{ "Sub-licensing" },
{ "Hardware acceleration" },
};
static_assert(sizeof(FeatureInfos) / sizeof(feature_info) == feature_Max, "feature_info issue");

Expand Down

0 comments on commit 552db66

Please sign in to comment.