Commit graph

190 commits

Author SHA1 Message Date
Translation Updater f674d17168 Update translations from Crowdin 2023-12-05 22:04:31 +00:00
Ryan Foster 20ffdda89a obs-qsv11: Migrate target usage settings
Calling update_targetusage in update_params only updates the setting
when an encoder session is initialized. Calling update_targetusage in
rate_control_modified, like update_latency and update_enhancements, will
update the setting when the Settings window is loaded. This will cause
the updated setting to be reflected in the UI.
2023-10-28 15:45:53 -04:00
Ryan Foster b29a44a67d obs-qsv11: Log more QSV settings
QSV logging was missing many of its settings. Let's fix that.
2023-10-17 22:36:22 -04:00
Translation Updater 0d450a34a0 Update translations from Crowdin 2023-10-10 13:34:41 +00:00
Ryan Foster 0866688953 obs-qsv11: Use translatable strings for target usage
For Target Usage, instead of doing string comparisons against long
descriptive strings, use translatable strings for descriptive UI text
and simple designations for values used for comparisons and storage.
This is similar to what we do for NVENC Presets.
2023-10-04 16:22:24 -04:00
Ryan Foster 9b1d6032e3 obs-qsv11: Remove D3D9 fallback
On Windows 10 and up, D3D11 should never fail, so the D3D9 code should
no longer be possible to hit. As far as I can tell, this code was mostly
for Windows 7/8/8.1 and it was part of the initial implementation. It
should no longer be needed.
2023-10-04 15:24:56 -04:00
Ryan Foster 53dee8f990 obs-qsv11: Remove D3D9 allocator
On Windows 10 and up, D3D11 should never fail, so the D3D9 code should
no longer be possible to hit and should no longer be needed.

Revert "obs-qsv11: Use d3d9 allocator on Win7"

This reverts commit b276b1633e.
2023-10-04 15:24:56 -04:00
Kurt Kartaltepe 9d4b916248 obs-qsv11: Redo session data releasing for Linux
This reverts the changes to Windows where Release() was called every
time, since we need share a single DX context across multiple encoders.

Instead introduce a ReleaseSessionData() function and some platform
specific session data that will be passed to it. We use this to track
the VA-API display and fd to release them at the right time. Leaking
displays will also lead to cache pollution in the intel-media-driver
crashing users so we cannot do that.

fixes #9611
2023-09-29 11:56:53 -04:00
Neal Gompa 63f3b0d46c obs-qsv11: Add license declaration file 2023-09-19 13:35:49 -04:00
Ryan Foster 03b70f0672 obs-qsv11: Fix unusual CBR bitrate issues
For some reason, using MFX_SCENARIO_GAME_STREAMING causes the keyframe
quants to be higher than other frames, which is not desirable. In turn,
this causes bitrate to be higher than the target bitrate for a sustained
period of time after each keyframe.

Not setting the scenario removes this behavior and returns CBR to
somewhat reasonable levels of consistency.

