Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhangsong1234 opened this issue Jan 30, 2024 · 3 comments

Comments

@zhangsong1234
Copy link

[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
Copy link
Author

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

@HuHeng
Copy link
Collaborator

HuHeng commented Jan 31, 2024

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

@zhangsong1234
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants