dec05eba / gpu-screen-recorder-issues

GPU Screen Recorder issue tracker
20 stars 0 forks source link

[BUG] Unknown gpu vendor: Mesa #57

Closed bibelin closed 1 month ago

bibelin commented 1 month ago

Describe the bug GSR doesn't work on my system, giving this output:

gsr error: unknown gpu vendor: Mesa
gsr error: failed to load opengl

To Reproduce Any GSR command except -h/--help gives the output shown above, this includes --info.

Desktop (please complete the following information):

Additional context

drm_info.txt

I use 6.8.12 kernel (installed via mainline) because stock 6.11 kernel in Ubuntu breaks video output for me completely.

glxinfo | grep OpenGL ``` OpenGL vendor string: Mesa OpenGL renderer string: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL core profile version string: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version string: 4.50 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL shading language version string: 4.50 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.1 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10 OpenGL ES profile extensions: ```
eglinfo | grep OpenGL ``` radeon: Failed to get PCI ID, error number -13 '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL core profile version: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version: 4.50 OpenGL core profile extensions: '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL compatibility profile shading language version: 4.50 OpenGL compatibility profile extensions: '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions: EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL core profile version: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version: 4.50 OpenGL core profile extensions: OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL compatibility profile shading language version: 4.50 OpenGL compatibility profile extensions: OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL ES profile version: OpenGL ES 3.1 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.10 OpenGL ES profile extensions: EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL core profile version: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version: 4.50 OpenGL core profile extensions: OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL compatibility profile shading language version: 4.50 OpenGL compatibility profile extensions: OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL ES profile version: OpenGL ES 3.1 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.10 OpenGL ES profile extensions: EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL core profile version: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version: 4.50 OpenGL core profile extensions: OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL compatibility profile shading language version: 4.50 OpenGL compatibility profile extensions: OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) OpenGL ES profile version: OpenGL ES 3.1 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.10 OpenGL ES profile extensions: '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL core profile version: 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1 OpenGL core profile shading language version: 4.50 OpenGL core profile extensions: '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.2.3-1ubuntu1 OpenGL compatibility profile shading language version: 4.50 OpenGL compatibility profile extensions: '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) '-avx512er' is not a recognized feature for this target (ignoring feature) '-avx512pf' is not a recognized feature for this target (ignoring feature) OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: llvmpipe (LLVM 19.1.0, 256 bits) OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.2.3-1ubuntu1 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions: ```
OBS I have no idea if I can change it but OBS only allows to select software (x264) encoder in settings. `obs` command output on startup: ``` debug: Found portal inhibitor debug: Attempted path: /usr/bin/../share/obs/obs-studio/locale/en-US.ini debug: Attempted path: /usr/bin/../share/obs/obs-studio/locale.ini debug: Attempted path: /usr/bin/../share/obs/obs-studio/locale/ru-RU.ini info: Using preferred locale 'ru-RU' debug: Attempted path: /usr/bin/../share/obs/obs-studio/themes debug: Attempted path: /usr/bin/../share/obs/obs-studio/themes/ warning: ReadOne on org.freedesktop.portal.Settings returned an invalid reply info: Using EGL/X11 info: CPU Name: AMD A6-6400K APU with Radeon(tm) HD Graphics info: CPU Speed: 4092.390MHz info: Physical Cores: 1, Logical Cores: 2 info: Physical Memory: 3098MB Total, 437MB Free info: Kernel Version: Linux 6.8.12-060812-generic info: Distribution: "Ubuntu" "24.10" info: Desktop Environment: KDE (KDE) info: Session Type: x11 info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1 info: Qt Version: 6.6.2 (runtime), 6.6.2 (compiled) info: Portable mode: false info: OBS 30.2.3.1-2 (linux) info: --------------------------------- info: --------------------------------- info: audio settings reset: samples per sec: 48000 speakers: 2 max buffering: 960 milliseconds buffering type: dynamically increasing info: --------------------------------- info: Initializing OpenGL... info: Loading up OpenGL on adapter Mesa AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) info: OpenGL loaded successfully, version 4.5 (Core Profile) Mesa 24.2.3-1ubuntu1, shading language 4.50 info: --------------------------------- info: video settings reset: base resolution: 1280x720 output resolution: 852x480 downscale filter: Bicubic fps: 30/1 format: NV12 YUV mode: Rec. 709/Partial info: NV12 texture support enabled info: P010 texture support not available info: Audio monitoring device: name: По умолчанию id: default info: --------------------------------- warning: Failed to load 'en-US' text for module: 'decklink-captions.so' warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so' libDeckLinkAPI.so: невозможно открыть разделяемый объектный файл: Нет такого файла или каталога warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed warning: Failed to initialize module 'decklink.so' info: [pipewire] Available capture sources: info: [pipewire] - Monitor source info: [pipewire] - Window source warning: v4l2loopback not installed, virtual camera not registered info: VAAPI: API version 1.22 info: FFmpeg VAAPI H264 encoding supported info: FFmpeg VAAPI AV1 encoding not supported info: FFmpeg VAAPI HEVC encoding not supported info: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.5.2 | RPC Version: 1) info: [obs-websocket] [obs_module_load] Qt version (compile-time): 6.6.2 | Qt version (run-time): 6.6.2 info: [obs-websocket] [obs_module_load] Linked ASIO Version: 103002 info: [obs-websocket] [obs_module_load] Module loaded. info: [vlc-video]: VLC 3.0.21 Vetinari found, VLC video source enabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-websocket.so info: obs-transitions.so info: obs-outputs.so info: obs-filters.so info: obs-ffmpeg.so info: linux-v4l2.so info: linux-pulseaudio.so info: linux-pipewire.so info: linux-jack.so info: linux-capture.so info: linux-alsa.so info: image-source.so info: frontend-tools.so info: decklink-output-ui.so info: decklink-captions.so info: --------------------------------- info: --------------------------------- info: Available Encoders: info: Video Encoders: info: - ffmpeg_svt_av1 (SVT-AV1) info: - ffmpeg_aom_av1 (AOM AV1) info: - ffmpeg_vaapi_tex (FFmpeg VAAPI H.264) info: - obs_x264 (x264) info: Audio Encoders: info: - ffmpeg_aac (FFmpeg AAC) info: - ffmpeg_opus (FFmpeg Opus) info: - ffmpeg_pcm_s16le (FFmpeg PCM (16 бит)) info: - ffmpeg_pcm_s24le (FFmpeg PCM (24 бита)) info: - ffmpeg_pcm_f32le (FFmpeg PCM (32 бита с пл. тчк.)) info: - ffmpeg_alac (FFmpeg ALAC (24 бита)) info: - ffmpeg_flac (FFmpeg FLAC (16 бит)) info: ==== Startup complete =============================================== ```
vainfo ``` Trying display: wayland Trying display: x11 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so libva info: Found init function __vaDriverInit_1_22 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.22 (libva 2.22.0) vainfo: Driver version: Mesa Gallium driver 24.2.3-1ubuntu1 for AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) 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 VAProfileH264High10 : VAEntrypointVLD VAProfileH264High10 : VAEntrypointEncSlice VAProfileNone : VAEntrypointVideoProc ```
apt list --installed | grep mesa ``` libegl-mesa0/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] libgl1-mesa-dri/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] libglapi-mesa/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] libglu1-mesa/oracular,now 9.0.2-1.1build1 amd64 [installed,automatic] libglx-mesa0/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] mesa-libgallium/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] mesa-utils-bin/oracular,now 9.0.0-2 amd64 [installed,automatic] mesa-utils/oracular,now 9.0.0-2 amd64 [installed,automatic] mesa-va-drivers/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] mesa-vdpau-drivers/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] mesa-vulkan-drivers/oracular,now 24.2.3-1ubuntu1 amd64 [installed,automatic] ```
dec05eba commented 1 month ago

