Code Monkey home page Code Monkey logo

obs-vaapi's People

Contributors

fzwoch avatar kode54 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

obs-vaapi's Issues

01f62dac9678302799a01761b732c523c7294bab breaks the plugin

info: [ffmpeg muxer: 'adv_file_output'] Writing file '/home/tcrider/2022-09-06 13-38-00.mkv'...
error: [obs-vaapi] Internal data stream error.

start recording never creates the file,when you hit the stop recording button it hangs indefinitely.

reverting prior to that commit resolves the issue

Best settings for H265

Is there a better setting for h265? The default setting can easily overload the encoder and output a video of bitrate several hundred mbps if setting the bitrate to 0 (auto calculate).
But H265(legacy) and the h265 option from obs-gstreamer plugin works fine. Can it be a regression of gstreamer?

Graphics Card: RX 7900 XT
Mesa version: 23.0.0
gstreamer vaapi version: 1.22.0
OS: Arch Linux
Kernel Version: 6.2.1
OBS Version: 29.0.2

Plugin does not load

When starting OBS from the command line, I can see the following error reported:

info: NVENC supported
info: VAAPI: API version 1.18
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding supported
info: [obs-vaapi] version: 0.3.1, gst-runtime: 1.22.4
error: [obs-vaapi] vapostproc element not found
warning: Failed to initialize module 'obs-vaapi.so'

gst-inspect-1.0 vaapi output:

Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
  Version                  1.22.4
  License                  LGPL
  Source module            gstreamer-vaapi
  Documentation            https://gstreamer.freedesktop.org/documentation/vaapi/
  Source release date      2023-06-20
  Binary package           gstreamer-vaapi
  Origin URL               https://www.archlinux.org/

  vaapiav1dec: VA-API AV1 decoder
  vaapidecodebin: VA-API Decode Bin
  vaapih264dec: VA-API H264 decoder
  vaapih264enc: VA-API H264 encoder
  vaapih265dec: VA-API H265 decoder
  vaapih265enc: VA-API H265 encoder
  vaapijpegdec: VA-API JPEG decoder
  vaapijpegenc: VA-API JPEG encoder
  vaapimpeg2dec: VA-API MPEG2 decoder
  vaapimpeg2enc: VA-API MPEG-2 encoder
  vaapioverlay: VA-API overlay
  vaapipostproc: VA-API video postprocessing
  vaapisink: VA-API sink
  vaapivc1dec: VA-API VC1 decoder
  vaapivp8dec: VA-API VP8 decoder
  vaapivp9dec: VA-API VP9 decoder
  vaapivp9enc: VA-API VP9 encoder

  17 features:
  +-- 17 elements

I use Arch Linux. OBS version is 29.1.1-2. VA-API is already correctly set up and HW acceleration w/ my Intel GPU already works for Firefox.

Why "legacy"?

This is a neat plugin, I am glad to learn about it.

I have not tried a stream yet. But I did try installing it per the instructions on OBS 29.1.3.1-2. When I looked in Output->Advanced->Video Encoder, the VAAPI provided by the plugin was tagged "(Legacy)".

image

Why? Does this indicate something bad?

Would it be possible to add CQP?

CQP shows as an option, but doesn't actually work. Would it be possible to add a working CQP option with the ability to set QP values?

Ability to set Profile

Profiles are not part of encoder option, but part of src pads

vah265enc

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h265
                profile: { (string)main, (string)main-10 }
                  width: [ 1, 7680 ]
                 height: [ 1, 4352 ]
              alignment: au
          stream-format: byte-stream

vah264enc

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                profile: { (string)constrained-baseline, (string)main, (string)high }
                  width: [ 1, 4096 ]
                 height: [ 1, 2160 ]
              alignment: au
          stream-format: byte-stream

Device choice missing again

recently updated and i no longer have the option to choose which gpu i want to use

-edt-

I see the device choice is moved to the legacy options. what is the difference between legacy and normal?

Getting a segfault form libpci

