| | 136 | == CUDA/CUVID == |
| | 137 | |
| | 138 | CUVID, which is also called nvdec by Nvidia now, can be used for decoding on Windows and Linux. |
| | 139 | In combination with nvenc it offers full hardware transcoding. |
| | 140 | |
| | 141 | CUVID offers decoders for H264, HEVC, H263, MJPEG, mpeg1/2/4, vp8/9, vc1. |
| | 142 | Codec support varies by hardware. The full set of codecs being available only on Pascal hardware, which adds VP9 and 10 bit support. |
| | 143 | |
| | 144 | While decoding 10 bit video is supported, CUVID is only able to output 8 bit video, so the additional 2 bits are lost in the process. |
| | 145 | |
| | 146 | Sample decode using CUVID, the cuvid decoder copies the frames to system memory in this case: |
| | 147 | {{{ |
| | 148 | ffmpeg -c:v h264_cuvid -i input output.mkv |
| | 149 | }}} |
| | 150 | |
| | 151 | Full hardware transcode with CUVID and NVENC: |
| | 152 | {{{ |
| | 153 | ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -c:v h264_nvenc -preset slow output.mkv |
| | 154 | }}} |
| | 155 | |
| | 156 | If ffmpeg was compiled with support for libnpp, it can be used to insert a GPU based scaler into the chain: |
| | 157 | {{{ |
| | 158 | ffmpeg -hwaccel_device 0 -hwaccel cuvid -c:v h264_cuvid -i input -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow output.mkv |
| | 159 | }}} |
| | 160 | The {{{-hwaccel_device}}} option can be used to specify the GPU to be used by the cuvid hwaccel in ffmpeg. |
| | 161 | |