Gpu field in software encoders #15
Reference in New Issue
Block a user
Delete Branch "v0.4-gpu_field"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
locale: Added the text for the label and description for the GPU field.

source/encoder.cpp: Added the label, entry point, settings and rules to enable GPU selection on the field.
source/encoder.cpp: Added error look up to show a more understandable message to the user
Motivation and Context
Finding out what parameters to use in the custom field has always been a complicated task https://github.com/Xaymar/obs-ffmpeg-encoder/issues/12 even in the Custom ffmpeg plugin that comes standard with OBS. Since this plug in is meant to solve the complications out of configuring the NVENC encoders in OBS, as such it felt at home to add the possiblity to select the GPU from a simple to use interface.
How Has This Been Tested?
I have used those changes in a local OBS setup
Types of changes
New feature
Checklist:
Minor changes, but otherwise fine.
@@ -20,6 +20,9 @@ FFmpeg.StandardCompliance.Strict="Strict"FFmpeg.StandardCompliance.Normal="Normal"GPU should be uppercase as "gpu" is not a word.
Same as other comment.
@@ -64,6 +64,7 @@ extern "C" {#define ST_FFMPEG_THREADS "FFmpeg.Threads"Same as other comment.
@@ -555,6 +557,10 @@ void obsffmpeg::encoder_factory::get_properties(obs_properties_t* props, bool hwobs_property_set_long_description(p, TRANSLATE(DESC(ST_FFMPEG_CUSTOMSETTINGS)));Should be limited to uint8_t::max instead. I doubt someone will get 32676 GPUs in a single system - even with the best PCI-E splitters, you'd at most only get 192 to 256 GPUs.
@@ -930,6 +939,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)_context->keyint_min = _context->gop_size;Set options on _context with AV_OPT_SEARCH_CHILDREN. It works better if the encoder and FFmpeg have the same property.
@@ -555,6 +557,10 @@ void obsffmpeg::encoder_factory::get_properties(obs_properties_t* props, bool hwobs_property_set_long_description(p, TRANSLATE(DESC(ST_FFMPEG_CUSTOMSETTINGS)));In theory the maximum number of GPUs you can get are 13 straight GPUs but only 9 of those can be nVidia. I like 256 value :)
but this value was lifted from the obs-ffmpeg standard plugin, though sure I will change it and update this.
@@ -930,6 +939,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)_context->keyint_min = _context->gop_size;This was also based upon the obs-ffmpeg standard plugin, but sure, I'll set the Search clildren option.
Should this point to
_contextinstead of_context->priv_data@@ -930,6 +939,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)_context->keyint_min = _context->gop_size;Yeah it should point to _context. AV_OPT_SEARCH_CHILDREN makes it descend into _context->priv_data by itself, so when options move from encoder to ffmpeg or ffmpeg to encoder things still work as expected.