langhuihui / monibuca

🧩 Monibuca is a Modularized, Extensible framework for building Streaming Server
https://monibuca.com
MIT License
1.47k stars 242 forks source link

通过ffmpeg拖送rtsp流到monibuca 控制台一直报错 lost rtp packet 预览播放 会卡住不动 #120

Closed yh4922 closed 3 months ago

yh4922 commented 7 months ago

推送命令

ffmpeg -rtsp_transport tcp -i rtsp://admin:123456@192.168.18.40:554/Streaming/Channels/101 -c:a copy -c:v copy -f rtsp rtsp://192.168.18.103/live/test40

控制台日志

10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41741, "lastSeq2": 41737}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41767, "lastSeq2": 41764}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41780, "lastSeq2": 41777}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41795, "lastSeq2": 41790}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41809, "lastSeq2": 41805}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41823, "lastSeq2": 41819}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41837, "lastSeq2": 41833}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41851, "lastSeq2": 41847}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41865, "lastSeq2": 41861}
10:17:17        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41880, "lastSeq2": 41875}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41933, "lastSeq2": 41929}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41961, "lastSeq2": 41957}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41974, "lastSeq2": 41971}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 41990, "lastSeq2": 41984}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 42004, "lastSeq2": 42000}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 42032, "lastSeq2": 42028}
10:17:18        WARN    lost rtp packet        {"流": "live/test40", "id": 3, "轨道": "h264", "lastSeq": 42046, "lastSeq2": 42042}

播放测试

http://192.168.18.103:8080/preview/live/test40?type=ws-raw

每次播放都只会播放一两帧 就卡住了

langhuihui commented 7 months ago

你可以直接配置让m7s 拉摄像头的 rtsp 流

yh4922 commented 7 months ago

这是测试场景 实际场景 rtsp 和 m7s 不在一个局域网 需要通过ffmpeg 推送到云上的m7s

langhuihui commented 7 months ago

那你加个 tcp 参数,否则会丢包

yh4922 commented 7 months ago

说的是 m7s的配置么 ffmpeg 我有加 -rtsp_transport tcp

langhuihui commented 7 months ago

我看到你加了,但是你加的是从远端拉流的 tcp,推到 m7s 你没加

yh4922 commented 7 months ago

image 这个不就是推流的参数么

langhuihui commented 7 months ago

没错,你只写了一个 现在你有两条 rtsp 流,一条是从远端到 ffmpeg,另一条是从 ffmpeg 到m7s

yh4922 commented 7 months ago

image 没太明白

langhuihui commented 7 months ago

ffmpeg -rtsp_transport tcp -i rtsp://admin:123456@192.168.18.40:554/Streaming/Channels/101 -c:a copy -c:v copy -f rtsp -rtsp_transport tcp rtsp://192.168.18.103/live/test40

yh4922 commented 7 months ago

确实可以 不会报错了 一时没反应过来 推流那边也可以加这个参数 感谢感谢🙏🙏🙏