Open zhangsong1234 opened 10 months ago
看起来可能是rtsp使用了udp传输导致的丢包,程序中是否可以配置-rtsp_transport tcp参数?
这个应该是个format参数,可以写在ffmpeg_decoder模块传参时增加这个参数试试,dec_params内没有被模块显式处理的参数会被透传到avformat_open_input/avcodec_open2接口内的option参数里。 "dec_params:{"rtsp_transport":"tcp"}"
ffmpeg_decoder.cpp 中 获取input_path后,添加如下代码,解决了丢包问题 if (inputpath.find("rtsp://") != -1) { av_dict_set(&opts, "rtsp_transport", "tcp", 0); } 但在拉流过程中,通过调用forcer_close(),有时会导致程序core掉,应该是ffmpeg未释放导致
[rtsp @ 0x7f7d7a7f8980] max delay reached. need to consume packet [rtsp @ 0x7f7d7a7f8980] RTP: missed 2 packets [rtsp @ 0x7f7d7a7f8980] max delay reached. need to consume packet [rtsp @ 0x7f7d7a7f8980] RTP: missed 2 packets [rtsp @ 0x7f7d7a7f8980] max delay reached. need to consume packet [rtsp @ 0x7f7d7a7f8980] RTP: missed 6 packets [rtsp @ 0x7f7d7a7f8980] max delay reached. need to consume packet [rtsp @ 0x7f7d7a7f8980] RTP: missed 2 packets
输入的input_path 是一个由摄像头输出的rtsp流,输出output_path 是一个rtmp流,运行过程中会有很多如上丢包告警,导致拉取的rtmp流画面有很多马赛卡以及卡顿