I believe you sscanf matching implementation in get_device_name and populate_devices is slightly incorrect. Your format specifier matches everything up to the - character which leaves the separator as part of the domain integer. If the domain is zero this is most likely irrelevant since -0 should be overlooked. However for my configuration this was making the domain -4 which is obviously invalid. Instead I have changed the code as following to get things up and working.

@@ -649,7 +649,7 @@ static void populate_devices(obs_property_t *prop)
                char device[1024] = {};
                int domain, bus, dev, fun;
 
-               sscanf(list[i]->d_name, "%*[^-]%x:%x:%x.%x%*s", &domain, &bus,
+               sscanf(list[i]->d_name, "%*[^-]-%x:%x:%x.%x%*s", &domain, &bus,
                       &dev, &fun);

Encoding overloaded no matter what settings I use for 1080p 60fps

Hello, so I came over from obs-gstreamer after a recommendation to switch to this instead. Previously I have been using obs-gstreamer because it is what works for me in 1080p 60fps. I have tried obs-vaapi before but kept encountering into "Encoding overloaded!" issues that I have not figured out a way to remedy since, but as mentioned works without issue when using the former.

I was looking into the list of open and closed issues and discovered other reports that mentions HEVC/H265, but on my end the overloading can also occur on H264.

Here are the details as I can provide:

inxi -SMC

System:
  Host: honoo-pc Kernel: 6.4.12-1-default arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.7 Distro: openSUSE Tumbleweed 20230904
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME B560M-K v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 1605
    date: 05/13/2022
CPU:
  Info: 6-core model: 11th Gen Intel Core i5-11400F bits: 64 type: MT MCP
    cache: L2: 3 MiB
  Speed (MHz): avg: 2600 min/max: 800/2600 cores: 1: 2600 2: 2600 3: 2600
    4: 2600 5: 2600 6: 2600 7: 2600 8: 2600 9: 2600 10: 2600 11: 2600 12: 2600

inxi -Ga

Graphics:
  Device-1: AMD Polaris 20 XL [Radeon RX 580 2048SP] vendor: Sapphire
    driver: amdgpu v: kernel arch: GCN-4 code: Arctic Islands process: GF 14nm
    built: 2016-20 pcie: gen: 3 speed: 8 GT/s lanes: 16 ports:
    active: HDMI-A-1,HDMI-A-2 empty: DP-1,DP-2,DVI-D-1 bus-ID: 01:00.0
    chip-ID: 1002:6fdf class-ID: 0300 temp: 84.0 C
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.0
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
    dri: radeonsi gpu: amdgpu d-rect: 1920x2160 display-ID: 0
  Monitor-1: HDMI-A-1 pos: primary,top res: 1920x1080 size: N/A modes: N/A
  Monitor-2: HDMI-A-2 pos: bottom res: 1920x1080 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.1.6 renderer: AMD Radeon RX 580 2048SP
    (polaris10 LLVM 16.0.6 DRM 3.52 6.4.12-1-default) direct-render: Yes

vainfo

libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.19.0)
vainfo: Driver version: Mesa Gallium driver 23.1.6 for AMD Radeon RX 580 2048SP (polaris10, LLVM 16.0.6, DRM 3.52, 6.4.12-1-default)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Logfile:
2023-09-08 12-20-45.txt

add gst options

hey, please add something like this done in ffmpeg
2024-08-04_22-52
p.s. It would also be nice to add some kind of wiki with examples of settings, for example for better quality or vice versa, for streaming recordings, etc.

Overload on 0.4 not on 0.3.1/0.2

