更新ffmpeg后无法用cuda转换视频

问题描述 投票:0回答:1

我有时使用此命令将 4k 视频转换为 1080p,使用工具“ffmpeg batch”和 ffmpeg 5.1 没有问题? “2022-08-10-git-8fc7f0fdec-full_build-www.gyan.dev 版权所有 (c) 2000-2022 FFmpeg 开发人员使用 gcc 12.1.0 构建(Rev2,由 MSYS2 项目构建)”:


-map 0 -map -0:t -filter_complex "scale_cuda=1920:1080:format=yuv420p:interp_algo=lanczos,hwdownload" -fps_mode:v passthrough -c:v h264_nvenc -preset 18 -profile:v high -level 4.1 -b:v 13000K -rc cbr -c:a copy -c:s copy

这与预输入“-hwaccel cuvid”

现在,如果我尝试使用最新版本的 ffmpeg (6.1.1) 进行相同的操作,则它不起作用。我尝试使用“-hwaccel cuda”更改预输入,但仍然没有任何结果,它给我错误“无法找到未标记的输入板scale_cuda的匹配流:默认”。

如果我尝试在“scale_cuda”之前添加 [v:0],我会收到此错误(在编辑命令之前也存在 pgs subs 错误):

[matroska,webm @ 0000025b18315680] Invalid Block Addition value 0x0 for unknown Block Addition Mapping type 68766345, name ""
[matroska,webm @ 0000025b18315680] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[matroska,webm @ 0000025b18315680] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Multiple -hwaccel options specified for stream 0, only the last option '-hwaccel cuda' will be used.
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0'
[fc#0 @ 0000025b18311c80] Error reinitializing filters!
[fc#0 @ 0000025b18311c80] Task finished with error code: -40 (Function not implemented)
[fc#0 @ 0000025b18311c80] Terminating thread with return code -40 (Function not implemented)
[vost#0:0/h264_nvenc @ 0000025b183319c0] Could not open encoder before EOF
[vost#0:0/h264_nvenc @ 0000025b183319c0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_nvenc @ 0000025b183319c0] Terminating thread with return code -22 (Invalid argument)
[h264_nvenc @ 0000025b183692c0] 10 bit encode not supported
[h264_nvenc @ 0000025b183692c0] Provided device doesn't support required NVENC features
[vost#0:1/h264_nvenc @ 0000025b18330d80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:1 @ 0000025b18340900] Error sending frames to consumers: Function not implemented
[vf#0:1 @ 0000025b18340900] Task finished with error code: -40 (Function not implemented)
[vf#0:1 @ 0000025b18340900] Terminating thread with return code -40 (Function not implemented)
[vost#0:1/h264_nvenc @ 0000025b18330d80] Could not open encoder before EOF
[vost#0:1/h264_nvenc @ 0000025b18330d80] Task finished with error code: -22 (Invalid argument)
[vost#0:1/h264_nvenc @ 0000025b18330d80] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 0000025b18569c40] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lq=0.0 size=       0KiB time=N/A bitrate=N/A speed=N/A

如果我尝试使用 -vf 而不是“filter_complex”:

[matroska,webm @ 000001814b872040] Invalid Block Addition value 0x0 for unknown Block Addition Mapping type 68766345, name ""
[matroska,webm @ 000001814b872040] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[matroska,webm @ 000001814b872040] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Multiple -hwaccel options specified for stream 0, only the last option '-hwaccel cuda' will be used.
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0'
[vf#0:0 @ 000001814b895fc0] Error reinitializing filters!
[vf#0:0 @ 000001814b895fc0] Task finished with error code: -40 (Function not implemented)
[vf#0:0 @ 000001814b895fc0] Terminating thread with return code -40 (Function not implemented)
[vost#0:0/h264_nvenc @ 000001814b892780] Could not open encoder before EOF
[vost#0:0/h264_nvenc @ 000001814b892780] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_nvenc @ 000001814b892780] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 000001814b88e240] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A  

有人可以告诉我现在使用 rtx 4090 执行此操作的正确方法吗?

video ffmpeg nvidia video-encoding
1个回答
0
投票

显然我已经通过使用最新的 ffmpeg (v7) 和这个命令解决了:

-fps_mode:v 直通-filter_complex "scale_cuda=1920:1080:format=yuv420p:interp_algo=lanczos,hwdownload" -c:v h264_nvenc -preset 18 -pix_fmt yuv420p -profile:v 高 -b:v 13000K -an -sn

预输入:

-hwaccel cuda -hwaccel_output_format cuda

© www.soinside.com 2019 - 2024. All rights reserved.