feat(linux): Add Vulkan video encoder (#4603)

This commit is contained in:
neatnoise
2026-03-31 04:17:00 +02:00
committed by GitHub
parent 356c6a2c3f
commit 0752f641b1
29 changed files with 1566 additions and 28 deletions

View File

@@ -332,6 +332,14 @@
"vaapi_strict_rc_buffer": "disabled",
},
},
{
id: "vulkan",
name: "Vulkan Encoder",
options: {
"vk_tune": 2,
"vk_rc_mode": 4,
},
},
{
id: "sw",
name: "Software Encoder",
@@ -383,7 +391,7 @@
var app = document.getElementById("app");
if (this.platform === "windows") {
this.tabs = this.tabs.filter((el) => {
return el.id !== "vt" && el.id !== "vaapi";
return el.id !== "vt" && el.id !== "vaapi" && el.id !== "vulkan";
});
}
if (this.platform === "freebsd" || this.platform === "linux") {
@@ -393,7 +401,7 @@
}
if (this.platform === "macos") {
this.tabs = this.tabs.filter((el) => {
return el.id !== "amd" && el.id !== "nv" && el.id !== "qsv" && el.id !== "vaapi";
return el.id !== "amd" && el.id !== "nv" && el.id !== "qsv" && el.id !== "vaapi" && el.id !== "vulkan";
});
}
@@ -437,6 +445,7 @@
'qsv': 'Gpu',
'vaapi': 'Gpu',
'vt': 'Gpu',
'vulkan': 'Gpu',
'sw': 'Cpu',
};
return iconMap[tabId] || 'Settings';

View File

@@ -97,11 +97,13 @@ const config = ref(props.config)
<option value="amdvce">AMD AMF/VCE</option>
</template>
<template #freebsd>
<option value="vulkan">Vulkan</option>
<option value="vaapi">VA-API</option>
</template>
<template #linux>
<option value="nvenc">NVIDIA NVENC</option>
<option value="vaapi">VA-API</option>
<option value="vulkan">Vulkan</option>
</template>
<template #macos>
<option value="videotoolbox">VideoToolbox</option>

View File

@@ -6,6 +6,7 @@ import AmdAmfEncoder from './encoders/AmdAmfEncoder.vue'
import VideotoolboxEncoder from './encoders/VideotoolboxEncoder.vue'
import SoftwareEncoder from './encoders/SoftwareEncoder.vue'
import VAAPIEncoder from './encoders/VAAPIEncoder.vue'
import VulkanEncoder from './encoders/VulkanEncoder.vue'
const props = defineProps([
'platform',
@@ -53,6 +54,13 @@ const config = ref(props.config)
:config="config"
/>
<!-- Vulkan Encoder Tab -->
<VulkanEncoder
v-if="currentTab === 'vulkan'"
:platform="platform"
:config="config"
/>
<!-- Software Encoder Tab -->
<SoftwareEncoder
v-if="currentTab === 'sw'"

View File

@@ -0,0 +1,38 @@
<script setup>
import { ref } from 'vue'
const props = defineProps([
'platform',
'config',
])
const config = ref(props.config)
</script>
<template>
<div id="vulkan-encoder" class="config-page">
<!-- Tuning -->
<div class="mb-3">
<label for="vk_tune" class="form-label">{{ $t('config.vk_tune') }}</label>
<select id="vk_tune" class="form-select" v-model="config.vk_tune">
<option value="0">{{ $t('_common.auto') }}</option>
<option value="1">{{ $t('config.vk_tune_hq') }}</option>
<option value="2">{{ $t('config.vk_tune_ll') }}</option>
<option value="3">{{ $t('config.vk_tune_ull') }}</option>
</select>
<div class="form-text">{{ $t('config.vk_tune_desc') }}</div>
</div>
<!-- Rate Control -->
<div class="mb-3">
<label for="vk_rc_mode" class="form-label">{{ $t('config.vk_rc_mode') }}</label>
<select id="vk_rc_mode" class="form-select" v-model="config.vk_rc_mode">
<option value="0">{{ $t('_common.auto') }}</option>
<option value="1">{{ $t('config.vk_rc_cqp') }}</option>
<option value="2">{{ $t('config.vk_rc_cbr') }}</option>
<option value="4">{{ $t('config.vk_rc_vbr') }}</option>
</select>
<div class="form-text">{{ $t('config.vk_rc_mode_desc') }}</div>
</div>
</div>
</template>

View File

@@ -378,6 +378,16 @@
"upnp_desc": "Automatically configure port forwarding for streaming over the Internet",
"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.",
"vk_rc_cbr": "CBR (Constant Bitrate)",
"vk_rc_cqp": "CQP (Constant QP)",
"vk_rc_mode": "Rate Control",
"vk_rc_mode_desc": "Rate control mode for encoding. Auto lets the driver decide.",
"vk_rc_vbr": "VBR (Variable Bitrate) (default)",
"vk_tune": "Tuning",
"vk_tune_desc": "Low latency modes reduce encoding delay at the cost of quality.",
"vk_tune_hq": "High Quality (hq)",
"vk_tune_ll": "Low Latency (ll) (default)",
"vk_tune_ull": "Ultra Low Latency (ull)",
"virtual_sink": "Virtual Sink",
"virtual_sink_desc": "Manually specify a virtual audio device to use. If unset, the device is chosen automatically. We strongly recommend leaving this field blank to use automatic device selection!",
"virtual_sink_placeholder": "Steam Streaming Speakers",