Hi,
im testing the plugin on my pc that i use as a console-system.
(xbox - steambox for only gaming on a 65" in 2k90 with MangoHud-fps-limiter, sometimes in 2k60/4k60 vSync on or MangoHud-fps-limiter)

i record my gameplays in relative high-fps. i came from windows with 120fps, on linux i get 90 without overloading.
why i cant record in 120, is another problem. is not relevant here, or is it?

vaapi v0.2 and 0.3.1 have perfect records, but 0.4 overloads. each new plugin-insert i check the settings and correct them.
records on 90, 78 or 60, it overloads. obs v 29.1.3 or the 30.0 beta, same.

maybe a problem with the old version of gstreamer?

here the logs. i hope it can help
i mean, its not a problem, i can use the 0.3.1, its only fyi ;o)

v0.2
2023-10-07 22-18-44.txt

v0.3.1
2023-10-07 22-22-20.txt

v0.4
2023-10-07 22-24-46.txt

my system-info
https://termbin.com/cona

Difference between obs-vaapi and obs-gstreamer?

Hi, I was wondering what the difference was between this project, obs-vaapi, and obs-gstreamer? I currently have obs-gstreamer installed but I'm excited to do some AV1 encoding (RDNA3) when it is supported in OBS.

Should I continue to use obs-gstreamer or switch over?

Issues trying to compile

I'm trying to compile this as a standalone plugin, hitting some issues. My meson inside my rpm spec sheet is very simple:

%meson --buildtype=release \
  %{nil}
%{meson_build}

I'm using the same build requirement packages as the obs-gstreamer package (which still builds successfully), with only pciutils-devel added for the device name additions we discussed.

First I hit this issue:

../obs-vaapi.c:23:10: fatal error: obs-module.h: No such file or directory
   23 | #include <obs-module.h>

Fixed by changing to :

#include <obs/obs-module.h>

But now I'm hitting this issue and unable to resolve it:

../obs-vaapi.c: In function ‘create’:
../obs-vaapi.c:115:14: error: ‘VIDEO_FORMAT_I010’ undeclared (first use in this function); did you mean ‘VIDEO_FORMAT_I420’?
  115 |         case VIDEO_FORMAT_I010:
      |              ^~~~~~~~~~~~~~~~~
      |              VIDEO_FORMAT_I420
../obs-vaapi.c:115:14: note: each undeclared identifier is reported only once for each function it appears in
../obs-vaapi.c:117:56: error: ‘VIDEO_FORMAT_P010’ undeclared (first use in this function); did you mean ‘VIDEO_FORMAT_Y800’?
  117 |                                                        VIDEO_FORMAT_P010);
      |                                                        ^~~~~~~~~~~~~~~~~
      |                                                        VIDEO_FORMAT_Y800
../obs-vaapi.c:138:14: error: ‘VIDEO_CS_2100_PQ’ undeclared (first use in this function); did you mean ‘VIDEO_CS_709’?
  138 |         case VIDEO_CS_2100_PQ:
      |              ^~~~~~~~~~~~~~~~
      |              VIDEO_CS_709
../obs-vaapi.c:142:14: error: ‘VIDEO_CS_2100_HLG’ undeclared (first use in this function)
  142 |         case VIDEO_CS_2100_HLG:
      |              ^~~~~~~~~~~~~~~~~
