【发布时间】:2021-05-25 20:25:39
【问题描述】:
已经在链接中展示了
https://dri.freedesktop.org/wiki/IntelPerformanceTuning/
第 2 步:CPU 与 GPU
如果 CPU % 超过 90,则应用正在 CPU 中运行。
在配置 ffmpeg 时,我启用了 opencl。 ffmpeg 配置是,
ffmpeg version ebe0fa0 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --enable-gpl --enable-libx264 --enable-opencl --enable-nonfree --enable-libmfx --enable-libmp3lame --enable-libaacplus
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
但是在使用命令运行ffmpeg时
ffmpeg -i /home/M.mp4 -c:v h264 -preset:v 更快 /home/out.avi
CPU% 已超过 90 (375%)。
对于 ImageMagick,如果我在配置时启用 opencl,那么应用程序将在 GPU 中运行,即 CPU% 将低于 90。我注意到了。
但在 ffmpeg 的情况下,它是 GPU 加速的。那么,为什么CPU%会超过90%呢? ffmpeg 是在 CPU 还是 GPU 中运行?如果不是,我怎样才能让它在 GPU 中运行?
【问题讨论】:
-
ffmpeg 在
CPU中运行。参考链接here. -
我相信只有某些编码器/解码器/功能启用了硬件加速。请参阅此处的表格:trac.ffmpeg.org/wiki/HWAccelIntro ...例如,在您的情况下,您可以使用
-c:v nvenc_h264使用 NVidia 卡对 H.264 视频进行编码。如果来源正确,OpenCL 似乎只支持过滤。 -
我投票结束这个问题,因为它不是一个实际的编程问题。
-
我正在使用英特尔 QSV。所以在链接 trac.ffmpeg.org/wiki/HWAccelIntro 中是肯定的。那么在快速同步的情况下,它会在 GPU 中运行吗??
-
您能否提供更多有关执行平台的信息:CPU 型号、操作系统等?