System : Ubuntu 20.04, 5.13.0-44-generic
Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh)
I use the following command to capture screen :
ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -video_size 1920x1080 -i :0 -vf 'hwupload,scale_vaapi=format=nv12' -c:v h264_vaapi -qp 24 output.mp4
please refer to wiki ffmpeg
I got the video in good quality, but there is no example to capture audio in context of vaapi.
To get audio, I tried : wiki ffmpeg capture desktop
This command as example for audio capture :
ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i hw:0 output.mkv
And got the respective audio stream also.
I tried to combine the "vaapi" command with audio part :
-f alsa -ac 2 -i hw:0
of the second command, but got an error message "cannot open audio device hw:0":
ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -video_size 1920x1080 -i :0 -f alsa -ac 2 -i hw:0 -vf 'hwupload,scale_vaapi=format=nv12' -c:v h264_vaapi -qp 24 output.mp4
Has someone an idea to get also the audio capture in conjunction with the first "vaapi" command ?