../obs-vaapi.c: In function ‘encode’:
../obs-vaapi.c:335:41: error: ‘VIDEO_FORMAT_I010’ undeclared (first use in this function); did you mean ‘VIDEO_FORMAT_I420’?
  335 |         if (video_info.output_format == VIDEO_FORMAT_I010 ||
      |                                         ^~~~~~~~~~~~~~~~~
      |                                         VIDEO_FORMAT_I420
../obs-vaapi.c:336:41: error: ‘VIDEO_FORMAT_P010’ undeclared (first use in this function); did you mean ‘VIDEO_FORMAT_Y800’?
  336 |             video_info.output_format == VIDEO_FORMAT_P010) {
      |                                         ^~~~~~~~~~~~~~~~~
      |                                         VIDEO_FORMAT_Y800
ninja: build stopped: subcommand failed.

Additional note: (this may need it's own Issue open, depends what you prefer)

It may be beneficial here to convert from meson to cmake so that the plugin can be built as part of OBS. I have several other plugins that I'm able to build as part of OBS which use cmake simply by doing this in my obs build:

# Prepare plugins/obs-vkcapture
git clone --recurse-submodules https://github.com/nowrep/obs-vkcapture plugins/obs-vkcapture
cd plugins/obs-vkcapture
sed -i 's/install_obs_plugin_with_data/setup_plugin_target/g' CMakeLists.txt
cd ../../

# Prepare plugins/streamfx
git clone --recurse-submodules https://github.com/Xaymar/obs-StreamFX plugins/streamfx
cd plugins/streamfx
git checkout 1d1e646a2319d45ff84e31b1ab0da4a5395d845b
cd ../../

# Prepare plugins/obs-source-record
git clone --recurse-submodules https://github.com/exeldro/obs-source-record plugins/obs-source-record
cd plugins/obs-source-record
sed -i 's/install_obs_plugin_with_data/setup_plugin_target/g' CMakeLists.txt
cd ../../

Then adding them to OBS's existing plugin list:

diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index d20bce142..febeff6b7 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -60,6 +60,9 @@ elseif(OS_LINUX)
   add_subdirectory(vlc-video)
   add_subdirectory(sndio)
   add_subdirectory(obs-vst)
+  add_subdirectory(streamfx)
+  add_subdirectory(obs-vkcapture)
+  add_subdirectory(obs-source-record)
 
   check_obs_browser()
 elseif(OS_FREEBSD)

Unable to select preferred hardware encoding method with additional Nvidia GPU installed

I use Arch linux. I have an AMD RX 5700 XT and Nvidia GTX 1070 installed. I use the AMD card as my primary and the Nvidia card is only used for a win10 virtual machine.

With this setup I'm only seeing NVENC options for hardware encoding in OBS. If I start recording with NVENC, obs crashes. Not really surprised by this. I'm however unable to figure out why I can't use this plugin with my AMD card regardless.

screenshot

obs-vaapi

lspci -k | grep -A 2 -E "(VGA|3D)"
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev c1)
      Subsystem: Micro-Star International Co., Ltd. [MSI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT]
      Kernel driver in use: amdgpu
--
0c:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)
      Subsystem: ASUSTeK Computer Inc. GP104 [GeForce GTX 1070]
      Kernel driver in use: vfio-pci