Hmm, ok. Can you try https://dec05eba.com/snapshot/gpu-screen-recorder.git.r860.ff77c64.tar.gz as source for gpu screen recorder in the pacstall? or build from latest master branch. I dont know if recording will work so you will have to try it yourself.

bibelin commented 1 month ago

Thanks for quick reply! :heart: Unfortunately the system where I experience the problem is not my main system and I don't have constant access to it. I will try what you suggested tomorrow and will tell you the results.

bibelin commented 1 month ago

Can you try https://dec05eba.com/snapshot/gpu-screen-recorder.git.r860.ff77c64.tar.gz as source

Tried this snapshot as you suggested. At least something works now!

$ gpu-screen-recorder --info
section=system_info
display_server|x11
is_steam_deck|no
section=gpu_info
vendor|amd
section=video_codecs
h264
h264_software
section=capture_options
window
focused
HDMI-0|1280x720

Still I have some issues with recording. When I use GPU as encoder, no matter what other options I tried, ffmpeg fails:

[h264_vaapi @ 0x5e1443c68f40] ignoring invalid SAR: 0/0
[h264_vaapi @ 0x5e1443c68f40] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[h264_vaapi @ 0x5e1443c68f40] Failed to upload encode parameters: 2 (resource allocation failed).
[h264_vaapi @ 0x5e1443c68f40] Encode failed: -5.
Error: avcodec_send_frame failed, error: Input/output error
Assertion pic->display_order == pic->encode_order failed at src/libavcodec/vaapi_encode_h264.c:634

