NVDEC/CUVID
NVDEC offers decoders for H.264, HEVC, MJPEG, MPEG-1/2/4, VP8/VP9, VC-1. Codec support varies by hardware (see the GPU compatibility table).
Note that FFmpeg offers both NVDEC and CUVID hwaccels. They differ in how frames are decoded and forwarded in memory.
The full set of codecs being available only on Pascal hardware, which adds VP9 and 10 bit support. The note about missing ffnvcodec from NVENC applies for NVDEC as well.
Sample decode using NVDEC:
ffmpeg -hwaccel nvdec input outputSample decode using CUVID:
./ffmpeg-git -hwaccel cuvid -c:v h264_cuvid -i input outputFull hardware transcode with CUVID and NVENC:
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -c:v h264_nvenc -preset slow outputIf ffmpeg was compiled with support for libnpp, it can be used to insert a GPU based scaler into the chain:
ffmpeg -hwaccel_device 0 -hwaccel cuvid -i input -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow output.mkvThe -hwaccel_device option can be used to specify the GPU to be used by the hwaccel in ffmpeg.
實際上..
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i mvideo.mp4 -vf scale_npp=2048:-1 -c:v h264_nvenc t1.mp4前面用 -c:v h264_cuvid,後面 output filename 之前要加上 -c:v h264_nvenc 才行。
不然會有[FFmpeg-user] Error:Impossible to convert between the formats supported by the filter.. 的 Error。
使用 cuda 的 converting rate 是 2.5X.
但是不用 cuda,用cpu 的話,會是 0.8X
沒有留言:
張貼留言