Co-authored by: Chris (Flaeri) <flaeri@otterbro.com>
2023-09-18 13:04:04 -04:00
gxalpha e46c68726e obs-qsv11: Fix target usage migration string comparisons
Fixes problems with the astrcmpi logic, as well as a typo that said
"vertfast" instead "veryfast".
Also makes the method a void because it always returns true and isn't
checked anyways.
2023-09-16 14:33:09 -07:00
Kurt Kartaltepe 543be8cf29 obs-qsv11: Ensure default devices are Intel devices 2023-09-05 15:34:37 -04:00
Richard Stanway d3ab68c5ca plugins: Quote program paths used in os_process_pipe_create
These end up being passed to CreateProcessW, so paths with spaces in the
name may be open to misinterpretation by the OS.
2023-08-26 16:44:53 -07:00
Kurt Kartaltepe 8e7b697447 obs-qsv11: Fixup session releasing for Linux 2023-08-26 16:40:46 -07:00
Kurt Kartaltepe 368082d6c0 obs-qsv11: Use device enumeration for choosing DRM device
Trying to use the display server as the QSV device was found to be
generally wrong in beta, so instead lets save defaults from the earlier
device enumeration similar to obs-ffmpeg-vaapi which is known to work
well.
2023-08-26 16:40:46 -07:00
Kurt Kartaltepe fc6a15e13a obs-qsv11: Mark internal functions static 2023-08-26 16:40:46 -07:00
Richard Stanway 609b1ab011 obs-qsv11: Fix crash in QSV test process
The code assumed MFXCreateSession would always succeed, but it fails on
systems with no QSV implementations, causing a crash when we call
MFXClose later. Additional success checks for the other API calls were
also added.
2023-08-18 17:55:00 -07:00
Kurt Kartaltepe 32c07929b0 obs-qsv11: Drop Windows guards on LowPower settings
Setting AdaptiveCQM to ON when LowPower is OFF crashes the
intel-oneapi-gpu implementation on Linux when using the AV1 encoder.
But using the same LowPower settings as Windows works so lets drop the
current guards.
2023-08-17 10:27:16 -04:00
Kurt Kartaltepe b6b8f5b80a obs-qsv11: Fix VPL initialization on intel-mediaSDK
VPL does not have a consistent initialization process for the various
backends it dispatches to. So this resolves the new VPL dispatcher
failing to initialize the video session when it dispatches to
intel-mediaSDK backend. On the oneVPL-intel-gpu backend VA-API sessions
are correctly initialized so this wasnt noticed when tested on newer
hardware.
2023-08-16 15:40:02 -04:00
Kurt Kartaltepe 4d3f9323b5 obs-qsv11: Fix InitParams low power fallback 2023-08-16 15:40:02 -04:00
Translation Updater ecf914dd67 Update translations from Crowdin 2023-08-13 14:09:15 +00:00
Ryan Foster 046560eadc obs-qsv11: Fix adapter enumeration in test app
MFXEnumImplementations expects the adapter index to be within a range of
valid Intel adapters produced by MFXLoad and the config filter. If a
system has one non-Intel high performance GPU and one Intel iGPU, OBS
and the test app will see the Intel iGPU as index 1 due to high
performance hints, but MFXEnumImplementations will expect only one valid
index, 0. In this scenario, passing a value of 1 to
MFXEnumImplementations will cause it to abort and return
MFX_ERR_NOT_FOUND (Provided index is out of possible range). This causes
subsequent capabilities testing to fail.

To avoid this, let's track how many non-Intel adapters we see and
subtract that number from adapterIdx to only pass valid index to
MFXEnumImplementations.
2023-08-10 11:47:15 -04:00
Gale 550ccc63f2 obs-qsv11: Fix RepeatPPS bug 2023-08-09 18:12:47 -04:00
Gale 5bfc2e5150 obs-qsv11: Remove AVBR, QVBR, and VCM 2023-08-09 18:12:47 -04:00
Gale a790302dbd obs-qsv11: Refactor and tune Look-ahead settings
Enable Low Power Look-ahead (VDENC LA) after Intel Arc Graphics. Change
LA_DEPTH defaults (60 frames for normal latency and 30 frames for low
latency). Keep VME Look-ahead only for certain Intel platforms (ICL,
TGL, ADL, and RPL). Disable VME LA for HEVC
2023-08-09 18:12:47 -04:00
Gale 1d95575088 obs-qsv11: Update Target Usage options
Update target usage setting names from legacy names to VPL names.
2023-08-09 18:12:47 -04:00
Gale c9fd128d74 obs-qsv11: Fix bitstream bug
Fix InitBufferSize and BufferSize bug: change Bit to Byte.
2023-08-09 18:12:47 -04:00
Gale 6533b3e138 obs-qsv11: Adjust Gop and keyint_sec parameters
* Change GopPicSize default to 240
 * Remove GopOptFlag
 * Change keyint_sec default from 3 to 0
 * Reduce keyint_sec minimum value from 1 to 0 (for auto)
2023-08-09 18:12:47 -04:00
Gale 6dada921c9 obs-qsv11: Adjust Subjective Video Enhancements
Disable MBBRC (macro block level bitrate control) because it can reduce
objective quality metrics like VMAF.