obs log.txt
07:26:32.743: Using EGL/X11
07:26:32.744: CPU Name: AMD Ryzen 7 2700X Eight-Core Processor
07:26:32.744: CPU Speed: 2199.156MHz
07:26:32.745: Physical Cores: 8, Logical Cores: 16
07:26:32.745: Physical Memory: 32007MB Total, 1318MB Free
07:26:32.745: Kernel Version: Linux 6.5.7-273-tkg-pds
07:26:32.745: Distribution: "Arch Linux" Unknown
07:26:32.745: Desktop Environment: KDE (KDE)
07:26:32.745: Session Type: x11
07:26:32.745: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
07:26:32.746: Qt Version: 6.6.0 (runtime), 6.5.1 (compiled)
07:26:32.746: Portable mode: false
07:26:32.805: OBS 29.1.3-1 (linux)
07:26:32.805: ---------------------------------
07:26:32.806: ---------------------------------
07:26:32.806: audio settings reset:
07:26:32.806: 	samples per sec: 48000
07:26:32.806: 	speakers:        2
07:26:32.806: 	max buffering:   960 milliseconds
07:26:32.806: 	buffering type:  dynamically increasing
07:26:32.808: ---------------------------------
07:26:32.808: Initializing OpenGL...
07:26:32.914: Loading up OpenGL on adapter AMD AMD Radeon RX 5700 XT (navi10, LLVM 16.0.6, DRM 3.54, 6.5.7-273-tkg-pds)
07:26:32.914: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
07:26:32.971: ---------------------------------
07:26:32.971: video settings reset:
07:26:32.971: 	base resolution:   2560x1440
07:26:32.971: 	output resolution: 1920x1080
07:26:32.971: 	downscale filter:  Bicubic
07:26:32.971: 	fps:               60/1
07:26:32.971: 	format:            NV12
07:26:32.971: 	YUV mode:          Rec. 709/Partial
07:26:32.971: NV12 texture support not available
07:26:32.971: P010 texture support not available
07:26:32.975: Audio monitoring device:
07:26:32.975: 	name: Default
07:26:32.975: 	id: default
07:26:32.975: ---------------------------------
07:26:32.989: Failed to load 'en-US' text for module: 'decklink-captions.so'
07:26:33.002: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
07:26:33.015: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
07:26:33.015: Failed to initialize module 'decklink.so'
07:26:33.174: Failed to load 'en-US' text for module: 'liblooking-glass-obs.so'
07:26:33.238: [pipewire] Available captures:
07:26:33.238: [pipewire]     - Desktop capture
07:26:33.238: [pipewire]     - Window capture
07:26:33.276: v4l2loopback not installed, virtual camera disabled
07:26:33.304: NVENC supported
07:26:33.319: VAAPI: API version 1.20
07:26:33.323: FFmpeg VAAPI H264 encoding supported
07:26:33.336: FFmpeg VAAPI HEVC encoding supported
07:26:33.482: [obs-vaapi] version: 0.4.0, gst-runtime: 1.22.6
07:26:33.492: [obs-vaapi] found vah265enc
07:26:33.492: [obs-vaapi] found vah264enc
07:26:33.492: [obs-vaapi] found vaapih264enc
07:26:33.492: [obs-vaapi] found vaapih265enc
07:26:33.492: ---------------------------------
07:26:33.492:   Loaded Modules:
07:26:33.492:     obs-vaapi.so
07:26:33.492:     text-freetype2.so
07:26:33.492:     rtmp-services.so
07:26:33.492:     obs-x264.so
07:26:33.492:     obs-vst.so
07:26:33.492:     obs-transitions.so
07:26:33.492:     obs-outputs.so
07:26:33.492:     obs-libfdk.so
07:26:33.492:     obs-filters.so
07:26:33.492:     obs-ffmpeg.so
07:26:33.493:     linux-v4l2.so
07:26:33.493:     linux-pulseaudio.so
07:26:33.493:     linux-pipewire.so
07:26:33.493:     linux-jack.so
07:26:33.493:     linux-capture.so
07:26:33.493:     linux-alsa.so
07:26:33.493:     liblooking-glass-obs.so
07:26:33.493:     image-source.so
07:26:33.493:     frontend-tools.so
07:26:33.493:     decklink-output-ui.so
07:26:33.493:     decklink-captions.so
07:26:33.493: ---------------------------------
07:26:33.493: ==== Startup complete ===============================================
07:26:33.532: All scene data cleared
07:26:33.532: ------------------------------------------------
07:26:33.537: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.82) 15.0.0'
07:26:33.537: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
07:26:33.537: pulse-input: Started recording from 'alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.analog-stereo.monitor' (default)
07:26:33.537: [Loaded global audio device]: 'Desktop Audio'
07:26:33.539: [window-capture: 'Window Capture (Xcomposite)'] update settings:
07:26:33.539: 	title: unknown
07:26:33.539: 	class: unknown
07:26:33.539: 
07:26:33.540: Switched to scene 'Scene'
07:26:33.540: ------------------------------------------------
07:26:33.540: Loaded scenes:
07:26:33.540: - scene 'Scene':
07:26:33.540:     - source: 'Window Capture (Xcomposite)' (xcomposite_input)
07:26:33.540: ------------------------------------------------
07:26:34.107: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)
07:26:34.107: 
07:31:28.826: ==== Shutting down ==================================================
07:31:28.831: pulse-input: Stopped recording from 'alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.analog-stereo.monitor'
07:31:28.831: pulse-input: Got 11810 packets with 14172000 frames
07:31:28.850: All scene data cleared
07:31:28.850: ------------------------------------------------
07:31:28.945: [Scripting] Total detached callbacks: 0
07:31:28.945: Freeing OBS context data
07:31:28.961: == Profiler Results =============================
07:31:28.961: run_program_init: 958.777 ms
07:31:28.961:  ┣OBSApp::AppInit: 8.342 ms
07:31:28.961:  ┃ ┗OBSApp::InitLocale: 1.33 ms
07:31:28.961:  ┗OBSApp::OBSInit: 890.946 ms
07:31:28.961:    ┣obs_startup: 2.538 ms
07:31:28.961:    ┗OBSBasic::OBSInit: 828.932 ms
07:31:28.961:      ┣OBSBasic::InitBasicConfig: 0.186 ms
07:31:28.961:      ┣OBSBasic::ResetAudio: 0.453 ms
07:31:28.961:      ┣OBSBasic::ResetVideo: 168.645 ms
07:31:28.961:      ┣OBSBasic::InitOBSCallbacks: 0.006 ms
07:31:28.961:      ┣OBSBasic::InitHotkeys: 0.034 ms
07:31:28.962:      ┣obs_load_all_modules2: 517.334 ms
07:31:28.962:      ┃ ┣obs_init_module(decklink-captions.so): 0 ms
07:31:28.962:      ┃ ┣obs_init_module(decklink-output-ui.so): 0 ms
07:31:28.962:      ┃ ┣obs_init_module(decklink.so): 0.223 ms
07:31:28.962:      ┃ ┣obs_init_module(frontend-tools.so): 118.077 ms
07:31:28.962:      ┃ ┣obs_init_module(image-source.so): 0.011 ms
07:31:28.962:      ┃ ┣obs_init_module(liblooking-glass-obs.so): 0.015 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-alsa.so): 0.003 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-capture.so): 0.647 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-jack.so): 0.004 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-pipewire.so): 1.774 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-pulseaudio.so): 0.008 ms
07:31:28.962:      ┃ ┣obs_init_module(linux-v4l2.so): 7.968 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-ffmpeg.so): 33.164 ms
07:31:28.962:      ┃ ┃ ┗nvenc_check: 1.09 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-filters.so): 0.041 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-libfdk.so): 0.003 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-outputs.so): 0.005 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-transitions.so): 0.016 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-vst.so): 0.007 ms
07:31:28.962:      ┃ ┣obs_init_module(obs-x264.so): 0.003 ms
07:31:28.962:      ┃ ┣obs_init_module(rtmp-services.so): 1.056 ms
07:31:28.962:      ┃ ┣obs_init_module(text-freetype2.so): 0.016 ms
07:31:28.962:      ┃ ┗obs_init_module(obs-vaapi.so): 9.984 ms
07:31:28.962:      ┣OBSBasic::InitService: 1.648 ms
07:31:28.962:      ┣OBSBasic::ResetOutputs: 0.262 ms
07:31:28.962:      ┣OBSBasic::CreateHotkeys: 0.027 ms
07:31:28.962:      ┣OBSBasic::InitPrimitives: 0.113 ms
07:31:28.962:      ┗OBSBasic::Load: 45.829 ms
07:31:28.962: obs_hotkey_thread(25 ms): min=0.092 ms, median=0.128 ms, max=36.238 ms, 99th percentile=0.381 ms, 99.9744% below 25 ms
07:31:28.962: audio_thread(Audio): min=0.012 ms, median=0.036 ms, max=0.367 ms, 99th percentile=0.053 ms
07:31:28.962: obs_graphics_thread(16.6667 ms): min=0.125 ms, median=0.538 ms, max=36.904 ms, 99th percentile=1.37 ms, 99.9268% below 16.667 ms
07:31:28.962:  ┣tick_sources: min=0 ms, median=0.061 ms, max=31.115 ms, 99th percentile=0.856 ms
07:31:28.962:  ┣output_frame: min=0.075 ms, median=0.126 ms, max=5.405 ms, 99th percentile=0.179 ms
07:31:28.962:  ┃ ┗gs_context(video->graphics): min=0.074 ms, median=0.125 ms, max=5.396 ms, 99th percentile=0.178 ms
07:31:28.962:  ┃   ┣render_video: min=0.011 ms, median=0.029 ms, max=0.095 ms, 99th percentile=0.039 ms
07:31:28.962:  ┃   ┃ ┗render_main_texture: min=0.009 ms, median=0.025 ms, max=0.08 ms, 99th percentile=0.033 ms
07:31:28.962:  ┃   ┗gs_flush: min=0.002 ms, median=0.003 ms, max=0.112 ms, 99th percentile=0.007 ms
07:31:28.962:  ┗render_displays: min=0.003 ms, median=0.323 ms, max=35.395 ms, 99th percentile=0.562 ms
07:31:28.962: =================================================
07:31:28.962: == Profiler Time Between Calls ==================
07:31:28.963: obs_hotkey_thread(25 ms): min=25.117 ms, median=25.194 ms, max=61.305 ms, 99.054% within ±2% of 25 ms (0% lower, 0.94605% higher)
07:31:28.963: obs_graphics_thread(16.6667 ms): min=1.018 ms, median=16.667 ms, max=36.916 ms, 99.7916% within ±2% of 16.667 ms (0.107018% lower, 0.101386% higher)
07:31:28.963: =================================================
07:31:28.972: Number of memory leaks: 0

