Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,35 @@ editing the `conf` file in a text editor. Use the examples as reference.
</tr>
</table>

### vaapi_async_depth

<table>
<tr>
<td>Description</td>
<td colspan="2">
Number of frames to queue in the GPU.
@warning{Higher values help FPS stability under GPU load,
but may slightly increase latency.}
</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}
1
@endcode</td>
</tr>
<tr>
<td>Range</td>
<td colspan="2">1-64</td>
</tr>
<tr>
<td>Example</td>
<td colspan="2">@code{}
vaapi_async_depth = 4
@endcode</td>
</tr>
</table>

## Software Encoder

### sw_preset
Expand Down
2 changes: 2 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@

{
false, // strict_rc_buffer
1, // async_depth
}, // vaapi

{}, // capture
Expand Down Expand Up @@ -1115,6 +1116,7 @@
int_f(vars, "vt_realtime", video.vt.vt_realtime, vt::rt_from_view);

bool_f(vars, "vaapi_strict_rc_buffer", video.vaapi.strict_rc_buffer);
int_f(vars, "vaapi_async_depth", video.vaapi.async_depth);;

Check failure on line 1119 in src/config.cpp

View workflow job for this annotation

GitHub Actions / Common Lint / Common Lint

code should be clang-formatted
Comment thread
ReenigneArcher marked this conversation as resolved.
Outdated

string_f(vars, "capture", video.capture);
string_f(vars, "encoder", video.encoder);
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace config {

struct {
bool strict_rc_buffer;
int async_depth;
} vaapi;

std::string capture;
Expand Down
2 changes: 2 additions & 0 deletions src/platform/linux/vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ namespace va {
BOOST_LOG(info) << "Using normal encoding mode"sv;
}

av_dict_set_int(options, "async_depth", config::video.vaapi.async_depth, 0);

VAConfigAttrib rc_attr = {VAConfigAttribRateControl};
auto status = vaGetConfigAttributes(va_display, va_profile, va_entrypoint, &rc_attr, 1);
if (status != VA_STATUS_SUCCESS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ const config = ref(props.config)
v-model="config.vaapi_strict_rc_buffer"
default="false"
></Checkbox>

<!-- Async Depth -->
Comment thread
inkatail marked this conversation as resolved.
<div class="mb-3">
<label for="vaapi_async_depth" class="form-label">{{ $t('config.vaapi_async_depth') }}</label>
<input type="number" min="1" max="64" class="form-control" id="vaapi_async_depth" placeholder="1"
v-model="config.vaapi_async_depth" />
<div class="form-text">
{{ $t('config.vaapi_async_depth_desc') }}
</div>
</div>
</div>
</template>

Expand Down
2 changes: 2 additions & 0 deletions src_assets/common/assets/web/public/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@
"touchpad_as_ds4_desc": "If disabled, touchpad presence will not be taken into account during gamepad type selection.",
"upnp": "UPnP",
"upnp_desc": "Automatically configure port forwarding for streaming over the Internet",
"vaapi_async_depth": "VA-API Async Depth",
"vaapi_async_depth_desc": "Number of frames to queue in the GPU. Higher values help FPS stability under GPU load, but may slightly increase latency.",
"vaapi_strict_rc_buffer": "Strictly enforce frame bitrate limits for H.264/HEVC on AMD GPUs",
"vaapi_strict_rc_buffer_desc": "Enabling this option can avoid dropped frames over the network during scene changes, but video quality may be reduced during motion.",
"virtual_sink": "Virtual Sink",
Expand Down
Loading