gpt4 book ai didi

ffmpeg - 我可以在生成的 ffmpeg 视频上测试 nvidia 解码器(nvdec/cuvid)的功能吗?

转载 作者:行者123 更新时间:2023-12-04 23:11:43 29 4
gpt4 key购买 nike

目标:在我的脚本中,我尝试检查我的显卡上的 nvdec 是否可用/功能正常。
我此时没有任何源视频(H.264/H.265)可用作输入,所以我想生成它。
也不需要使用编码器,因为我不需要输出文件。
我正在测试命令 ffmpeg ($?) 的退出代码。
我使用 nvidia-smi 来检查 dec/enc 负载。
我的尝试:

ffmpeg -y -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid -f lavfi -i testsrc="duration=5:size=1920x1080:rate=25" -c:v copy test.ts
我的命令的输出:
Input #0, lavfi, from 'testsrc=duration=5:size=1920x1080:rate=25':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264, rgb24, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
No information about the input framerate is available. Falling back to a default value of 25fps for output stream #0:0. Use the -r option if you want a different framerate.
Output #0, null, to 'pipe:':
Metadata:
encoder : Lavf58.65.101
Stream #0:0: Video: wrapped_avframe, rgb24, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc58.119.100 wrapped_avframe
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
我在 test.ts 之前尝试添加 -t 5 但没有任何改变。
输出 ts 文件大小为零。
如果我调试命令,我希望将它添加到末尾“-f null - 2>/dev/null”。输出文件仅用于调试目的。
谢谢你。

最佳答案

您需要先使用 H.264 编码器生成视频,然后再尝试单独解码。

ffmpeg -y -f lavfi -i "testsrc2=duration=5:size=1920x1080:rate=25" -c:v h264 test.ts

ffmpeg -c:v h264_cuvid -i test.ts -f null -

关于ffmpeg - 我可以在生成的 ffmpeg 视频上测试 nvidia 解码器(nvdec/cuvid)的功能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65974963/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com