Quantcast
Channel: MediaSPIP
Viewing all articles
Browse latest Browse all 118172

How to use AMD hardware acceleration VAAPI when using ffmpeg in qtcreator? [closed]

$
0
0

ffmpeg version:4.2.2 env:QT creator

I passed this command in terminal:

ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf format=yuv420p,hwupload -c:v h264_vaapi -b:v 1000k output.mp4

This can be accelerated, the CPU usage is very low But when I want to use code to implement hardware accelerated encoding, it prompts:

cannot allocate memory(-12)

my c++ code:

av_hwdevice_ctx_create = (&hw_device_ctx,AV_HWDEVICE_TYPE_VAAPI,"/dev/dri/renderD128");

print:-12

I can be sure that I compiled ffmpeg correctly because I can enable vaapi hardware acceleration through the command and my graphics card has enough video memory.

Possible causes: I introduced -lavcodec -lavformat -lavutil -lswscale in my qt pro file libs, but did not add -lva -lva-drm

Is it correct to add -lva -lva-drm after libs? What should I do?


Viewing all articles
Browse latest Browse all 118172

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>