Toybrick

mpp库拉海康摄像头的主码流解码不成功

hhhjjjwww

注册会员

积分
165
发表于 2021-10-14 10:15:16    查看: 165|回复: 3 | [复制链接]    打印 | 显示全部楼层
情况如下:
根据官方提供的https://t.rock-chips.com/forum.p ... &extra=page%3D1
RK3399Pro入门教程(7)RTSP库的使用在我的rk3399prod上面部署相关环境(debian10系统),摄像头是海康威视的摄像头,rtsp视频流主码流参数如下
#define RTSP_URL    "rtsp://172.16.40.100:554/Streaming/Channels/401"
#define RTSP_USER   "litinghong"
#define RTSP_PWD    "Ax30hcDgx9"
运行结果:


toybrick@debian10:~/projects/local_rtsp/build$ ./rtsp_ssd
mpp[16988]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[16988]: mpp_rt: NOT found ion allocator
mpp[16988]: mpp_rt: found drm allocator
[2021/10/14 02:12:39] D/: listening rtp port 43861
[2021/10/14 02:12:39] D/: listening rtp port 43851
[2021/10/14 02:12:39] D/: listening rtcp port 43852
[2021/10/14 02:12:39] D/: listening rtcp port 43862
[2021/10/14 02:12:39] D/: curlto rtsp://172.16.40.100:554/Streaming/Channels/401 , cli 43851:43861, tcp: 0
[2021/10/14 02:12:39] D/: # FOUND[0] media: video
[2021/10/14 02:12:39] D/: # FOUND[0] rtpmap: id:96 format:H264 bitrate:90000
[2021/10/14 02:12:39] D/: # FOUND[0] control: trackID=video
[2021/10/14 02:12:39] D/: # TOTAL FOUND  1
[2021/10/14 02:12:39] D/: TRACK [0] : trackID=video
[2021/10/14 02:12:39] D/: setup 43851 , 43852, uri: rtsp://172.16.40.100:554/Streaming/Channels/401/trackID=video
[2021/10/14 02:12:39] D/: Video SSRC Changed! 0 -> 1459366289
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 65535 > 10052
[2021/10/14 02:12:39] D/: RTP4UP_UNIT_SE [0x559d55f7e8] loss/recv:-1849.47/ 0.03 SEI|SPS|PPS|NI|I: 0.00|0.00|0.00|0.03|0.00
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10052 > 10055
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10055 > 10059
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10059 > 10066
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10066 > 10073
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10073 > 10077
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10077 > 10084
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10084 > 10091
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10091 > 10098
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10098 > 10105
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10105 > 10109
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10109 > 10116
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10116 > 10123
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10123 > 10130
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10131 > 10136
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10136 > 10139
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10139 > 10144
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10144 > 10148
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10149 > 10155
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10155 > 10161
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10161 > 10166
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10166 > 10171
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10171 > 10177
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10177 > 10184
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10184 > 10191
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10191 > 10198
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10198 > 10203
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10203 > 10209
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10209 > 10211
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10211 > 10217
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10217 > 10224
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10224 > 10231
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10231 > 10235
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10235 > 10237
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10242 > 10246
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10246 > 10249
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10249 > 10255
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10255 > 10261
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10261 > 10266
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10266 > 10272
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10272 > 10275
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10278 > 10280
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10280 > 10284
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10284 > 10291
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10291 > 10298
[2021/10/14 02:12:39] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:53): rtp lost one packet ... mDebugCntRtpLost: 10298 > 10301
frame recived 1032
frame recived 872
frame recived 824
mpp[16988]: mpp_log: decode_get_frame failed, return -8.
frame recived 872
frame recived 824
frame recived 856
frame recived 888
frame recived 808
frame recived 840
frame recived 920
frame recived 792
mpp[16988]: mpp_log: decode_get_frame failed, return -8.
frame recived 872
frame recived 840
frame recived 824
frame recived 824
frame recived 856
frame recived 872
frame recived 824
mpp[16988]: mpp_log: decode_get_frame failed, return -8.
frame recived 888
frame recived 840
frame recived 856
frame recived 920
frame recived 856
frame recived 968
frame recived 904
frame recived 872
mpp[16988]: mpp_log: decode_get_frame failed, return -8.
frame recived 920
frame recived 968
frame recived 1096
frame recived 968
frame recived 1000
frame recived 1016
frame recived 920
mpp[16988]: mpp_log: decode_get_frame failed, return -8.
frame recived 920
frame recived 952
frame recived 1048
frame recived 1032
frame recived 936
frame recived 920
frame recived 968
frame recived 904
mpp[16988]: mpp_log: decode_get_frame failed, return -8



但是将主码流换成子码流
"rtsp://172.16.40.100:554/Streaming/Channels/402"
程序就能正常运行,有视频显示框弹出,请问大家有遇到这种情况吗?请各位技术专家指导一下,感谢





回复

使用道具 举报

jefferyzhang

论坛元老

积分
8634
发表于 2021-10-14 10:29:32 | 显示全部楼层
本帖最后由 jefferyzhang 于 2021-10-14 10:30 编辑

1. mpp只负责硬件编解码,不负责rtsp
2. 你用的应该是toybrick的demo rtsp库,那个为了避免版权问题只是徒手写的rtsp交互库,兼容性不佳
3. 建议你用这个哥么的方式做rtsp client: https://t.rock-chips.com/forum.p ... 3446&extra=page%3D1
4. 如果你是商用,我们可以给你推荐RK的软件方案商来写代码
回复

使用道具 举报

hhhjjjwww

注册会员

积分
165
 楼主| 发表于 4 天前 | 显示全部楼层
jefferyzhang 发表于 2021-10-14 10:29
1. mpp只负责硬件编解码,不负责rtsp
2. 你用的应该是toybrick的demo rtsp库,那个为了避免版权问题只是徒 ...

张老师您好,我发现这个toybrick的demo在摄像头直连的情况可以正常运行,摄像头在nvr连接情况下这个demo就不能正常运行了,请问以后这个问题能解决吗?另外,您给的那个连接解决方案也是有点问题,虽然能够解决nvr摄像头rtsp拉流问题,但是那个程序不支持硬件加速解码,导致cpu占用率很高。
回复

使用道具 举报

jefferyzhang

论坛元老

积分
8634
发表于 4 天前 | 显示全部楼层
hhhjjjwww 发表于 2021-10-18 10:38
张老师您好,我发现这个toybrick的demo在摄像头直连的情况可以正常运行,摄像头在nvr连接情况下这个demo ...

我只是让你参考下gst的rtsp client交互,后面解码完全可以用回mpp。
我们demo不会继续维护的。
回复

使用道具 举报

zhuyuliang0

注册会员

积分
146
发表于 4 天前 | 显示全部楼层
jefferyzhang 发表于 2021-10-18 11:03
我只是让你参考下gst的rtsp client交互,后面解码完全可以用回mpp。
我们demo不会继续维护的。 ...

不要直接使用本库,先要了解和学习gstreamer流程,并且安装mpp的gstreamer的插件才能进行硬解码。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表