From a9c433405b4643d2d88791fb4b256c38ae443a84 Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Sun, 11 Jun 2023 14:11:28 +0800 Subject: [PATCH] -Start the project and introduce the conf directory, adding several common configuration examples -Customizable favicon.ico -Adding Pause and Resume methods to Stream in the engine -The engine introduces sync.Cond to replace the pseudo Spinlock -Preview plugin introduction jessibuca pro demo -Jessica plugin introduces support for HTTP/ws-h264/h265 bare streams -Recording plugin adds a prompt in the log when the file cannot be created -PS plugin fixes a bug where a single port cannot be reused after use -Webtransport starts by default through built-in certificate mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 启动工程引入conf目录,添加若干常用配置示例 - 可以自定义favicon.ico - 引擎中Stream增加Pause和Resume方法 - 引擎引入sync.Cond替代伪自旋锁 - 预览插件引入jessibuca pro demo - jessica插件引入对http/ws-h264/h265 裸流支持 - 录制插件在无法创建文件时日志中增加提示 - ps插件修复一个单端口使用后无法重复使用的bug - webtransport通过内置证书方式默认启动 --- Dockerfile | 3 ++- conf/hls.yaml | 9 +++++++++ conf/https.yaml | 7 +++++++ conf/rtmp.yaml | 6 ++++++ conf/rtmps.yaml | 4 ++++ conf/rtsp.yaml | 23 +++++++++++++++++++++++ config.yaml | 40 +++++++++++----------------------------- favicon.ico | Bin 0 -> 16958 bytes go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 10 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 conf/hls.yaml create mode 100644 conf/https.yaml create mode 100644 conf/rtmp.yaml create mode 100644 conf/rtmps.yaml create mode 100644 conf/rtsp.yaml create mode 100644 favicon.ico diff --git a/Dockerfile b/Dockerfile index 7baf076d..ce16830d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,11 @@ FROM alpine:latest WORKDIR /opt ADD monibuca /opt +ADD config.yaml /opt ADD local.monibuca.com.key /opt ADD local.monibuca.com_bundle.pem /opt #暴露端口 EXPOSE 8080 8081 1935 554 58200 5060 8000-9000 EXPOSE 5060/udp 58200/udp 8000-9000/udp #最终运行docker的命令 -ENTRYPOINT ["./m7s"] \ No newline at end of file +ENTRYPOINT ["./monibuca"] \ No newline at end of file diff --git a/conf/hls.yaml b/conf/hls.yaml new file mode 100644 index 00000000..0f1c6543 --- /dev/null +++ b/conf/hls.yaml @@ -0,0 +1,9 @@ +# hls纯转发,即从HLS->HLS + +global: + disableall: true + enablertp: false + enableavcc: false +hls: + enable: true + relaymode: 1 \ No newline at end of file diff --git a/conf/https.yaml b/conf/https.yaml new file mode 100644 index 00000000..eba9aa49 --- /dev/null +++ b/conf/https.yaml @@ -0,0 +1,7 @@ +# 默认的http端口是8080 +# 这里指定8081为https端口 +# 本地访问https://local.monibuca.com:8081,请配置host文件,将127.0.0.1 local.monibuca.com加入到host文件中 +global: + listenaddrlts: :8081 + certfile: local.monibuca.com_bundle.pem + keyfile: local.monibuca.com.key \ No newline at end of file diff --git a/conf/rtmp.yaml b/conf/rtmp.yaml new file mode 100644 index 00000000..db5117af --- /dev/null +++ b/conf/rtmp.yaml @@ -0,0 +1,6 @@ +# 只包含rtmp,关闭其他所有插件,只能用于rtmp的转发 +global: + disableall: true + enablertp: false +rtmp: + enable: true \ No newline at end of file diff --git a/conf/rtmps.yaml b/conf/rtmps.yaml new file mode 100644 index 00000000..aeda1561 --- /dev/null +++ b/conf/rtmps.yaml @@ -0,0 +1,4 @@ +# 开启接受rtmps +rtmp: + tcp: + listenaddrtls: :443 \ No newline at end of file diff --git a/conf/rtsp.yaml b/conf/rtsp.yaml new file mode 100644 index 00000000..e9a9d059 --- /dev/null +++ b/conf/rtsp.yaml @@ -0,0 +1,23 @@ +# rtsp 拉流配置 +global: + disableall: true # 需要转换其他协议的话,需要将disableall设置为false + enableavcc: false # 如果需要转换成rtmp和flv的话,需要改成true + delayclosetimeout: 2s # 无订阅者时,2s后关闭拉流 +rtsp: + enable: true # 如果disableall为false的话,这个可以不需要写 + pullprotocol: tcp + pull: + pullonstart: + rtsp/obs: rtsp://localhost:8554/live + # live/test1: rtsp://localhost:8554/live/rtsp + # live/test2: rtsp://localhost:8554/live/rtsp + # live/test3: rtsp://localhost:8554/live/rtsp + # live/test4: rtsp://localhost:8554/live/rtsp + # live/test5: rtsp://localhost:8554/live/rtsp + # live/test6: rtsp://localhost:8554/live/rtsp + # live/test7: rtsp://localhost:8554/live/rtsp + # live/test8: rtsp://localhost:8554/live/rtsp + # live/test9: rtsp://localhost:8554/live/rtsp + pullonsub: # 按需拉流 + rtsp/100: rtsp://admin:admin@192.168.0.100/cam/realmonitor?channel=1&subtype=0 + rtsp/101: rtsp://admin:admin@192.168.0.101/cam/realmonitor?channel=1&subtype=0 \ No newline at end of file diff --git a/config.yaml b/config.yaml index 5c0d3dec..1a7b97e9 100644 --- a/config.yaml +++ b/config.yaml @@ -4,32 +4,14 @@ # 插件配置参考各个插件的文档 # 插件都有一个enable配置,如果为false则不启用该插件,默认为true即不需要配置。 -# global: -# console: -# secret: "ab0f6913670062af4d2f15c621205178" - # http: - # listenaddrtls: :8081 - # certfile: local.monibuca.com_bundle.pem - # keyfile: local.monibuca.com.key -# record: -# enable: false -# hls: -# autorecord: true -# fragment: 20s -# webtransport: -# enable: false -# certfile: local.monibuca.com_bundle.pem -# keyfile: local.monibuca.com.key -# gb28181: -# # enable: false -# rtsp: -# # enable: false -# pull: -# pullonstart: -# live/rtsp: rtsp://admin:MOMA2021@47.94.226.17/Streaming/Channels/201?transportmode=unicast -# hls: -# # enable: false -# pull: -# pullonstart: true -# pulllist: -# live/hls: http://111.40.196.27/PLTV/88888888/224/3221225548/index.m3u8 +global: + http: + listenaddrtls: :8081 + certfile: local.monibuca.com_bundle.pem + keyfile: local.monibuca.com.key +llhls: + enable: false +hls: + enable: false +monitor: + enable: false \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b4575230201d21c0b4fc39b84f1aa69df549d0ed GIT binary patch literal 16958 zcmeHP4@_0p8GmaV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M#zSDXW0hz#o7V1F4{CKsw+7)&m(pCa?j>0oj2G3{AWF6cnN z`}FJdhyslvV?q3r2CY%jKh(Pg`ARy-E=eEZiY2xpU`4=+fE58N0#*d92v`xYB49

