"Lossless encoding not supported" error occurs using NVIDIA Video Codec SDK 10.0
|Reported by:||bombur33||Owned by:||Timo R.|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Summary of the bug:
When using h264 nvenc, a "Lossless encoding not supported" error occurs using NVIDIA Video Codec SDK 10.0 on certain NVIDIA cards despite using lossy settings. In this case, it's a GTX 960 (Maxwell), which doesn't have lossless capability. When lossy settings are used, it shouldn't matter that the card doesn't support lossless.
The problem seems to trace back from around line 361 of libavcodec/nvenc.c that checks ctx->preset >= PRESET_LOSSLESS_DEFAULT. The new SDK 10 presets (p1-p7) seem to evaluate greater than PRESET_LOSSLESS_DEFAULT despite the new -tune parameter not being set to lossless. In SDK 10, the -tune parameter controls lossless rather than the preset. See the preset migration guide:
How to reproduce:
% ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input -c:v h264_nvenc -preset:v p1 -tune:v hq -rc:v vbr -c:a copy -y output.mp4 ffmpeg version built on 2021-03-24
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.