使用 ffmpeg 和 vaapi 录制屏幕

使用 ffmpeg 和 vaapi 录制屏幕

我拥有 Debian 9 和原装 Xorg 驱动程序。今天我尝试使用 ffmpeg 和 vaapi 录制屏幕,但遇到了一些问题。

我想以最大 FPS 录制所有屏幕。 xrandr设置为:1920x1080 60.00*+

我的ffmpeg参数是: ./ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -video_size 1920x1080 -r 60 -i :0 -vf 'format=yuv444p,hwupload' -c:v h264_vaapi output.mp4

当我使用该命令录制视频时,输出文件存在许多问题,帧速率问题、颜色问题和其他奇怪的事情。

我的示例从该命令输出视频(重新渲染./ffmpeg -i output.mp4 asd.mp4以减小文件大小,质量没有太大差别):

[您可以在 Google.Drive 上找到它] (https://drive.google.com/file/d/1jNH...47NChORAD/view

这是一个样本框架来自这个视频。

我该如何修复屏幕记录?

有关我的系统的一些其他小信息: -Desktop -OS: Debian 9 amd64 -Cpu: amd a10 7890k -Gpu: no external gpu

~$ uname -a Linux debian 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64 GNU/Linux

~$ vainfo libva info: VA-API version 0.39.4 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_0_39 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.39 (libva 1.7.3) vainfo: Driver version: mesa gallium vaapi 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 VAProfileNone : VAEntrypointVideoProc

相关内容