Changes between Version 92 and Version 93 of HWAccelIntro
- Timestamp:
- Jan 19, 2024, 9:53:58 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HWAccelIntro
v92 v93 234 234 }}} 235 235 236 237 If ffmpeg was compiled with support for libnpp, it can be used to insert a GPU based scaler into the chain: 238 {{{ 239 ffmpeg -hwaccel_device 0 -hwaccel cuda -i input -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow output.mkv 236 AV1 NVDEC HW decoding requires using -c:v av1: 237 238 {{{ 239 ffmpeg -hwaccel nvdec -c:v av1 -i input_av1.mp4 output.ts 240 }}} 241 242 An example using scale_cuda and encoding in hardware, scale_cuda is available if compiled with ffnvcodec and `--enable-cuda-llvm` (default is on, requires nvidia llvm to be present at runtime): 243 244 {{{ 245 ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i file.mkv -noautoscale -filter_complex [0:0]scale_cuda=1280:-2[out] -map [out] -c:v hevc_nvenc -cq 28 output.mp4 246 }}} 247 248 another example 249 250 {{{ 251 ffmpeg -hwaccel_device 0 -hwaccel cuda -i input -vf scale_cuda=-1:720 -c:v h264_nvenc -preset slow output.mkv 240 252 }}} 241 253 242 254 The {{{-hwaccel_device}}} option can be used to specify the GPU to be used by the hwaccel in ffmpeg. 243 244 AV1 NVDEC HW decoding requires using -c:v av1:245 246 247 {{{248 ffmpeg -hwaccel nvdec -c:v av1 -i input_av1.mp4 output.ts249 }}}250 251 Here's an example using scale_cuda and encoding in hardware, scale_cuda is available if compiled with ffnvcodec and `--enable-cuda-llvm` (default is on, requires nvidia llvm to be present at runtime):252 253 {{{254 ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i file.mkv -noautoscale -filter_complex [0:0]scale_cuda=1280:-2[out] -map [out] -c:v hevc_nvenc -cq 28 output.mp4255 }}}256 255 257 256 == cuda-nvcc and libnpp == … … 263 262 264 263 Both of these are basically "older" cuvid options that require the nvidia SDK to be present when compiled and run. libnpp provides scale_npp (and a few other _npp filters). They might have different options/flexibility than their XX_cuda equivalent. Might be similar performance. These have more funky licensing (nonfree). cuda-nvcc has basically been replaced with ffnvcodec + cuda-llvm, scale_npp with scale_cuda. 264 265 Example: 266 267 {{{ 268 ffmpeg -hwaccel cuda -i input -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow output.mkv 269 }}} 270 265 271 266 272 = libmfx (Intel Media SDK) =