Use AdaptiveCQM for CBR and VBR.
2023-08-09 18:12:47 -04:00
Gale 99c456b777 obs-qsv11: Add AV1 meta data
Enable content light meta data over the AV1 stream.
2023-08-09 18:12:47 -04:00
Gale 5b6967c359 obs-qsv11: Improve AV1 quality parameters
Enable B-frames for AV1 for Intel Arc Graphics and Meteor Lake Platform.
2023-08-09 18:12:47 -04:00
Gale 61a3e4365b obs-qsv11: Remove MSDK headers 2023-08-07 13:23:26 -04:00
Gale dbbbcd8c57 obs-qsv11: Add VPL changes 2023-08-07 13:23:26 -04:00
Norihiro Kamae 9ca55eea43 obs-qsv11: Downgrade minimum required CMake version 2023-07-29 16:07:54 -07:00
tytan652 cb5f65b529 obs-qsv11: Link against Libva on Linux 2023-07-25 15:29:52 -07:00
Kurt Kartaltepe b8ccaf5649 obs-qsv11: Add adapter checks for Linux
This moves the existing adapter checking into the platform layer and
moves the Windows implementation to its platform implementation and adds
a Linux implementation based on directly querying VA-API.

Unlike Windows, this check takes ~1ms so we have no need to spin out
another thread to perform the work. This also fixes up some of the CPP/C
mixing going on in common_utils."h" to allow us to call common functions
from C files.
2023-07-14 12:19:33 -04:00
Kurt Kartaltepe c6b470de9a obs-qsv11: Add a Linux implementation
This adds a CMake module for finding the QSV SDK (libmfx/onevpl) and an
the required platform components to initialize QSV with the VA-API
platform.
2023-07-14 12:19:33 -04:00
PatTheMav a44d1b2dce obs-qsv11: Fix missing ENABLE_HEVC definition for test executable 2023-07-12 12:56:51 -04:00
Kurt Kartaltepe dc2f2f157b obs-qsv11: Remove Windows references from common files
This cleans up the fairly arbitrary Windows includes and types and
unused functions from the common code and replaces them with platform
independent equivalents, or platform specific implementations in
common_utils.

This removes the Windows 8 support to avoid adding an additional
platform function to query this. OBS only supports Windows 10
officially, so it's about time we removed it.
2023-07-05 19:52:10 -04:00
Kurt Kartaltepe 6acb16840d obs-qsv11: Simplify tracking of which allocator is used
Replace the checks based on D3D11 and D3D9 to check a more informative
variable aptly named UseTexAlloc for which memory allocator should be
used within the encoder.
2023-07-05 19:52:10 -04:00
Kurt Kartaltepe f473f45e03 obs-qsv11: Avoid overwriting encoding parameters
The query being done will ovewrite ALL invalid parameters. This results
in invalid parameters that are not LowPower settings being overwritten
with 0 either introducing different errors or possibly different
behavior.
2023-07-05 19:52:10 -04:00
PatTheMav db895092ed cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-06-29 10:11:32 -04:00
Ruwen Hahn eb260cddc2 obs-qsv11: Allow GPU scaling for texture QSV encoder 2023-06-26 13:32:25 +02:00
Norihiro Kamae 82ea5aaa48 obs-qsv11: Add missing translation 2023-05-20 16:35:05 -07:00
Lain 106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
Translation Updater a0fbdc3c34 Update translations from Crowdin 2023-05-01 23:11:13 +00:00
Ryan Foster c0adff2863 obs-qsv11: Set error message for QSV with P216/P416
If P216 or P416 color formats are selected with QSV, these color formats
were not explicitly handled, so the switch statements would end up in
the default case. If the user had also selected a Rec. 2100 color space,
this would result in the strange error message:
"OBS does not support 8-bit output of Rec. 2100."

This message is confusing and does not correctly reflect the chosen
settings. Let's explicitly handle the P216/P416 cases and provide a more
accurate error message.
2023-05-01 18:45:32 -04:00
Ryan Foster a4f3eb7fcf obs-qsv11: Log selected codec 2023-04-04 00:48:03 +00:00
Translation Updater 7c5560bf1b Update translations from Crowdin 2023-03-27 13:39:03 +00:00
PatTheMav 349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00