But I guess it's not related to GSR and the reason is described in the name of this commit, right? :sweat_smile:

When using CPU as encoder, GSR works with -w focused and -w WINDOW_ID, but with -w screen or -w MONITOR_NAME only sound is recorded, the video is black. No errors in terminal output.

UPD: Tried on wayland, -w portal works as expected with CPU encoder.

dec05eba commented 1 month ago

hmm, I dont know if that black screen when capturing monitor is because missing functionality in gpu or not. Maybe it can be fixed or not, hard to know if I dont have access to the gpu myself.

dec05eba commented 1 month ago

Can you try downloading this file: https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_10MB.mp4 and then run this command: ffmpeg -vaapi_device /dev/dri/renderD128 -i Big_Buck_Bunny_720_10s_10MB.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4 and then play that output.mp4 and see if it looks ok. Just to verify if your gpu supports vaapi encoding properly with ffmpeg

bibelin commented 1 month ago
$ ffmpeg -vaapi_device /dev/dri/renderD128 -i Big_Buck_Bunny_720_10s_10MB.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
ffmpeg version 7.0.2-3ubuntu1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14 (Ubuntu 14.2.0-2ubuntu1)
  configuration: --prefix=/usr --extra-version=3ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Big_Buck_Bunny_720_10s_10MB.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    composer        : Sacha Goedegebure
    encoder         : Lavf57.63.100
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
  Duration: 00:00:10.00, start: 0.000000, bitrate: 8175 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 8171 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x5e52aa3d9e00] No quality level set; using default (20).
