使用 ffmpeg 进行 GPU 加速的视频处理 [英] GPU-accelerated video processing with ffmpeg
问题描述
我想使用 ffmpeg 通过 NVIDIA GPU 加速视频编码和解码.
I want to use ffmpeg to accelerate video encode and decode with an NVIDIA GPU.
来自 NVIDIA 网站:
NVIDIA GPU 包含一个或多个基于硬件的解码器和编码器(独立于 CUDA 内核),可为多种流行的编解码器提供完全加速的基于硬件的视频解码和编码.解码/编码卸载后,图形引擎和 CPU 可用于其他操作.
NVIDIA GPUs contain one or more hardware-based decoder and encoder(s) (separate from the CUDA cores) which provides fully-accelerated hardware-based video decoding and encoding for several popular codecs. With decoding/encoding offloaded, the graphics engine and the CPU are free for other operations.
我的问题是:我可以使用 CUDA 内核编码和解码视频吗,也许更快?
My question is: can I use CUDA cores to encode and decode video, maybe faster?
推荐答案
FFmpeg 提供了一个硬件加速子系统,其中包括 NVIDIA:https://trac.ffmpeg.org/wiki/HWAccelIntro
FFmpeg provides a subsystem for hardware acceleration, which includes NVIDIA: https://trac.ffmpeg.org/wiki/HWAccelIntro
为了支持使用 NVIDIA GPU 进行 GPU 辅助编码,您需要:
In order to enable support for GPU-assisted encoding with an NVIDIA GPU, you need:
- 支持的 GPU
- 操作系统支持的驱动程序
- NVIDIA 编解码器 SDK
- ffmpeg 配置了
--enable-nvenc
(如果在配置时检测到驱动程序,则默认设置)
- A supported GPU
- Supported drivers for your operating system
- The NVIDIA Codec SDK
- ffmpeg configured with
--enable-nvenc
(default if the drivers are detected while configuring)
这篇关于使用 ffmpeg 进行 GPU 加速的视频处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!