Limited and Full Color Range OBS setting not being passed to encoder.

Hello, OBS has a pixel format setting for video in the advanced tab where we can choose between full range (0-255 for 8-bit yuv) or limited range (16-235) color range.

Color Range setting

gambar

FFMPEG VAAPI result

Recording with this state with the ffmpeg vaapi encoders in OBS results in a video with full color range (Levels)

gambar

obs-vaapi result

However the obs-vaapi encoded ones are still encoding in limited while OBS is giving full range frames, causing bad color mapping when playbacked.

gambar

In this image, the top part is what the color should look like, the bottom part is what shows when obs-vaapi encoded video is play-backed.

Additional Information

https://gstreamer.freedesktop.org/documentation/video/video-color.html

looks like this can be set via GstVideoColorimetry

GstVideoColorRange

Possible color range values. These constants are defined for 8 bit color values and can be scaled for other bit depths.
Members
GST_VIDEO_COLOR_RANGE_UNKNOWN (0) – unknown range
GST_VIDEO_COLOR_RANGE_0_255 (1) – [0..255] for 8 bit components
GST_VIDEO_COLOR_RANGE_16_235 (2) – [16..235] for 8 bit components. Chroma has [16..240] range.

Suggestion regarding options

Since there currently are a lot of options it can be overwhelming for new users. Would it be viable maybe to add a dropdown with simple/advanced mode? simple mode maybe just presents device select, CBR mode with default bitrate and keyframe, (and or whatever other options you think would be useful in a simple to use mode), then advanced mode would show the full list of options. Not an issue, just a thought/suggestion on usability

VAAPI H.264 on Navi 22 results in bad output when output resolution different from 720p

Selecting VAAPI H.264 on Navi 22 [Radeon RX 6700/6700 XT/6750 XT/6800M/6850M XT] as Video Encoder (with its default settings) and an output (scaled) resolution above OR below 1280x720 results in recordings looking like this

mpv-shot0004

If I stay at 720p, I get normal output.
Selecting VAAPI H.264 (Legacy) encoder with default settings doesn't have this issue

I'm curious what the differences between the two are. Does the first implement a feature not supported on the 6700 XT? Wondering why it would behave like this when switching away from 720p

System info:

obs-studio 1:30.0.1-dmo1 (from deb-multimedia repo)
obs-vaapi 0.4.1
GStreamer 1.22.8
Mesa 23.3.1-4
Linux 6.5.0-4-amd64
Radeon RX 6700 XT
Debian Sid

OBS recordings do not save [obs-vaapi] Internal data stream error.

https://obsproject.com/logs/k0D6_g1O9CYA7YeI

inxi -b
System:
  Host: Garuda-Linux Kernel: 6.0.14-272-tkg-bmq arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.26.4 Distro: Garuda Linux
Machine:
  Type: Desktop Mobo: ASRock model: X470 Taichi serial: <superuser required>
    UEFI: American Megatrends v: P4.90 date: 05/18/2022
