jjm2473 / ffmpeg-rk

支持rockchip mpp硬件加速编解码的ffmpeg版本。Forked ffmpeg that supports rkmpp decodeing, encoding and rga scaling
https://ffmpeg.org
Other
178 stars 31 forks source link

h264_rkmpp 硬编码时报错 #26

Closed bjw1107 closed 9 months ago

bjw1107 commented 10 months ago

当我使用如下命令: ffmpeg -c:v h264_rkmpp -i rtsp://admin:cssrc702@172.10.1.5:554/Streaming/Channels/01 -rtsp_transport udp -s 1920x1080 -r 20 -b:v 1000k -f rtsp rtsp://user:userpass@199.3.0.31:8554/camera1 报错: [h264_rkmpp @ 0x55b74919f0] Decoder noticed an info change (1920x1080), stride(1920x1088), format=0 Segmentation fault (core dumped) 详细log: [h264_mp4toannexb @ 0x559ad7bd50] The input looks like it is Annex B already [h264_rkmpp @ 0x559af32bb0] Initializing RKMPP decoder. [h264_rkmpp @ 0x559af32bb0] RKMPP decoder initialized successfully. Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (h264_rkmpp)) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264_rkmpp @ 0x559af32bb0] Wrote 35976 bytes to decoder [h264_rkmpp @ 0x559af32bb0] Timeout getting decoded frame. Last message repeated 1 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264_rkmpp @ 0x559af32bb0] Wrote 17090 bytes to decoder [h264_rkmpp @ 0x559af32bb0] Timeout getting decoded frame. Last message repeated 1 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264_rkmpp @ 0x559af32bb0] Wrote 18196 bytes to decoder 请问如何解决。。

jjm2473 commented 10 months ago

可能不支持这种图像格式,目前只针对视频文件转码做了适配,也就是常用的YUV格式才支持,如果要支持其他格式,需要知道ffmpeg格式和MPP格式的对应关系。

wnpllrzodiac commented 9 months ago

(1920x1080), stride(1920x1088), 看起来有stride,需要套个rescale filter预处理下? 图片格式从你的日志看不到。需要ffprobe看一下。

jjm2473 commented 9 months ago

ffmpeg -c:v h264_rkmpp *** -i *表示用h264_rkmpp解码,跟编码有什么关系?你要用h264_rkmpp编码的话,起码要在-i参数之后。而且仔细看wiki中的示例命令,只要是硬件编码,一律使用scale_rga过滤器。