[h264_vaapi @ 0x5e52aa3d9e00] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    composer        : Sacha Goedegebure
    genre           : Animation
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    encoder         : Lavf61.1.100
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), vaapi(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 15360 tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : Lavc61.3.100 h264_vaapi
[h264_vaapi @ 0x5e52aa3d9e00] Failed to upload encode parameters: 2 (resource allocation failed).
[h264_vaapi @ 0x5e52aa3d9e00] Encode failed: -5.
[vost#0:0/h264_vaapi @ 0x5e52aa3ec600] Error submitting video frame to the encoder
[vost#0:0/h264_vaapi @ 0x5e52aa3ec600] Error encoding a frame: Input/output error
[vost#0:0/h264_vaapi @ 0x5e52aa3ec600] Task finished with error code: -5 (Input/output error)
[vost#0:0/h264_vaapi @ 0x5e52aa3ec600] Terminating thread with return code -5 (Input/output error)
[out#0/mp4 @ 0x5e52aa2dcac0] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
[out#0/mp4 @ 0x5e52aa2dcac0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame=    0 fps=0.0 q=0.0 Lsize=       1KiB time=N/A bitrate=N/A speed=N/A    
Conversion failed!
dec05eba commented 1 month ago

I guess your gpu doesn't support vaapi encoding then. Maybe it doesn't support vaapi itself or ffmpeg doesn't support such old amd gpus. :( Or your gpu doesn't have enough vram to do it lol.

dec05eba commented 1 month ago

Run vainfo -a, that might explain why. Post the output here.

bibelin commented 1 month ago
vainfo -a ``` Trying display: wayland Trying display: x11 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so libva info: Found init function __vaDriverInit_1_22 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.22 (libva 2.22.0) vainfo: Driver version: Mesa Gallium driver 24.2.3-1ubuntu1 for AMD ARUBA (DRM 2.50.0 / 6.8.12-060812-generic, LLVM 19.1.0) vainfo: Supported config attributes per profile/entrypoint pair VAProfileMPEG2Simple/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileMPEG2Main/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileVC1Simple/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileVC1Main/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileVC1Advanced/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264ConstrainedBaseline/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264ConstrainedBaseline/VAEntrypointEncSlice VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribRateControl : VA_RC_CBR VA_RC_VBR VA_RC_CQP VAConfigAttribEncPackedHeaders : VA_ENC_PACKED_HEADER_SEQUENCE VAConfigAttribEncMaxRefFrames : l0=1 l1=0 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264Main/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264Main/VAEntrypointEncSlice VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribRateControl : VA_RC_CBR VA_RC_VBR VA_RC_CQP VAConfigAttribEncPackedHeaders : VA_ENC_PACKED_HEADER_SEQUENCE VAConfigAttribEncMaxRefFrames : l0=1 l1=0 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264High/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264High/VAEntrypointEncSlice VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribRateControl : VA_RC_CBR VA_RC_VBR VA_RC_CQP VAConfigAttribEncPackedHeaders : VA_ENC_PACKED_HEADER_SEQUENCE VAConfigAttribEncMaxRefFrames : l0=1 l1=0 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264High10/VAEntrypointVLD VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileH264High10/VAEntrypointEncSlice VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VAConfigAttribRateControl : VA_RC_CBR VA_RC_VBR VA_RC_CQP VAConfigAttribEncPackedHeaders : VA_ENC_PACKED_HEADER_SEQUENCE VAConfigAttribEncMaxRefFrames : l0=1 l1=0 VAConfigAttribMaxPictureWidth : 2048 VAConfigAttribMaxPictureHeight : 1152 VAProfileNone/VAEntrypointVideoProc VAConfigAttribRTFormat : VA_RT_FORMAT_YUV420 VA_RT_FORMAT_YUV422 VA_RT_FORMAT_YUV444 VA_RT_FORMAT_YUV400 VA_RT_FORMAT_YUV420_10 VA_RT_FORMAT_RGB32 VA_RT_FORMAT_RGBP VA_RT_FORMAT_RGB32_10 VA_RT_FORMAT_RGB32_10BPP VA_RT_FORMAT_YUV420_10BPP ```
dec05eba commented 1 month ago

In that drm_info output, did you run it with sudo? sudo drm_info > log.txt. The output looks a bit weird.

bibelin commented 1 month ago

I think I ran it with sudo, but in case I'm wrong, here it is again with sudo for sure. drm_info.txt

dec05eba commented 1 month ago

Ok that might explain it. It's missing quite a lot of data. That probably explains why the image is black when capturing monitor. Can you try running that drm_info command again, but run it when the cursor is visible? the cursor probably gets hidden when you type into the terminal. (Type the command, then move the cursor and then press enter)

bibelin commented 1 month ago

seems to be exactly the same drm_info_cursor.txt

dec05eba commented 1 month ago

Uh ok, maybe your gpu doesn't support hardware cursor plane, so the cursor is software rendered. Alright, i'll see if I can at least make monitor capture work. I dont think its possible to fix gpu encoding though.

dec05eba commented 1 month ago

I added some debug output. Can you fetch the latest master or use https://dec05eba.com/snapshot/gpu-screen-recorder.git.r861.919c877.tar.gz then install it and run gpu-screen-recorder -w screen -f 60 -o video.mp4 and post the terminal output here

bibelin commented 1 month ago
gpu-screen-recorder -w screen -f 60 -o video.mp4 ``` Info: using h264 encoder because a codec was not specified gsr info: gsr_kms_client_init: setting up connection to /usr/bin/gsr-kms-server gsr info: gsr_kms_client_init: waiting for server to connect kms server warning: drmSetClientCap DRM_CLIENT_CAP_ATOMIC failed, error: Operation not supported. The wrong monitor may be captured as a result kms server info: connecting to the client gsr info: gsr_kms_client_init: server connected gsr info: replacing file-backed unix domain socket with socketpair kms server info: connected to the client gsr info: using socketpair [h264_vaapi @ 0x6088798648c0] ignoring invalid SAR: 0/0 [h264_vaapi @ 0x6088798648c0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1). got valid drm fd: 1280, 720 no fb id no fb id no fb id [h264_vaapi @ 0x6088798648c0] Failed to upload encode parameters: 2 (resource allocation failed). [h264_vaapi @ 0x6088798648c0] Encode failed: -5. Error: avcodec_send_frame failed, error: Input/output error got valid drm fd: 1280, 720 no fb id no fb id no fb id Assertion pic->display_order == pic->encode_order failed at src/libavcodec/vaapi_encode_h264.c:634 ```
gpu-screen-recorder -w screen -f 60 -o video.mp4 -encoder cpu ``` Info: using h264 encoder because a codec was not specified gsr info: gsr_kms_client_init: setting up connection to /usr/bin/gsr-kms-server gsr info: gsr_kms_client_init: waiting for server to connect kms server warning: drmSetClientCap DRM_CLIENT_CAP_ATOMIC failed, error: Operation not supported. The wrong monitor may be captured as a result kms server info: connecting to the client gsr info: gsr_kms_client_init: server connected gsr info: replacing file-backed unix domain socket with socketpair kms server info: connected to the client gsr info: using socketpair [libx264 @ 0x57908ae9ec80] ignoring invalid SAR: 0/0 [libx264 @ 0x57908ae9ec80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1 [libx264 @ 0x57908ae9ec80] profile High, level 3.2, 4:2:0, 8-bit [libx264 @ 0x57908ae9ec80] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2 lookahead_threads=2 sliced_threads=1 slices=2 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=120 keyint_min=12 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=23 ip_ratio=1.40 aq=0 got valid drm fd: 1280, 720 no fb id no fb id no fb id got valid drm fd: 1280, 720 no fb id no fb id no fb id ... ``` The last 4 lines are repeated over and over.
dec05eba commented 1 month ago

Ok hmm.. Can you try again with latest master or https://dec05eba.com/snapshot/gpu-screen-recorder.git.r863.86c57c8.tar.gz . Try only gpu-screen-recorder -w screen -f 60 -o video.mp4 -encoder cpu. And post the terminal output here. Also test if if the video looks ok now.

bibelin commented 1 month ago
$ gpu-screen-recorder -w screen -f 60 -o video.mp4 -encoder cpu
Info: using h264 encoder because a codec was not specified
gsr info: gsr_kms_client_init: setting up connection to /usr/bin/gsr-kms-server
gsr info: gsr_kms_client_init: waiting for server to connect
kms server warning: drmSetClientCap DRM_CLIENT_CAP_ATOMIC failed, error: Operation not supported. The wrong monitor may be captured as a result
kms server info: connecting to the client
gsr info: gsr_kms_client_init: server connected
gsr info: replacing file-backed unix domain socket with socketpair
kms server info: connected to the client
gsr info: using socketpair
[libx264 @ 0x5e140df72fc0] ignoring invalid SAR: 0/0
[libx264 @ 0x5e140df72fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x5e140df72fc0] profile High, level 3.2, 4:2:0, 8-bit
[libx264 @ 0x5e140df72fc0] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2 lookahead_threads=2 sliced_threads=1 slices=2 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=120 keyint_min=12 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=23 ip_ratio=1.40 aq=0
update fps: 59, damage fps: 59
update fps: 59, damage fps: 59
...

Still black screen.

dec05eba commented 1 month ago

Ok, maybe its not possible; I dont know. I'll have to skip that since I dont have such an old gpu myself to test with. Since that gpu doesn't support vaapi in ffmpeg I guess its not very usable for recording anyways, the overhead while gaming is probably too much :(

dec05eba commented 1 month ago

I'll unfortunately have to close this, unless I get a hold of that gpu myself. For now users with that gpu have to either record a window or desktop portal on wayland. Thanks for testing!

bibelin commented 1 month ago

This potato PC is not suitable for gaming anyway, I wanted to use GSR as a regular screen cast tool. Maybe there are some other AMD GPUs that have working VAAPI but required that change to avoid "unknown gpu vendor" error, so I hope this all wasn't in vain. Thank you for spending so much time on this!