From adc3d743441cfab55c67519a584c313775986091 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Wed, 28 Apr 2021 17:32:16 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/tests/pusher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/tests/pusher.c b/api/tests/pusher.c index 3c5d580b..1ea158f1 100644 --- a/api/tests/pusher.c +++ b/api/tests/pusher.c @@ -48,9 +48,9 @@ void release_pusher(mk_media *ptr) { void release_context(Context **ptr){ if (ptr && *ptr) { - release_pusher((*ptr)->pusher); - release_media((*ptr)->media); - release_player((*ptr)->player); + release_pusher(&(*ptr)->pusher); + release_media(&(*ptr)->media); + release_player(&(*ptr)->player); free(*ptr); *ptr = NULL; } From 3cc640f96e3c4d99ff76cfa7a1e01b487b117906 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 09:24:09 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/config.cpp | 6 ------ src/Common/config.h | 4 ---- 2 files changed, 10 deletions(-) diff --git a/src/Common/config.cpp b/src/Common/config.cpp index 5fc2dc3a..47b8177a 100644 --- a/src/Common/config.cpp +++ b/src/Common/config.cpp @@ -190,16 +190,10 @@ namespace Rtp { //RTP打包最大MTU,公网情况下更小 const string kVideoMtuSize = RTP_FIELD"videoMtuSize"; const string kAudioMtuSize = RTP_FIELD"audioMtuSize"; -//RTP排序缓存最大个数 -const string kMaxRtpCount = RTP_FIELD"maxRtpCount"; -//如果RTP序列正确次数累计达到该数字就启动清空排序缓存 -const string kClearCount = RTP_FIELD"clearCount"; onceToken token([](){ mINI::Instance()[kVideoMtuSize] = 1400; mINI::Instance()[kAudioMtuSize] = 600; - mINI::Instance()[kMaxRtpCount] = 50; - mINI::Instance()[kClearCount] = 10; },nullptr); } //namespace Rtsp diff --git a/src/Common/config.h b/src/Common/config.h index 6b26ab3c..a104a789 100644 --- a/src/Common/config.h +++ b/src/Common/config.h @@ -247,10 +247,6 @@ namespace Rtp { extern const string kVideoMtuSize; //RTP打包最大MTU,公网情况下更小 extern const string kAudioMtuSize; -//RTP排序缓存最大个数 -extern const string kMaxRtpCount; -//如果RTP序列正确次数累计达到该数字就启动清空排序缓存 -extern const string kClearCount; } //namespace Rtsp ////////////组播配置/////////// From 8e9d7a9fd53e7900442da1d7cbb97d61921a268d Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 11:41:35 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BD=9C=E8=80=85=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8B=98=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTHORS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 2fbea1c9..cb4eba4b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,12 +23,12 @@ sunhui mirs Kevin Cheng Liu Jiang -along +along(https://github.com/alongl) qingci lyg1949 zhlong -Luke 大裤衩 <3503207480@qq.com> droid.chow [陈晓林](https://github.com/musicwood) -[老衲不出家](https://github.com/monktan89) \ No newline at end of file +[老衲不出家](https://github.com/monktan89) +big panda <2381267071@qq.com> \ No newline at end of file From e8a409b8117cbe768a7d420f0fd7cc0d69e21e77 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 11:41:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1322dfa5..e3d677c9 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ bash build_docker_images.sh - [基于ZLMediaKit分支的管理WEB网站](https://github.com/chenxiaolei/ZLMediaKit_NVR_UI) - 流媒体管理平台 - - [功能强大的流媒体控制管理接口平台,支持GB28181](https://github.com/chatop2020/StreamNode) + - [功能强大的流媒体控制管理接口平台,支持GB28181](https://github.com/chatop2020/AKStream) - [GB28181-2016网络视频平台](https://github.com/648540858/wvp-GB28181-pro) - [node-js版本的GB28181平台](https://gitee.com/hfwudao/GB28181_Node_Http) - [Go实现的海康ehome服务器](https://github.com/tsingeye/FreeEhome) @@ -218,11 +218,10 @@ bash build_docker_images.sh [mirs](fangpengcheng@bilibili.com>) [Kevin Cheng](kevin__cheng@outlook.com>) [Liu Jiang](root@oopy.org>) -[along](alongl@users.noreply.github.com>) +[along](https://github.com/alongl) [qingci](xpy66swsry@gmail.com>) [lyg1949](zh.ghlong@qq.com>) [zhlong](zh.ghlong@qq.com>) -[Luke](automan@easydarwin.org>) [大裤衩](3503207480@qq.com>) [droid.chow](droid.chow@gmail.com>) [陈晓林](https://github.com/musicwood) @@ -240,6 +239,6 @@ bash build_docker_images.sh 欢迎捐赠以便更好的推动项目的发展,谢谢您的支持! 同时欢迎捐赠公网服务器用于在线展示效果。 -[支付宝](https://gitee.com/xia-chu/other/raw/master/IMG_3919.JPG) +[支付宝](https://github.com/xia-chu/other/blob/master/IMG_3919.JPG) -[微信](https://gitee.com/xia-chu/other/raw/master/IMG_3920.JPG) +[微信](https://github.com/xia-chu/other/blob/master/IMG_3920.JPG) From 3da874b6a17cca6d93fefeda1a982e4d3e3f72e7 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 23 Apr 2021 16:37:08 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E3=80=81=E5=8A=A0=E5=BF=AB=E6=B5=81=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/tests/pusher.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/tests/pusher.c b/api/tests/pusher.c index 1ea158f1..95f33dc7 100644 --- a/api/tests/pusher.c +++ b/api/tests/pusher.c @@ -91,7 +91,7 @@ void API_CALL on_mk_play_event_func(void *user_data, int err_code, const char *e if (err_code == 0) { //success log_debug("play success!"); - ctx->media = mk_media_create("__defaultVost__", "live", "test", 0, 0, 0); + ctx->media = mk_media_create("__defaultVhost__", "live", "test", 0, 0, 0); int video_codec = mk_player_video_codecId(ctx->player); int audio_codec = mk_player_audio_codecId(ctx->player); @@ -108,6 +108,7 @@ void API_CALL on_mk_play_event_func(void *user_data, int err_code, const char *e mk_player_audio_channel(ctx->player), mk_player_audio_bit(ctx->player)); } + mk_media_init_complete(ctx->media); mk_media_set_on_regist(ctx->media, on_mk_media_source_regist_func, ctx); } else { From af59fdeb8629cf07d0d62a7016ffdce210788e63 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 18:01:48 +0800 Subject: [PATCH 6/6] =?UTF-8?q?addStreamProxy=E6=8E=A5=E5=8F=A3=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=B6=85=E6=97=B6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postman/ZLMediaKit.postman_collection.json | 6 ++++++ server/WebApi.cpp | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/postman/ZLMediaKit.postman_collection.json b/postman/ZLMediaKit.postman_collection.json index 75d9cbb9..93fd341e 100644 --- a/postman/ZLMediaKit.postman_collection.json +++ b/postman/ZLMediaKit.postman_collection.json @@ -512,6 +512,12 @@ "value": null, "description": "rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播", "disabled": true + }, + { + "key": "timeout_sec", + "value": "10", + "description": "拉流超时时间,单位秒,float类型", + "disabled": true } ] } diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 6c88f4f5..9160c559 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -600,6 +600,7 @@ void installWebApi() { bool enable_hls, bool enable_mp4, int rtp_type, + float timeoutSec, const function &cb){ auto key = getProxyKey(vhost,app,stream); lock_guard lck(s_proxyMapMtx); @@ -614,6 +615,12 @@ void installWebApi() { //指定RTP over TCP(播放rtsp时有效) (*player)[kRtpType] = rtp_type; + + if (timeoutSec > 0.1) { + //播放握手超时时间 + (*player)[kTimeoutMS] = timeoutSec * 1000; + } + //开始播放,如果播放失败或者播放中止,将会自动重试若干次,默认一直重试 player->setPlayCallbackOnce([cb,key](const SockException &ex){ if(ex){ @@ -643,6 +650,7 @@ void installWebApi() { allArgs["enable_hls"],/* 是否hls转发 */ allArgs["enable_mp4"],/* 是否MP4录制 */ allArgs["rtp_type"], + allArgs["timeout_sec"], [invoker,val,headerOut](const SockException &ex,const string &key) mutable{ if (ex) { val["code"] = API::OtherFailed; @@ -1133,6 +1141,7 @@ void installWebApi() { true,/* 开启hls转发 */ false,/* 禁用MP4录制 */ 0,//rtp over tcp方式拉流 + 10,//10秒超时 [invoker,val,headerOut](const SockException &ex,const string &key) mutable{ if(ex){ val["code"] = API::OtherFailed;