BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
810 stars 71 forks source link

[rtsp @ 0x7f7d7a7f8980] max delay reached. need to consume packet [rtsp @ 0x7f7d7a7f8980] RTP: missed 6 packets #99

Open zhangsong1234 opened 10 months ago

zhangsong1234 commented 10 months ago

[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流画面有很多马赛卡以及卡顿

zhangsong1234 commented 10 months ago

看起来可能是rtsp使用了udp传输导致的丢包,程序中是否可以配置-rtsp_transport tcp参数?

HuHeng commented 10 months ago

这个应该是个format参数,可以写在ffmpeg_decoder模块传参时增加这个参数试试,dec_params内没有被模块显式处理的参数会被透传到avformat_open_input/avcodec_open2接口内的option参数里。 "dec_params:{"rtsp_transport":"tcp"}"

zhangsong1234 commented 10 months ago

ffmpeg_decoder.cpp 中 获取input_path后,添加如下代码,解决了丢包问题 if (inputpath.find("rtsp://") != -1) { av_dict_set(&opts, "rtsp_transport", "tcp", 0); } 但在拉流过程中,通过调用forcer_close(),有时会导致程序core掉,应该是ffmpeg未释放导致