Skip to content

Commit 7e3c5b2

Browse files
Merge pull request #448 from JeromeMartinez/GPU
Add GPU acceleration option
2 parents 2c168e7 + efa5ffc commit 7e3c5b2

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Source/CLI/Global.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,18 @@ int global::SetOption(const char* argv[], int& i, int argc)
321321
License.Encoder(encoder::FFV1);
322322
return 0;
323323
}
324+
if (!strncmp(argv[i], "ffv1_vulkan", 11) && (!argv[i][11] || (argv[i][11] == ':' && argv[i][12] >= '0' && argv[i][12] <= '9' && !argv[i][13])))
325+
{
326+
OutputOptions["c:v"] = "ffv1_vulkan";
327+
if (argv[i][11])
328+
OutputOptions["init_hw_device"] = "\"vulkan=vk" + string(argv[i] + 11) + '\"';
329+
else
330+
OutputOptions["init_hw_device"] = "\"vulkan=vk:0\"";
331+
OutputOptions["vf"] = "hwupload";
332+
License.Encoder(encoder::FFV1);
333+
License.Feature(feature::HwAccel);
334+
return 0;
335+
}
324336
return Error_NotTested(argv[i - 1], argv[i]);
325337
}
326338
if (!strcmp(argv[i], "-coder"))

Source/Lib/License/License.h

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ENUM_BEGIN(feature)
2424
EncodingOptions,
2525
MultipleTracks,
2626
SubLicense,
27+
HwAccel,
2728
ENUM_END(feature)
2829

2930
//---------------------------------------------------------------------------

Source/Lib/License/License_Internal.h

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const feature_info FeatureInfos[] =
5151
{ "Encoding options" },
5252
{ "More than 2 tracks" },
5353
{ "Sub-licensing" },
54+
{ "Hardware acceleration" },
5455
};
5556
static_assert(sizeof(FeatureInfos) / sizeof(feature_info) == feature_Max, "feature_info issue");
5657

0 commit comments

Comments
 (0)