diff --git a/docs/configuration.md b/docs/configuration.md index 3828833a..c6eda9a9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -24,13 +24,13 @@ When a string it is used, it is equivalent to the `encoder` item of the object. WiVRn encodes each eye separately, and the alpha channel as one for both eyes. Each stream is processed independently, this may use resources more effectively and reduce latency. ### `encoder` -Default value: `nvenc` if Nvidia GPU and compiled with nvenc, `vaapi` for all other GPU when compiled with ffmpeg, else `x264`. +Default value: `vulkan` if supported, `nvenc` if Nvidia GPU and compiled with nvenc, `vaapi` for all other GPU when compiled with ffmpeg, else `x264`. Identifier of the encoder, one of * `x264`: software encoding * `nvenc`: Nvidia hardware encoding * `vaapi`: AMD/Intel hardware encoding -* `vulkan`: experimental, for any GPU that supports vulkan video encode +* `vulkan`: for any GPU that supports vulkan video encode ### `codec` Default value: best supported by both headset and encoder of `av1`, `h264`, `h265`. diff --git a/server/encoder/encoder_settings.cpp b/server/encoder/encoder_settings.cpp index 7b0922ef..f330d7d8 100644 --- a/server/encoder/encoder_settings.cpp +++ b/server/encoder/encoder_settings.cpp @@ -223,17 +223,6 @@ public: if (config.codec == video_codec::raw or config.name == encoder_raw) return {encoder_raw, video_codec::raw}; -#if WIVRN_USE_NVENC - if ((nvidia and config.name.empty()) or config.name == encoder_nvenc) - { - for (auto codec: config.codec ? std::vector{*config.codec} : info.supported_codecs) - { - if (check_nvenc(codec)) - return {encoder_nvenc, codec}; - } - } -#endif - #if WIVRN_USE_VULKAN_ENCODE if (config.name.empty() or config.name == encoder_vulkan) { @@ -245,6 +234,17 @@ public: } #endif +#if WIVRN_USE_NVENC + if ((nvidia and config.name.empty()) or config.name == encoder_nvenc) + { + for (auto codec: config.codec ? std::vector{*config.codec} : info.supported_codecs) + { + if (check_nvenc(codec)) + return {encoder_nvenc, codec}; + } + } +#endif + #if WIVRN_USE_VAAPI if (config.name.empty() or config.name == encoder_vaapi) {