此命令行工作正常:
$ ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i input_video.mkv -vf scale_cuda=720:404 -c:v hevc_nvenc -preset p7 -rc vbr -rc-lookahead 20 -b:v 2000k -bufsize 5M -maxrate 2000k -g 250 -an -sn output_video.mkv
但如果我添加-pix_fmt p010le
或-pix_fmt yuv420p10le
选项,我会收到错误:
$ ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i input_video.mkv -vf scale_cuda=720:404 -pix_fmt p010le -c:v hevc_nvenc -preset p7 -rc vbr -rc-lookahead 20 -b:v 2000k -bufsize 5M -maxrate 2000k -g 250 -an -sn output_video.mkv
Impossible to convert between the formats supported by the filter 'Parsed_scale_cuda_0' and the filter 'auto_scale_0'
[vf#0:0 @ 0x5581947ccbc0] Error reinitializing filters!
[vf#0:0 @ 0x5581947ccbc0] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x5581947ccbc0] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/hevc_nvenc @ 0x55819487d080] Could not open encoder before EOF
[vost#0:0/hevc_nvenc @ 0x55819487d080] Task finished with error code: -22 (Invalid argument)
[vost#0:0/hevc_nvenc @ 0x55819487d080] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 0x558194c633c0] Nothing was written into output file, because at least one of its streams received no packets.
我用FFMpeg 版本 N-114081-g64634e809f-20240310(Linux),我的 NVIDIA 显卡是GeForce GTX 1050 Ti。