当我使用ffmpeg推送流时:
ffmpeg -loglevel debug -re -i a.flv -c:v h264_nvenc -b:v 145M -maxrate:v 200M -c:a copy -f flv rtmp://localhost/live/test
获取失败:
[format @ 0000000002861760] Setting 'pix_fmts' to value 'yuv420p|nv12|yuv444p'
[AVFilterGraph @ 00000000028470c0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[h264 @ 000000000324d2a0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 000000000324d2a0] nal_unit_type: 8, nal_ref_idc: 3
[h264_nvenc @ 00000000028446c0] Nvenc initialized successfully
[h264_nvenc @ 00000000028446c0] 1 CUDA capable devices found
[h264_nvenc @ 00000000028446c0] [ GPU #0 - < GeForce GTX 1080 Ti > has Compute SM 6.1 ]
[h264_nvenc @ 00000000028446c0] supports NVENC
[h264_nvenc @ 00000000028446c0] InitializeEncoder failed: invalid param (8)
[h264_nvenc @ 00000000028446c0] Nvenc unloaded
Output #0, flv, to 'rtmp://localhost/live/test':
Metadata:
Server : NGINX RTMP (github.com/arut/nginx-rtmp-module)
displayWidth : 1920
displayHeight : 960
fps : 0
profile :
level :
encoder : Lavf57.41.100
Stream #0:0, 0, 0/0: Unknown: none, SAR 1:1 DAR 0:0
Metadata:
encoder : Lavc57.50.100 h264_nvenc
Stream #0:1, 0, 0/0: Unknown: none
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 000000000322b620] Statistics: 0 seeks, 0 writeouts
但设置为比特级144M时成功
ffmpeg -loglevel debug -re -i a.flv -c:v h264_nvenc -b:v 144M -maxrate:v 200M -c:a copy -f flv rtmp://localhost/live/test
有人知道nvEncInitializeEncoder的限制吗?