|
发表于 2020-5-7 12:06:07
|
显示全部楼层
主要是卡在frame = rtsp.read_rgb(1280, 720)这一步,下面一条测试语句frame一直打印不出来。
如果读到数据应该有返回,但目前就卡在这,必须手动杀掉进程才能关掉
代码如下:
- if __name__ == '__main__':
- url = "rtsp://192.168.1.64:554/ch1/main/av_stream"
- usr = "cxqz"
- pwd = "hb123456"
- rtsp = toy.input.createRtspClient(url, usr, pwd, False, True)
- rtsp.connect()
- while rtsp.is_opened():
- print("hutx test")
- frame = rtsp.read_rgb(1280, 720)
- print("frame:", frame)
- rtsp.disconnect()
输出如下:
- [toybrick@toybrick hutx]$ python3 test_rtsp.py
- [05/07 00:00:00.203] D/: listening rtp port 14286
- [05/07 00:00:00.203] D/: mMppCtx null or no init...
- [05/07 00:00:00.203] D/: listening rtcp port 14287
- [05/07 00:00:00.203] D/: curlto rtsp://192.168.1.64:554/ch1/main/av_stream , cli 14286:14296, tcp: 0
- [05/07 00:00:00.213] D/: # Found [0] media: video
- [05/07 00:00:00.213] D/: # Found [0] control: rtsp://192.168.1.64:554/ch1/main/av_stream/trackID=1
- [05/07 00:00:00.213] D/: # Found [0] rtpmap: id:96 format:H264 bitrate:90000
- [05/07 00:00:00.213] D/: # Found [1] media: audio
- [05/07 00:00:00.213] D/: # Found [1] control: rtsp://192.168.1.64:554/ch1/main/av_stream/trackID=2
- [05/07 00:00:00.213] D/: # Found [1] rtpmap: id:8 format:PCMA bitrate:8000
- [05/07 00:00:00.213] D/: # Total found 2 channel(s).
- [05/07 00:00:00.213] D/: TRACK [0] : rtsp://192.168.1.64:554/ch1/main/av_stream/trackID=1 , format=1
- [05/07 00:00:00.213] D/: setup 14286 , 14287, uri: rtsp://192.168.1.64:554/ch1/main/av_stream/trackID=1
- [05/07 00:00:00.220] D/: TRACK [1] : rtsp://192.168.1.64:554/ch1/main/av_stream/trackID=2 , format=4
- <b><font color="#ff0000">hutx test</font></b>
- [05/07 00:00:00.330] D/: drm render open ...
- [05/07 00:00:00.460] D/: Video SSRC Changed! 0 -> 741809624
- [05/07 00:00:00.460] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:64): rtp lost one packet ... mDebugCntRtpLost: 65535 > 7297
- mpi: mpp version: Without VCS info
- mpp_rt: NOT found ion allocator
- mpp_rt: found drm allocator
- [05/07 00:00:00.468] D/: aaaaaaaaaaaaaaa
- [05/07 00:00:00.468] D/: 11111111
- [05/07 00:00:00.468] D/: bbbbbbbbbbbbbb
- [05/07 00:00:00.468] D/: RTP4UP_UNIT [0x5593cd4a30] loss/recv:-5823.90/ 0.10 SEI|SPS|PPS|NI|I: 0.00|0.10|0.00|0.00|0.00
- [05/07 00:00:00.469] D/: aaaaaaaaaaaaaaa
- [05/07 00:00:00.469] D/: bbbbbbbbbbbbbb
- [05/07 00:00:00.469] D/: aaaaaaaaaaaaaaa
- [05/07 00:00:00.469] D/: bbbbbbbbbbbbbb
- [05/07 00:00:00.470] W/: (onTransmitIn in unit_rtp_h264_unpack.cpp:64): rtp lost one packet ... mDebugCntRtpLost: 7305 > 7307
- [05/07 00:00:00.659] D/: aaaaaaaaaaaaaaa
- [05/07 00:00:00.659] D/: bbbbbbbbbbbbbb
- [05/07 00:00:00.779] D/: aaaaaaaaaaaaaaa
|
|