CPU:
  Info: 6-core AMD Ryzen 5 5600X [MT MCP] speed (MHz): avg: 3222
    min/max: 2200/4650
Graphics:
  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M]
    driver: amdgpu v: kernel
  Display: wayland server: X.org v: 1.21.1.6 with: Xwayland v: 22.1.7
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: modesetting,radeon dri: radeonsi gpu: amdgpu resolution:
    1: 2048x864 2: 1396x785
  API: OpenGL v: 4.6 Mesa 22.3.1 renderer: AMD Radeon RX 6700 XT (navi22
    LLVM 14.0.6 DRM 3.48 6.0.14-272-tkg-bmq)
Network:
  Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
  Device-2: Intel I211 Gigabit Network driver: igb
Drives:
  Local Storage: total: 2.96 TiB used: 3.91 TiB (132.4%)
Info:
  Processes: 480 Uptime: 58m Memory: 31.27 GiB used: 16.52 GiB (52.8%)
  Shell: fish inxi: 3.3.24

No encoders found on Intel iGPU

The plugin throws these in the logs on launch:

info: [obs-vaapi] version: 0.2.0, gst-runtime: 1.22.3
info: [obs-vaapi] H.264 encoder - not found
info: [obs-vaapi] H.264 encoder (low power) - not found
info: [obs-vaapi] H.265 encoder - not found
info: [obs-vaapi] H.265 encoder (low power) - not found
info: [obs-vaapi] AV1 encoder - not found
info: [obs-vaapi] AV1 encoder (low power) - not found
info: [obs-vaapi] H.264 encoder (legacy) - not found
info: [obs-vaapi] H.265 encoder (legacy) - not found

Despite my device being set up correctly

[sidpr@strogg ~]$ vainfo
Trying display: wayland
vainfo: VA-API version: 1.19 (libva 2.18.2)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.0 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
[sidpr@strogg ~]$ gst-inspect-1.0 va
Plugin Details:
  Name                     va
  Description              VA-API codecs plugin
  Filename                 /usr/lib/gstreamer-1.0/libgstva.so
  Version                  1.22.3
  License                  LGPL
  Source module            gst-plugins-bad
  Documentation            https://gstreamer.freedesktop.org/documentation/va/
  Source release date      2023-05-19
  Binary package           Arch Linux gst-plugins-bad 1.22.3-6.1
  Origin URL               https://www.archlinux.org/

  vacompositor: VA-API Video Compositor
  vadeinterlace: VA-API Deinterlacer
  vah264dec: VA-API H.264 Decoder
  vah265dec: VA-API H.265 Decoder
  vampeg2dec: VA-API Mpeg2 Decoder
  vapostproc: VA-API Video Postprocessor
  varenderD128h264dec: VA-API H.264 Decoder in renderD128
  varenderD128h264enc: VA-API H.264 Encoder in renderD128
  varenderD128h264lpenc: VA-API H.264 Low Power Encoder in renderD128
  varenderD128h265dec: VA-API H.265 Decoder in renderD128
  varenderD128h265enc: VA-API H.265 Encoder in renderD128
  varenderD128jpegdec: VA-API JPEG Decoder in renderD128
  varenderD128mpeg2dec: VA-API Mpeg2 Decoder in renderD128
  varenderD128vp8dec: VA-API VP8 Decoder in renderD128
  varenderD128vp9dec: VA-API VP9 Decoder in renderD128
  vavp8dec: VA-API VP8 Decoder
  vavp9dec: VA-API VP9 Decoder

  17 features:
  +-- 17 elements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.