Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg cannot allocate memory error? #32

Closed
felixsanz opened this issue Oct 24, 2023 · 2 comments
Closed

ffmpeg cannot allocate memory error? #32

felixsanz opened this issue Oct 24, 2023 · 2 comments

Comments

@felixsanz
Copy link

felixsanz commented Oct 24, 2023

Hi! My va-api / hardware acceleration works fine but with wl-screenrec i'm seeing this:

[nix-shell:~]$ wl-screenrec -g "$(slurp)" -v
Using output DP-2
Opening libva device from DRM device /dev/dri/renderD128
[AVHWFramesContext @ 0x56034beabd40] Failed to create surface: 14 (the requested RT Format is not supported).
[AVHWFramesContext @ 0x56034beabd40] Unable to allocate a surface from internal buffer pool.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ffmpeg::Error(12: Cannot allocate memory)', src/main.rs:1226:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

this is what vainfo returns:

Trying display: wayland
libva info: VA-API version 1.19.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.20.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointVLD

Any idea what could be? Thanks

@russelltg
Copy link
Owner

russelltg commented Oct 24, 2023

Does wf-recorder -c h264_vaapi -d /dev/dri/card0 work?

What hardware are you on? I think that driver only supports decode not encode....

@felixsanz
Copy link
Author

felixsanz commented Oct 24, 2023

Does wf-recorder -c h264_vaapi -d /dev/dri/card0 work?

What hardware are you on? I think that driver only supports decode not encode....

wf-recorder -c h264_vaapi -d /dev/dri/card0   # doesn't work
wf-recorder -d /dev/dri/card0                 # doesn't work
wf-recorder                                   # works

# doesn't work also
ffmpeg -vaapi_device /dev/dri/renderD128 -i recording.mkv -c:v h264_vaapi rec_vaapi.mkv

I'm on AMD ryzen 2700X with a 2070 RTX.

i'm using this btw: https://github.com/elFarto/nvidia-vaapi-driver

Hardware decoding only, encoding is not supported.

ouch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants