ffmpeg # CUDA/CUVID/NVDEC # 完全硬件

2018-09-10  本文已影响765人  FlyingPenguin

CUVID, which is also called NVDEC by NVIDIA now, can be used for decoding on Windows and Linux.
In combination with NVENC, it offers full hardware transcoding.

CUVID offers decoders for H.264, HEVC, MJPEG, MPEG-1/2/4, VP8/VP9, VC-1.
Codec support varies by hardware.
The full set of codecs being available only on Pascal hardware, which adds VP9 and 10 bit support.

解码经过系统内存

Sample decode using CUVID, the cuvid decoder copies the frames to system memory in this case:

ffmpeg -c:v h264_cuvid -i input output.mkv

这种情况,解码器会将解码后的数据拷贝到系统内存。

完全硬件转码

Full hardware transcode with CUVID and NVENC:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -c:v h264_nvenc -preset slow output.mkv

加了 -hwaccel cuvid之后,这种情况完全通过显卡GPU完成。

部分硬件转码

Partial hardware transcode, with frames passed through system memory:

ffmpeg -c:v h264_cuvid -i input -c:v h264_nvenc -preset slow output.mkv

部分硬件解码。解码后的数据会通过系统内存。

References:

https://trac.ffmpeg.org/wiki/HWAccelIntro

上一篇下一篇

猜你喜欢

热点阅读