Closed p00f closed 1 year ago
output of vainfo:
🄸 ganymede ~ [101]> vainfo
Trying display: wayland
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.3 for AMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.49, 6.1.5-arch2-1)
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
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
I have similar error, after running wl-screenrec
:
Using output eDP-1
amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
amdgpu: amdgpu_device_initialize failed.
[AVHWDeviceContext @ 0x5590fb0ac040] libva: /usr/lib/dri/radeonsi_drv_video.so init failed
[AVHWDeviceContext @ 0x5590fb0ac040] Failed to initialise VAAPI connection: 2 (resource allocation failed).
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `-5`,
right: `0`', src/main.rs:767:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
OS: Arch Linux x86_64 Window Manager: Sway Wayland only mode Host: 82B1 Lenovo Legion 5 15ARH05H CPU: AMD Ryzen 7 4800H with Radeon Graphics (16) @ 2.900GHz GPU: AMD ATI 06:00.0 Renoir GPU: NVIDIA GeForce GTX 1660 Ti Mobile
I have installed libva libva-mesa-driver libva-vdpau-driver vulkan-radeon mesa-vdpau
vainfo
Trying display: wayland
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.3 for AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.49, 6.1.5-arch2-1)
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
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Thanks for the reports. Could I get the output of
strace wl-screenrec
and the output of
strace vainfo --display drm --device /dev/dri/card0
Also, if /dev/dri/card0 isn't you amd gpu, set --dri-device=/dev/dri/cardx
of wl-screenrec
Okay, I think I know what's going on. Can I see
vainfo --display drm --device /dev/dri/renderD128
strace wl-screenrec
: https://paste.sr.ht/~p00f/9bfbcbefe7ee68ba926eb2ccfdfe9728a0ee389a
strace vainfo --display drm --device /dev/dri/card0
: https://paste.sr.ht/~p00f/5f5f38ac85cb94eea4d5e38d22a5d56212f5a7e9
🄸 ganymede ~> vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.3 for AMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.49, 6.1.5-arch2-1)
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
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Okay, I anticipate that wl-screenrec --dri-device /dev/dri/renderD128
might work?
If so, I can make it use that device by default
nope,
🄸 ganymede ~> wl-screenrec --dri-device /dev/dri/renderD128
Using output eDP-1
[h264_vaapi @ 0x5620833caa40] No usable encoding entrypoint found for profile VAProfileH264High (7).
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ffmpeg::Error(38: Function not implemented)', src/main.rs:684:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.3 for AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.5-arch2-1)
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
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
wl-screenrec --dri-device /dev/dri/renderD128
Using output eDP-1
[h264_vaapi @ 0x5647a3015980] No usable encoding entrypoint found for profile VAProfileH264High (7).
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ffmpeg::Error(38: Function not implemented)', src/main.rs:684:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Okay, can you try latest?
cargo install --git https://github.com/russelltg/wl-screenrec --force
Does ffmpeg -vaapi_device /dev/dri/renderD128 -f lavfi -i rgbtestsrc=duration=5:size=1280x720:rate=30 -vf hwupload,crop=100:100:200:200,scale_vaapi=format=nv12:w=100:h=100 -c:v h264_vaapi testout.mp4
work?
Also, does wl-screenrec --low-power=off
work?
ffmpeg -vaapi_device /dev/dri/renderD128 -f lavfi -i rgbtestsrc=duration=5:size=1280x720:rate=30 -vf hwupload,crop=100:100:200:200,scale_vaapi=format=nv12:w=100:h=100 -c:v h264_vaapi testout.mp4
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, lavfi, from 'rgbtestsrc=duration=5:size=1280x720:rate=30':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (RGBA / 0x41424752), rgba, 1280x720 [SAR 1:1 DAR 16:9], 30 tbr, 30 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x556510bae6c0] No quality level set; using default (20).
[h264_vaapi @ 0x556510bae6c0] Driver does not support some wanted packed headers (wanted 0xd, found 0).
[h264_vaapi @ 0x556510bae6c0] Driver does not support packed sequence headers, but a global header is requested.
[h264_vaapi @ 0x556510bae6c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).
Output #0, mp4, to 'testout.mp4':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), vaapi(progressive), 100x100 [SAR 16:9 DAR 16:9], q=2-31, 30 fps, 15360 tbn
Metadata:
encoder : Lavc59.37.100 h264_vaapi
frame= 150 fps=0.0 q=-0.0 Lsize= 5kB time=00:00:04.96 bitrate= 8.9kbits/s speed=14.3x
video:4kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 36.048229%
wl-screenrec --low-power=off
Using output eDP-1
[h264_vaapi @ 0x5618377f29c0] Driver does not support some wanted packed headers (wanted 0xd, found 0).
[h264_vaapi @ 0x5618377f29c0] Driver does not support packed sequence headers, but a global header is requested.
[h264_vaapi @ 0x5618377f29c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).
3 fps
[avi @ 0x561837595680] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 292 >= 292
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ffmpeg::Error(22: Invalid argument)', src/main.rs:757:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
And then I tried second time and it worked [roland@blackrainbow ~]$ wl-screenrec --low-power=off
Using output eDP-1
[h264_vaapi @ 0x560869f3f580] Driver does not support some wanted packed headers (wanted 0xd, found 0).
[h264_vaapi @ 0x560869f3f580] Driver does not support packed sequence headers, but a global header is requested.
[h264_vaapi @ 0x560869f3f580] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers).
3 fps
56 fps
10 fps
16 fps
46 fps
38 fps
80 fps
45 fps
2 fps
10 fps
10 fps
2 fps
2 fps
3 fps
5 fps
9 fps
Awesome. I've seen that non monotonically increasing error before as well, I'm not entirely sure why it happens. I think I should probably just discard frames that end up having a higher PTS, but I'm not sure why wlroots is not giving increasing timestamps.
There's still a bug with --low-power=auto (the default), and I think I have an idea
Recording looks good:
Okay, latest should be able to auto-detect the low_power setting properly, as well as discarding non-monotonic frames
Interesting. Does the shell matter in the quality of the recording? bash vs fish https://www.mediafire.com/file/iitjiia339wlp4c/screenrecord.zip/file
It's for 2881c5596eae2c6542405e033172c53adbce4f4b commit
I can't imagine why it would. I get an error opening that URL....
I corrected url.
I'm pretty sure that it's a side effect of the non monotonic DTS thing--you probably missed an IDR. I'll see if I can figure it out. Certainly not a function of your shell
I'd be curious if the latest version has the same issue
Fixed the timing issues, which includes mp4 timing, so it should work without jank.
I'm going to close this issue, if you still see the frame corruption issues open a new issue. Thanks for all the help guys!
@russelltg Thanks! Now it works great. <3
Hey i get this error when i try to use it with amd igpu