某些 HEVC 视频必须使用 LAV 解码

Some HEVC videos must be decoded with LAV

我尝试在这些参数中使用 ffmpeg(足够现代的版本)将一系列 png 文件编码为 HEVC 编解码器视频:

ffmpeg -hwaccel cuda -r 60000/1001 -f image2 -i output%05d.png -c:v hevc_nvenc -preset slow -profile:v main10 -level 6.2 -pix_fmt yuv444p16le output.mkv

然后我得到一个mkv视频文件,我发现它不能用DXV2解码,而是用LAV解码器解码,这占用了我很多CPU。但是,我还发现另一个 HEVC 编解码器视频文件与我的视频具有相似的 属性,可以使用我的 GPU 使用 DXV2 解码器进行解码。谁能帮我找到一种方法,使 HEVC 编解码器视频可以使用 GPU 解码?非常感谢。

我猜你的问题出在 -pix_fmt yuv444p16le 上。我不知道你的 PNG 是什么格式,但它通常是 8-bits/component RGB。您将其上采样为 16-bits/component 4:4:4 YUV,然后将其用作 HEVC 编码器的输入,无论其 closest-supported 邻居是什么(10-bits/component YUV-4:4:4,根据源代码中的注释)。

4:4:4 有时不受硬件解码器支持(参见 here). Also see this quote from here:

Many existing end-client devices/GPUs/SoC support hardware decode 4:2:0 but not 4:4:4 and whilst newer hardware and GPUs are introducing 4:4:4 decoders many existing devices only support 4:2:0 decode.

我会尝试 -pix_fmt p010le,结果应该是 YUV-4:2:0 10-bits/component,它应该适用于所有硬件解码器。