FIicu!|g$4meG^#gAvbABJC`(rroncO1i-N`NMjIyAz{16@EYj^i$ zgFbIio21F>?!V0W-QZUQZArGR<1}T`40<2bga3DddpQ5jW_zB02_tN_F}(YMeLoWJ EKc>D6;s5{u literal 0 HcmV?d00001 diff --git a/go.mod b/go.mod index 7eaff0ab..c3ec51d0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module monibuca go 1.19 require ( - m7s.live/engine/v4 v4.13.1 + m7s.live/engine/v4 v4.13.2 m7s.live/plugin/debug/v4 v4.0.0 m7s.live/plugin/edge/v4 v4.0.5 m7s.live/plugin/fmp4/v4 v4.0.3 @@ -11,17 +11,17 @@ require ( m7s.live/plugin/hdl/v4 v4.1.6 m7s.live/plugin/hls/v4 v4.3.0 m7s.live/plugin/hook/v4 v4.0.2 - m7s.live/plugin/jessica/v4 v4.1.4 + m7s.live/plugin/jessica/v4 v4.2.0 m7s.live/plugin/logrotate/v4 v4.0.4 m7s.live/plugin/monitor/v4 v4.0.2 - m7s.live/plugin/preview/v4 v4.0.4 - m7s.live/plugin/record/v4 v4.3.5 + m7s.live/plugin/preview/v4 v4.1.0 + m7s.live/plugin/record/v4 v4.3.6 m7s.live/plugin/room/v4 v4.0.9 m7s.live/plugin/rtmp/v4 v4.2.1 m7s.live/plugin/rtsp/v4 v4.2.2 m7s.live/plugin/snap/v4 v4.0.6 m7s.live/plugin/webrtc/v4 v4.1.6 - m7s.live/plugin/webtransport/v4 v4.0.5 + m7s.live/plugin/webtransport/v4 v4.0.6 ) require ( @@ -102,5 +102,5 @@ require ( golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.6.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - m7s.live/plugin/ps/v4 v4.0.4 // indirect + m7s.live/plugin/ps/v4 v4.0.5 // indirect ) diff --git a/go.sum b/go.sum index b5ea7a6d..f54c0222 100644 --- a/go.sum +++ b/go.sum @@ -398,8 +398,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -m7s.live/engine/v4 v4.13.1 h1:LWgrz1Jhcf6tbMGdHZV7aVshtqPzRdzKrk9xaM0b9ko= -m7s.live/engine/v4 v4.13.1/go.mod h1:LoALBfV5rmsz5TJQr6cmLxM33mfUE5BKBq/sMtXOVlc= +m7s.live/engine/v4 v4.13.2 h1:0OhHNenyLgZJW/6aU5NmT5yv5sXG/e0c2qxLmJ0LqgM= +m7s.live/engine/v4 v4.13.2/go.mod h1:LoALBfV5rmsz5TJQr6cmLxM33mfUE5BKBq/sMtXOVlc= m7s.live/plugin/debug/v4 v4.0.0 h1:yVFI/XB/EwR9NyihwvTIC/tocibPdE/NQZjDnOtRq/M= m7s.live/plugin/debug/v4 v4.0.0/go.mod h1:A/C1ViacCOK7EPeeCfiwlUrC2TUtRdEqzrR0Yd9b1KQ= m7s.live/plugin/edge/v4 v4.0.5 h1:0CEfbMAmD2jAUeb+jaZD5vvq968wrJli30PUkaNpbDo= @@ -414,18 +414,18 @@ m7s.live/plugin/hls/v4 v4.3.0 h1:1VcXQi72XOK9brgDgodtffv9PABtpqbXmyK0PVDNNj4= m7s.live/plugin/hls/v4 v4.3.0/go.mod h1:GFZyP5FIvqPX9NHh4J2kfURm1PwcXSkj4qT8DeX6sbI= m7s.live/plugin/hook/v4 v4.0.2 h1:fKwsx7gDAzfKfCz0C+knoY4wg/qnlQloM996l3jUWNc= m7s.live/plugin/hook/v4 v4.0.2/go.mod h1:zoyGSwIIdt4NGFdqrKHLFCwwMk4oAOF+dlvSV6cizGU= -m7s.live/plugin/jessica/v4 v4.1.4 h1:6aYwIvNzPh6P06fiPrpb+R69Jx3f5g400vXLdsIa0Bk= -m7s.live/plugin/jessica/v4 v4.1.4/go.mod h1:lUmggsscxqiIvPSY1+RB2vzGstpgSaj/HQOlNTOVCCs= +m7s.live/plugin/jessica/v4 v4.2.0 h1:HhK/f5CpfXeKueWgaIB3DR3JJunKojGlON+X0Q+/O58= +m7s.live/plugin/jessica/v4 v4.2.0/go.mod h1:4z+5NOFuEaLiAszUdABb9SI5o+ZRnFzTB4wWYImeCbk= m7s.live/plugin/logrotate/v4 v4.0.4 h1:y3X+aJ/FSftWMa4yDWF+662xfV5lrEaOZofV8SGQLTc= m7s.live/plugin/logrotate/v4 v4.0.4/go.mod h1:a8hIV59GjpQDE+Ip790CU7yOHaG4+Iweci0sLvo43FU= m7s.live/plugin/monitor/v4 v4.0.2 h1:Pto/w3HqzN19wLIJLRwsXPOfLOrkE3b10GCtoqP3UsY= m7s.live/plugin/monitor/v4 v4.0.2/go.mod h1:wYcjvXM03RK00DGA/R7zfiENNT7jDFQhp0rEBvO1mTw= -m7s.live/plugin/preview/v4 v4.0.4 h1:xDS0817CLo3hx+wAcncE46gPDiPN5AsIWdAdbBltGDA= -m7s.live/plugin/preview/v4 v4.0.4/go.mod h1:iYhWqFbTvTNDFplbTOrE5X9M6ED7gCKkKMuM5QmBocg= -m7s.live/plugin/ps/v4 v4.0.4 h1:O/eygpdONSXm/nEnj7JuWkSwBa0mQXixV/CyY4Yr4zo= -m7s.live/plugin/ps/v4 v4.0.4/go.mod h1:H6/wg14Zcg0Jpmw3e0XYq4mweotufmcpgpLybwF0kgo= -m7s.live/plugin/record/v4 v4.3.5 h1:HekgcZTZkR8UKc5CdK769NlVUlozG472bROV/lVdo/Q= -m7s.live/plugin/record/v4 v4.3.5/go.mod h1:8TWcAJAjMcsHOiuT/SVCxdknSmlXH93iZowkQLOfFU0= +m7s.live/plugin/preview/v4 v4.1.0 h1:VdGAFSTNNG5uY8NNp8k+i0k1/vp3tZMRiyZdDFJuzJo= +m7s.live/plugin/preview/v4 v4.1.0/go.mod h1:iYhWqFbTvTNDFplbTOrE5X9M6ED7gCKkKMuM5QmBocg= +m7s.live/plugin/ps/v4 v4.0.5 h1:qd+B4vEiPflqQVUce4dbQwsQcQ0wwYYyyCdfOaEdRg4= +m7s.live/plugin/ps/v4 v4.0.5/go.mod h1:H6/wg14Zcg0Jpmw3e0XYq4mweotufmcpgpLybwF0kgo= +m7s.live/plugin/record/v4 v4.3.6 h1:aFZPpop6QFPOPfKvOnKBWr4dknzPweKAqALAvEclk74= +m7s.live/plugin/record/v4 v4.3.6/go.mod h1:8TWcAJAjMcsHOiuT/SVCxdknSmlXH93iZowkQLOfFU0= m7s.live/plugin/room/v4 v4.0.9 h1:1kscEupO4NLYkNZI8ayJ8tu9qDuENxnDhgGZ9MtRcSk= m7s.live/plugin/room/v4 v4.0.9/go.mod h1:rmngA5yNAJpjsT1+jt6kvbMtT7gjLM7q/gwPq3vaQDY= m7s.live/plugin/rtmp/v4 v4.2.1 h1:8QKhIvHsJvaW3dqF9y0qnER0GN9oQ4oUHIBGCbxl/vo= @@ -436,5 +436,5 @@ m7s.live/plugin/snap/v4 v4.0.6 h1:Hz0WEN6YrKDWvwpAwpfPl+V40eW0k/+8qzqS2OupzxA= m7s.live/plugin/snap/v4 v4.0.6/go.mod h1:XHggonZ0lIKEX/OP2rXjV2mPpG4urmvMT3foIaFRsus= m7s.live/plugin/webrtc/v4 v4.1.6 h1:MzKtwcIHopmUiQPfsJDXkYOZvuuy0UbyGdygL4u1Nb4= m7s.live/plugin/webrtc/v4 v4.1.6/go.mod h1:0kDXvyiPUputAR9MT6U9zu8yuJ5JhkYEMHB6aYEBRU8= -m7s.live/plugin/webtransport/v4 v4.0.5 h1:2Twt0R0ty0vbB+oXe4z160Z88d3tV3muFeQziZYTKWM= -m7s.live/plugin/webtransport/v4 v4.0.5/go.mod h1:BNe8/gAIRpgeGGTVnFnaHrqEKtzOeSq3VdlQgfc9ri4= +m7s.live/plugin/webtransport/v4 v4.0.6 h1:mgAkNs4GxHc8UiCi/NT2R2i+tD6uKujb0/uqW3CagWQ= +m7s.live/plugin/webtransport/v4 v4.0.6/go.mod h1:BNe8/gAIRpgeGGTVnFnaHrqEKtzOeSq3VdlQgfc9ri4=