mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
Compare commits
272 Commits
2.0
...
v4.7.6-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d6f3dbab8 | ||
|
|
21e0843af3 | ||
|
|
91d0e20748 | ||
|
|
0f94c380eb | ||
|
|
601ea27358 | ||
|
|
e4fd81c237 | ||
|
|
127cd38380 | ||
|
|
14749f3e48 | ||
|
|
74d9eb0cb2 | ||
|
|
87f97fe243 | ||
|
|
d095c45dee | ||
|
|
f2e119e0e5 | ||
|
|
1379471390 | ||
|
|
e5bcdb227c | ||
|
|
06bf245f2b | ||
|
|
90d8008e3b | ||
|
|
063e994328 | ||
|
|
52eacbaecb | ||
|
|
a8af274ec7 | ||
|
|
2a2577b9f9 | ||
|
|
3d28bed6f0 | ||
|
|
f17db659dd | ||
|
|
fdef232edc | ||
|
|
eb3ffe6cd6 | ||
|
|
9cbbee3f54 | ||
|
|
3bdc5074e0 | ||
|
|
35a10e1c39 | ||
|
|
722f7d1a5e | ||
|
|
1399beef60 | ||
|
|
84f9a02e0a | ||
|
|
7f97d26a2b | ||
|
|
17dab13edf | ||
|
|
1218158b3e | ||
|
|
42b8c6256f | ||
|
|
13654367d7 | ||
|
|
bae642096c | ||
|
|
51c4cd6291 | ||
|
|
8707d953fe | ||
|
|
95888790f0 | ||
|
|
dfd9af1efd | ||
|
|
475242ff6a | ||
|
|
9933950f61 | ||
|
|
055eb6c022 | ||
|
|
7d5b0fbb32 | ||
|
|
15da702fec | ||
|
|
e8dbdb4aef | ||
|
|
5a7aec092c | ||
|
|
4ab1f8e9a1 | ||
|
|
660886fc01 | ||
|
|
a71166937e | ||
|
|
dc54771200 | ||
|
|
52bd4c54e7 | ||
|
|
e5c9cacd8b | ||
|
|
39c692a255 | ||
|
|
507caa1414 | ||
|
|
03070c68f6 | ||
|
|
ec3cd569d1 | ||
|
|
a9c433405b | ||
|
|
ebc7e9001a | ||
|
|
dd01ce0bc4 | ||
|
|
2a89629149 | ||
|
|
555b168cba | ||
|
|
f2e0963add | ||
|
|
326b4f5252 | ||
|
|
f4b4d9cb57 | ||
|
|
0cea8a3433 | ||
|
|
146245c50d | ||
|
|
65283c995d | ||
|
|
84d9e05409 | ||
|
|
248eefd1b0 | ||
|
|
c95dbfb291 | ||
|
|
e65da00dac | ||
|
|
5a436e0965 | ||
|
|
4652af0975 | ||
|
|
ba0c2fbf8e | ||
|
|
0c714cc258 | ||
|
|
d9933f0c65 | ||
|
|
10aebe3085 | ||
|
|
56918b5dd4 | ||
|
|
b9e74c161d | ||
|
|
33875ecb3d | ||
|
|
eaa39044d4 | ||
|
|
b01a498688 | ||
|
|
dcfb354f8c | ||
|
|
52681147d6 | ||
|
|
3cd643fd31 | ||
|
|
e6f73e71aa | ||
|
|
9c278864c2 | ||
|
|
0b5c36b1c1 | ||
|
|
97f7d6a22d | ||
|
|
bf18453401 | ||
|
|
7dc8966d55 | ||
|
|
9cb7010507 | ||
|
|
8d5c6d6d11 | ||
|
|
3ead36ccf7 | ||
|
|
a4e1f4950d | ||
|
|
53cc788857 | ||
|
|
6b40297c69 | ||
|
|
f8e50d00f5 | ||
|
|
361b0522e1 | ||
|
|
27784f0a03 | ||
|
|
34394b99cf | ||
|
|
f56a6c972c | ||
|
|
7138565443 | ||
|
|
a521c63036 | ||
|
|
ed5e7196f7 | ||
|
|
664a64a025 | ||
|
|
f097e66069 | ||
|
|
2e8d4d2f3a | ||
|
|
8bb63c9298 | ||
|
|
c0b2a10601 | ||
|
|
3179b892d6 | ||
|
|
ef3a85ec21 | ||
|
|
1a57aeb2a2 | ||
|
|
85b134d333 | ||
|
|
9969966b52 | ||
|
|
5482ab4157 | ||
|
|
6a78440a61 | ||
|
|
61eaaab78f | ||
|
|
54f01a064c | ||
|
|
09570a6515 | ||
|
|
00ff25e173 | ||
|
|
f0735d3883 | ||
|
|
314191abaf | ||
|
|
33b5c465b6 | ||
|
|
2b1bf24fb9 | ||
|
|
4653f7b511 | ||
|
|
86b16fe3fb | ||
|
|
d05bd7bc55 | ||
|
|
6f9fe7c646 | ||
|
|
96d886c7a5 | ||
|
|
ca2f69539d | ||
|
|
0fd608aefc | ||
|
|
d5e6a517fb | ||
|
|
e035cf0846 | ||
|
|
e7ff340c7a | ||
|
|
91d1d5502b | ||
|
|
b1ef460af1 | ||
|
|
87f08066e5 | ||
|
|
da69aae5fa | ||
|
|
6e8081a411 | ||
|
|
2f7bc14986 | ||
|
|
504e22b558 | ||
|
|
c7b2cbfee3 | ||
|
|
70b5c553b9 | ||
|
|
4486c612e4 | ||
|
|
29f574ae73 | ||
|
|
d12052eb4a | ||
|
|
7a0964b501 | ||
|
|
67ad3e669d | ||
|
|
6c78c2f456 | ||
|
|
16cf7725f3 | ||
|
|
9d08fa47b3 | ||
|
|
9b6e9bfbec | ||
|
|
a18fc77b8b | ||
|
|
edd7a6f047 | ||
|
|
9ec70f0454 | ||
|
|
6ca479371e | ||
|
|
f65bd3a760 | ||
|
|
91a9171c5c | ||
|
|
0b51fecf48 | ||
|
|
493bce72cb | ||
|
|
a48057e713 | ||
|
|
2dd008d960 | ||
|
|
3f7e7b3666 | ||
|
|
0791151557 | ||
|
|
69f5d9d976 | ||
|
|
dec17c1f26 | ||
|
|
e6069322f8 | ||
|
|
36ede9b9a2 | ||
|
|
e4bc0ad5ea | ||
|
|
33a58b0641 | ||
|
|
cb71b2c7e2 | ||
|
|
38b8923e6f | ||
|
|
8b483e5139 | ||
|
|
34c21e5e8f | ||
|
|
b8a23517ba | ||
|
|
d491b6206a | ||
|
|
93ce7391a5 | ||
|
|
611bd78b5c | ||
|
|
b112187125 | ||
|
|
e0c35fce2b | ||
|
|
7bcf2cba27 | ||
|
|
da5f970067 | ||
|
|
711b4cc82c | ||
|
|
f1bcb6f2c9 | ||
|
|
306a7ffeff | ||
|
|
9c8a2c5d83 | ||
|
|
1a67f63932 | ||
|
|
c761c6ce9b | ||
|
|
cc9c0d67e2 | ||
|
|
6df2a3b842 | ||
|
|
c38bd36ecc | ||
|
|
a769f1cbf4 | ||
|
|
8ec0515f60 | ||
|
|
e2113e03df | ||
|
|
56bbc0ddf8 | ||
|
|
563f966fe4 | ||
|
|
0e3befd285 | ||
|
|
e60871b55b | ||
|
|
785be6a939 | ||
|
|
7684856ccc | ||
|
|
2e76b74e74 | ||
|
|
e67b3f3bc8 | ||
|
|
c17302a8fc | ||
|
|
02738a1482 | ||
|
|
0e1fe9a713 | ||
|
|
8a059c51a9 | ||
|
|
07a34d2642 | ||
|
|
7dca6c9411 | ||
|
|
eddbb35136 | ||
|
|
65c3d90275 | ||
|
|
531bcd57f1 | ||
|
|
18bbedcff5 | ||
|
|
6a2818916a | ||
|
|
612501a403 | ||
|
|
ca3397e544 | ||
|
|
d01d254caa | ||
|
|
7574a6ba6f | ||
|
|
4c918df6e6 | ||
|
|
f677beb2b7 | ||
|
|
3adaedf6fc | ||
|
|
5a9cf53485 | ||
|
|
bff77f1365 | ||
|
|
b608c38aec | ||
|
|
d8537ec3a3 | ||
|
|
c055f7fceb | ||
|
|
afb0efb2ee | ||
|
|
51832cd9a7 | ||
|
|
454e19f8c0 | ||
|
|
62111b41d1 | ||
|
|
0eca8fd657 | ||
|
|
ca16d405d0 | ||
|
|
e1d500447a | ||
|
|
e7da10649c | ||
|
|
ccd0320090 | ||
|
|
ee9d4d06b4 | ||
|
|
089cc593be | ||
|
|
9abd76b1e5 | ||
|
|
6e65cc20a2 | ||
|
|
ff71c7bd5a | ||
|
|
8648f2ae20 | ||
|
|
70e7fae954 | ||
|
|
48b7ff1dee | ||
|
|
d46e0d45b2 | ||
|
|
5b41f67b80 | ||
|
|
3a8b371560 | ||
|
|
8abae09574 | ||
|
|
476bb4a656 | ||
|
|
bf5b4010d7 | ||
|
|
8cee5c2c18 | ||
|
|
43632cf852 | ||
|
|
e4e96f8fc1 | ||
|
|
57acc5f357 | ||
|
|
23faad4405 | ||
|
|
ec86b455a9 | ||
|
|
f848e90a50 | ||
|
|
7d05e4cc6c | ||
|
|
b66e52a90f | ||
|
|
da6554f536 | ||
|
|
2b8e8bca98 | ||
|
|
9009431a1f | ||
|
|
99b9cc674f | ||
|
|
67b338007a | ||
|
|
111ba8aa5a | ||
|
|
d5ab178841 | ||
|
|
3a3dd3c73c | ||
|
|
75865960c6 | ||
|
|
bb4c39886d | ||
|
|
4e92f395bf | ||
|
|
64cf6e609d | ||
|
|
65bbb5c04f |
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: monibuca
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
96
.github/workflows/go.yml
vendored
Normal file
96
.github/workflows/go.yml
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
name: Go
|
||||
|
||||
on:
|
||||
create:
|
||||
tags:
|
||||
- v4*
|
||||
env:
|
||||
dest: bin
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up Env
|
||||
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV
|
||||
- name: Set beta
|
||||
if: contains(env.version, 'beta')
|
||||
run: echo "dest=beta" >> $GITHUB_ENV
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.21.8
|
||||
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: runner.os−go−{ { hashFiles('**/go.sum') } }
|
||||
restore-keys: ${{ runner.os }}-go-
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
version: v1.8.3
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# - name: Checkout m7s-import
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# repository: langhuihui/m7s-import
|
||||
# path: m7s-import
|
||||
# persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
|
||||
# fetch-depth: 0
|
||||
|
||||
# - name: Add bin to m7s-import
|
||||
# if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
# run: |
|
||||
# cd m7s-import
|
||||
# mkdir -p apps/m7s-website/src/public/bin
|
||||
# cp ../dist/m7s_${{ env.version }}_windows_amd64.tar.gz apps/m7s-website/src/public/bin/m7s_windows_amd64.tar.gz
|
||||
# cp ../dist/m7s_${{ env.version }}_darwin_amd64.tar.gz apps/m7s-website/src/public/bin/m7s_darwin_amd64.tar.gz
|
||||
# cp ../dist/m7s_${{ env.version }}_darwin_arm64.tar.gz apps/m7s-website/src/public/bin/m7s_darwin_arm64.tar.gz
|
||||
# cp ../dist/m7s_${{ env.version }}_linux_amd64.tar.gz apps/m7s-website/src/public/bin/m7s_linux_amd64.tar.gz
|
||||
# cp ../dist/m7s_${{ env.version }}_linux_arm64.tar.gz apps/m7s-website/src/public/bin/m7s_linux_arm64.tar.gz
|
||||
# ls apps/m7s-website/src/public/bin
|
||||
- name: copy
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
mkdir -p bin
|
||||
cp dist/m7s_${{ env.version }}_windows_amd64.tar.gz bin/m7s_windows_amd64.tar.gz
|
||||
cp dist/m7s_${{ env.version }}_darwin_amd64.tar.gz bin/m7s_darwin_amd64.tar.gz
|
||||
cp dist/m7s_${{ env.version }}_darwin_arm64.tar.gz bin/m7s_darwin_arm64.tar.gz
|
||||
cp dist/m7s_${{ env.version }}_linux_amd64.tar.gz bin/m7s_linux_amd64.tar.gz
|
||||
cp dist/m7s_${{ env.version }}_linux_arm64.tar.gz bin/m7s_linux_arm64.tar.gz
|
||||
ls bin
|
||||
- uses: jakejarvis/s3-sync-action@master
|
||||
# with:
|
||||
# args: --acl public-read --follow-symlinks --delete
|
||||
env:
|
||||
AWS_S3_ENDPOINT: https://${{ secrets.R2_DOMAIN }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET }}
|
||||
AWS_S3_BUCKET: monibuca
|
||||
SOURCE_DIR: 'bin'
|
||||
DEST_DIR: ${{ env.dest }}
|
||||
- name: docker build
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
tar -zxvf bin/m7s_linux_amd64.tar.gz
|
||||
mv m7s monibuca_linux
|
||||
docker login -u langhuihui -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker build -t langhuihui/monibuca:latest .
|
||||
docker push langhuihui/monibuca:latest
|
||||
- name: docker push
|
||||
if: success() && !contains(env.version, 'beta')
|
||||
run: |
|
||||
docker tag langhuihui/monibuca:latest langhuihui/monibuca:${{ env.version }}
|
||||
docker push langhuihui/monibuca:${{ env.version }}
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -5,4 +5,21 @@ resource
|
||||
*.log
|
||||
/monibuca
|
||||
node_modules
|
||||
shutdown.bat
|
||||
shutdown.bat
|
||||
*.sh
|
||||
.m7s
|
||||
debug.go
|
||||
dist/
|
||||
record/
|
||||
config2.yaml
|
||||
config1.yaml
|
||||
monibuca_*
|
||||
ps
|
||||
ps2
|
||||
ps3
|
||||
devices.json
|
||||
dump
|
||||
.DS_Store
|
||||
main
|
||||
monitor
|
||||
.history
|
||||
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# Compile Stage
|
||||
FROM golang:1.22.2-alpine3.19 AS builder
|
||||
MAINTAINER monibuca <awesome@monibuca.com>
|
||||
|
||||
LABEL stage=gobuilder
|
||||
|
||||
# Env
|
||||
ENV CGO_ENABLE 0
|
||||
ENV GOOS linux
|
||||
ENV GOARCH amd64
|
||||
ENV GOPROXY https://goproxy.cn,direct
|
||||
ENV HOME /monibuca
|
||||
|
||||
COPY . /monibuca
|
||||
WORKDIR /monibuca
|
||||
|
||||
# compile
|
||||
RUN go mod download
|
||||
RUN go build -ldflags="-s -w" -o /monibuca/build/monibuca ./main.go
|
||||
|
||||
RUN cp -r /monibuca/config.yaml /monibuca/build
|
||||
RUN cp -r /monibuca/favicon.ico /monibuca/build
|
||||
|
||||
# Running Stage
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /monibuca
|
||||
COPY --from=builder /monibuca/build /monibuca/
|
||||
|
||||
# Export necessary ports
|
||||
EXPOSE 8080 8443 1935 554 58200-59200 5060 8000-9000
|
||||
EXPOSE 5060/udp 58200-59200/udp 8000-9000/udp
|
||||
|
||||
CMD [ "./monibuca" ]
|
||||
210
README.md
210
README.md
@@ -1,102 +1,140 @@
|
||||
<p align="center">
|
||||
<a href="https://m7s.live">
|
||||
<img src="logo.png" height="96">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://monibuca.com/doc">中文文档</a>
|
||||
</p>
|
||||
# Core code base and plug-in code base
|
||||
|
||||
<h2 align="center">
|
||||
<img src="https://monibuca.com/img/logo.089ef700.png"></h2>
|
||||
## Stargazers over time
|
||||
[https://github.com/Monibuca](https://github.com/Monibuca)
|
||||
|
||||
# Introduction
|
||||
|
||||
🧩 Monibuca is a Modularized, Extensible framework for building Streaming Server.
|
||||
- Customize the server by combining function plug-ins.
|
||||
- It's easy to develop plug-ins to implement business logic.
|
||||
- Reduce enterprise development cost and improve development efficiency
|
||||
## What is Monibuca (m7s)?
|
||||
|
||||
# Quick start
|
||||
Monibuca (pronounced: analog not card, m7s is its abbreviation, similar to k8s) is an open source streaming server development framework developed in Go. It is based on go1.19+, in addition to no other dependencies built, and provides a set of plug-in secondary development model to help you efficiently develop streaming media servers, you can directly use the official plug-in, or develop your own plug-in to extend any function, so Monibuca is a framework that can support any streaming protocol!
|
||||
|
||||
## Go has not been installed
|
||||
```
|
||||
bash <(curl -s -S -L https://monibuca.com/go.sh)
|
||||
```
|
||||
## Go is already installed
|
||||
Monibuca consists of three parts: engine, plugins, and instance project.
|
||||
|
||||
1. go get github.com/langhuihui/monibuca
|
||||
2. $GOPATH/bin/monibuca
|
||||
3. open your browser http://localhost:8081
|
||||
4. use ffmpeg or OBS to push video streaming to rtmp://localhost/live/user1
|
||||
The engine provides a common streaming data cache and forwarding mechanism, and does not care how the protocol is implemented
|
||||
The plugins offer all the other features and can be extended indefinitely
|
||||
An instance project is a project project that introduces the engine and plugins and starts the engine, and can be written entirely by yourself
|
||||
|
||||
# Advanced
|
||||
## Plug-in framework
|
||||
|
||||
## Nodejs has not been installed
|
||||
```
|
||||
bash <(curl -s -S -L https://monibuca.com/monica.sh)
|
||||
Monibuca aims to build a general streaming media development ecosystem, so since the v1 version, it has considered the decoupling of services and stream forwarding, so as to design a set of plug-in mechanisms that can be arbitrarily extended. Depending on your needs, you can flexibly introduce different types of plugins:
|
||||
|
||||
- Provide streaming media protocol packaging/unpacking, such as RTMP plug-ins, RTSP plug-ins, etc
|
||||
- Provides log persistence processing - logrotate plugin
|
||||
- Provide recording function - record plugin
|
||||
- Provide rich debugging functions - debug plugin
|
||||
- Provide HTTP callback capability - hook plugin
|
||||
If you are an experienced developer, then the best way is to carry out secondary development on the basis of existing plugins, and provide reusable plugins to more people to enrich the ecosystem. If you're a beginner in streaming, the best way to do this is to use existing plugins to cobble together the features you need and ask experienced developers for help.
|
||||
|
||||
# Key features
|
||||
## Engine aspect
|
||||
- Provides a plug-in mechanism to manage plug-in startup, configuration resolution, event distribution, etc. in a unified manner
|
||||
- Provide forwarding in H264, H265, AAC, G711 format
|
||||
- Provide reusable AVCC format, RTP format, AnnexB format, ADTS format and other pre-encapsulation mechanisms
|
||||
- Provides a multi-track mechanism, supports large and small streams, and encrypts stream expansion
|
||||
- Provide DataTrack mechanism, which can be used to implement functions such as room text chat
|
||||
- Provide timestamp synchronization mechanism and speed limit mechanism
|
||||
- Provides an RTP packet reorder mechanism
|
||||
- Provide subscriber frame chasing and skipping mechanism (first screen second on)
|
||||
- Provides the infrastructure for publish-subscribe push and pull out
|
||||
- Provides underlying architecture support for authentication mechanisms
|
||||
- Provides a memory reuse mechanism
|
||||
- Provides a mechanism for publishers to disconnect and reconnect
|
||||
- Provides an on-demand flow pulling mechanism
|
||||
- Provides a common mechanism for HTTP service ports
|
||||
- Provides an automatic registration mechanism for HTTP API interfaces
|
||||
- Provides HTTP interface middleware mechanism
|
||||
- Provides structured logs
|
||||
- Provides flow information statistics and output
|
||||
- Provides an event bus mechanism that broadcasts events to all plug-ins
|
||||
- Provides a configuration hot update mechanism
|
||||
|
||||
## Plug-in aspect
|
||||
- Provide RTMP protocol push-pull stream, external push-pull stream (RTMPS supported)
|
||||
- Provides RTSP push and pull streams and external push and pull streams
|
||||
- Provides HTTP-FLV protocol to pull streams, pull external streams, and read local FLV files
|
||||
- Provides streaming of the WebSocket protocol
|
||||
- Provides HLS protocol to pull streams and pull outflows
|
||||
- Provides push-pull streams for the WebRTC protocol
|
||||
- Provides GB28181 protocol push and dump playback analysis capabilities
|
||||
- Provide support for the Onif protocol
|
||||
- Provides streaming of WebTransport protocol
|
||||
- Provides FMP4 protocol for pulling streams
|
||||
- Provides edge server functionality to implement cascading streaming
|
||||
- Provide video recording function, support FLV, MP4, HLS, RAW formats
|
||||
- Provides log persistence by day, hour, minute, second, size, and number of files
|
||||
- Provide a screenshot function
|
||||
- Provides HTTP callback function
|
||||
- Preview features available (integrated with Jessibuca Pro)
|
||||
- Room function available (video conferencing possible)
|
||||
- Provide the function of docking with Prometheus
|
||||
|
||||
Third-party plugins and paid plugins provide additional functionality and are not listed here.
|
||||
|
||||
Inspired by:
|
||||
- [mp4ff](https://github.com/edgeware/mp4ff) mp4 file format library [@edgeware](https://github.com/edgeware)
|
||||
- [gosip](https://github.com/ghettovoice/gosip) go sip library [@ghettovoice](https://github.com/ghettovoice)
|
||||
- [webrtc](https://github.com/pion/webrtc) go library and whole [@pion](https://github.com/pion) team
|
||||
- [gortsplib](https://github.com/bluenviron/gortsplib) rtsp library [@aler9](https://github.com/aler9)
|
||||
|
||||
## Remote console
|
||||
|
||||
- Provides multi-instance management
|
||||
- Provide flow details display
|
||||
- Provides visual editing of configurations
|
||||
- Provides visual display of logs
|
||||
- Provide visual management of plugins
|
||||
- Provides GB device management
|
||||
- Provides an interface for dynamically adding remote push-pull flows
|
||||
- Provide WebRTC background wall function
|
||||
- Provide multiplayer video demonstrations
|
||||
|
||||
# Origin of the name
|
||||
The word Monibuca is derived from (Monica), and in order to solve the naming problem, three names are used to represent server, player, and streamer. Since Monica, Jessica, and Rebecca all have `卡` words, which is not good for the live broadcast (ca - `卡` means block in Chinese), it was changed to Monibuca, Jessibuca(https://jessibuca.com), and Rebebuca(https://rebebuca.com). (bu-`不` means not)
|
||||
|
||||
# Install
|
||||
- The compiled binary executable files (i.e. green software) of each platform are officially provided, so it can run without installing any other software.
|
||||
- If you need to compile and start the project yourself, you need to install go1.19 or above.
|
||||
|
||||
The official download link of the latest version is provided:
|
||||
- [Linux](https://download.m7s.live/bin/m7s_linux_arm64.tar.gz)
|
||||
- [Linux-arm64](https://download.m7s.live/bin/m7s_linux_arm64.tar.gz)
|
||||
- [Mac](https://download.m7s.live/bin/m7s_darwin_arm64.tar.gz)
|
||||
- [Mac-arm64](https://download.m7s.live/bin/m7s_darwin_arm64.tar.gz)
|
||||
- [Windows](https://download.m7s.live/bin/m7s_windows_amd64.tar.gz)
|
||||
|
||||
Don't forget to fix the rights chmod +x m7s_xxx_xxx on Linux and Mac.
|
||||
# Run
|
||||
|
||||
## Executable files run directly
|
||||
|
||||
- Linux, for example, downloaded to `/opt/m7s_linux_x86`, then `$ cd /opt ' and then `$ ./m7s_linux_x86`
|
||||
- Similar to Linux and Mac, you may need to modify the executable permissions of the file or double-click to run
|
||||
- Windows, double-click m7s directly_windows_x86.exe can be started
|
||||
|
||||
## Docker
|
||||
```bash
|
||||
docker run -id -p 1935:1935 -p 8080:8080 -p 8443:8443 -p 554:554 -p 58200:58200 -p 5060:5060/udp -p 8000:8000/udp -p 9000:9000 langhuihui/monibuca:latest
|
||||
```
|
||||
|
||||
## Nodejs is already installed
|
||||
1. npm i -g @langhuihui/monica
|
||||
2. monica
|
||||
3. open your browser http://localhost:3000
|
||||
4. follow the guide to create your project
|
||||
## Self-compiled startup project
|
||||
1. `git clone https://github.com/langhuihui/monibuca`
|
||||
2. `cd monibuca`
|
||||
3. `go run .`
|
||||
|
||||
# Ecosystem
|
||||
## Self-created startup project
|
||||
|
||||
go to
|
||||
[https://plugins.monibuca.com](https://plugins.monibuca.com).
|
||||
to submit your own plugin
|
||||
You can watch the video tutorial:
|
||||
|
||||
| Project | Description |
|
||||
|---------| -------------|
|
||||
|[plugin-rtmp]|rtmp protocol support.push rtmp stream to monibuca.play stream from monibuca.
|
||||
|[plugin-rtsp]|rtsp protocol support.pull/push rtsp stream to monibuca
|
||||
|[plugin-hls]|pull hls stream to monibuca
|
||||
|[plugin-ts]|used by plugin-hls. read ts file to publish
|
||||
|[plugin-hdl]|http-flv protocol support. pull http-flv stream from monibuca
|
||||
|[plugin-gateway]|a console and dashboard to display information and status of monibuca ,also can display UI of other plugins
|
||||
|[plugin-record]|record multimedia stream to flv files
|
||||
|[plugin-cluster]|cascade transmission of multimedia by cluster network
|
||||
|[plugin-jesscia]|play multimedia stream through websocket protocol
|
||||
|[plugin-logrotate]|split log files by date or size
|
||||
|[plugin-rtp]|used by plugin-webrtc and plugin-rtsp
|
||||
|[plugin-webrtc]|webrtc protocol support. push webrtc stream to monibuca or pull webrtc stream from monibuca
|
||||
|[plugin-gb28181]|gb28181 protocol support.
|
||||
- [从零启动 m7s V4](https://www.bilibili.com/video/BV1iq4y147N4/)
|
||||
|
||||
[plugin-rtmp]: https://github.com/Monibuca/plugin-rtmp
|
||||
[plugin-rtsp]: https://github.com/Monibuca/plugin-rtsp
|
||||
[plugin-hls]:https://github.com/Monibuca/hlspplugin
|
||||
[plugin-ts]:https://github.com/Monibuca/tspplugin
|
||||
[plugin-hdl]:https://github.com/Monibuca/plugin-hdl
|
||||
[plugin-gateway]:https://github.com/Monibuca/plugin-gateway
|
||||
[plugin-record]:https://github.com/Monibuca/plugin-record
|
||||
[plugin-cluster]:https://github.com/Monibuca/plugin-cluster
|
||||
[plugin-jesscia]:https://github.com/Monibuca/plugin-jesscia
|
||||
[plugin-logrotate]:https://github.com/Monibuca/plugin-logrotate
|
||||
[plugin-rtp]:https://github.com/Monibuca/plugin-rtp
|
||||
[plugin-webrtc]:https://github.com/Monibuca/plugin-webrtc
|
||||
[plugin-gb28181]:https://github.com/Monibuca/plugin-gb28181
|
||||
# Protocol Functions
|
||||
| Protocol | Pusher(push)-->Monibuca |Source-->Monibuca(pull)|Monibuca-->Player(pull)|Monibuca(push)-->Other Server
|
||||
|---------| -------------|-------------| -------------|-------------|
|
||||
|rtmp|✔||✔|
|
||||
|rtsp|✔|✔||
|
||||
|http-flv|||✔|
|
||||
|hls||✔|✔|
|
||||
|ws-flv|||✔|
|
||||
|webrtc|✔||✔
|
||||
# Documentation
|
||||
- [m7s v4 视频教程——插件引入](https://www.bilibili.com/video/BV1sP4y1g7BF/)
|
||||
|
||||
|
||||
中文文档:
|
||||
[http://docs.monibuca.com](http://docs.monibuca.com).
|
||||
|
||||
|
||||
# Q&A
|
||||
|
||||
## Q: There are so many streaming server projects in the world,why need to create Monibuca?
|
||||
|
||||
A: Monibuca is different from other streaming servers,that it was created for facilitate secondary development.
|
||||
|
||||
## Q: Why use golang?
|
||||
|
||||
A: Golang is a greate programming language. It is very suited to build streaming server since streaming server is a kind of IO intensive system. Goroutine is good at doing these jobs. Another important reason of using Golang is that people read the source code or doing secondary development easier.
|
||||
|
||||
## Q: What does "Monibuca" mean?
|
||||
|
||||
A: No special meaning. Just from monica —— a girl name.
|
||||

|
||||
69
README_zh.md
69
README_zh.md
@@ -1,69 +0,0 @@
|
||||
# 主页
|
||||
|
||||
[https://monibuca.com](https://monibuca.com)
|
||||
|
||||
# 中文文档
|
||||
|
||||
[http://docs.monibuca.com](http://docs.monibuca.com)
|
||||
|
||||
# 文章
|
||||
|
||||
[重新定义流媒体服务器](https://www.infoq.cn/article/uiPl8dIuQmhipKb3q3Tz)
|
||||
[直播回顾](https://live.oschina.net/detail/l_5ec359168fca5_6CA0rArq/4?fromH5=true)
|
||||
|
||||
# 核心代码库和插件代码库
|
||||
|
||||
[https://github.com/Monibuca](https://github.com/Monibuca)
|
||||
|
||||
|
||||
# 本项目为开箱即用的实例demo
|
||||
|
||||
## 一键安装golang环境和monibuca的demo
|
||||
|
||||
```
|
||||
bash <(curl -s -S -L https://monibuca.com/demo.sh)
|
||||
```
|
||||
|
||||
## 对于已经安装好golang环境的
|
||||
|
||||
1. go get github.com/langhuihui/monibuca
|
||||
2. linux下执行:$GOPATH/bin/monibuca windows下执行:%GOPATH%/bin/monibuca
|
||||
3. 启动后,浏览器打开8081端口查看后台界面
|
||||
4. ffmpeg或者OBS推流到1935端口
|
||||
5. 后台界面上提供直播预览、录制flv、rtsp拉流转发、日志跟踪等功能
|
||||
|
||||
# Monibuca简介
|
||||
[Monibuca](https://monibuca.com) 是一个开源的流媒体服务器开发框架,适用于快速定制化开发流媒体服务器,可以对接CDN厂商,作为回源服务器,也可以自己搭建集群部署环境。 丰富的内置插件提供了流媒体服务器的常见功能,例如rtmp server、http-flv、视频录制、QoS等。除此以外还内置了后台web界面,方便观察服务器运行的状态。 也可以自己开发后台管理界面,通过api方式获取服务器的运行信息。 Monibuca 提供了可供定制化开发的插件机制,可以任意扩展其功能。
|
||||
|
||||
⚡高性能
|
||||
|
||||
针对流媒体服务器独特的性质进行的优化,充分利用Golang的goroutine的性质对大量的连接的读写进行合理的分配计算资源,以及尽可能的减少内存Copy操作。使用对象池减少Golang的GC时间。
|
||||
|
||||
🔧可扩展
|
||||
|
||||
流媒体服务器的个性化定制变的更简单,基于Golang语言,开发效率更高,独创的插件机制,可以方便用户定制个性化的功能组合,更高效率的利用服务器资源。[插件市场](https://plugins.monibuca.com)
|
||||
|
||||
📈可视化
|
||||
|
||||
功能强大的仪表盘可以直观的看到服务器运行的状态、消耗的资源、以及其他统计信息。用户可以利用控制台对服务器进行配置和控制。
|
||||
|
||||
# 交流微信群
|
||||
|
||||
进入网站首页上进行扫码
|
||||
|
||||
# Q&A
|
||||
|
||||
## Q:流媒体服务器项目有很多,为什么要重复发明轮子?
|
||||
A: Monibuca不同于其他流媒体服务器的地方是,针对二次开发为目的。多数流媒体服务器是通用型,完成特定任务的,对于二次开发并不友好。Monibuca开创了插件机制,可以自由组合不同的协议或者功能,定制化特定需求的流媒体服务器。
|
||||
|
||||
## Q:Monibuca为何采用Golang为开发语言?
|
||||
A:因为Golang语言相比其他语言可读性更强,代码简单易懂,更利于二次开发;另外Golang的goroutine特别适合开发高速系统。
|
||||
|
||||
## Q:Monibuca是否使用Cgo或者其他语言依赖库?
|
||||
A:没有。Monibuca是纯Go语言开发,不依赖任何其他第三方库比如FFmpeg,方便二次开发。对部署更友好,仅仅需要Golang运行环境即可。
|
||||
|
||||
## Q:Monibuca对环境有什么要求?直播流可以在微信里播放吗?
|
||||
A:Monibuca是基于Golang开发,支持跨平台部署。Monibuca可以用Jessibuca播放器在微信、手机浏览器里面播放视频。也可以通过其他SDK播放RTMP流、其他协议的流。只需要相应的插件支持即可。
|
||||
|
||||
## Q: Monibuca的名称有什么特殊含义吗?
|
||||
A: 这个单词来源于Monica(莫妮卡)是个人名,在项目里面也存在这个文件夹。没有特别含义,为了解决起名的难题,使用了三个名称分别是Monica、Jessica、Rebecca用来代表服务器、播放器、推流器。由于莫妮卡、杰西卡、瑞贝卡,都带卡字,对直播来说寓意不好,所以改为模拟不卡(Monibuca)、解析不卡(Jessibuca)、累呗不卡(Rebebuca)。其中推流器Rebebuca目前尚为公布,是改造了的OBS,可用于推流H265
|
||||
9
conf-example/hls.yaml
Normal file
9
conf-example/hls.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
# hls纯转发,即从HLS->HLS
|
||||
|
||||
global:
|
||||
disableall: true
|
||||
enablertp: false
|
||||
enableavcc: false
|
||||
hls:
|
||||
enable: true
|
||||
relaymode: 1
|
||||
7
conf-example/https.yaml
Normal file
7
conf-example/https.yaml
Normal file
@@ -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
|
||||
6
conf-example/rtmp.yaml
Normal file
6
conf-example/rtmp.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
# 只包含rtmp,关闭其他所有插件,只能用于rtmp的转发
|
||||
global:
|
||||
disableall: true
|
||||
enablertp: false
|
||||
rtmp:
|
||||
enable: true
|
||||
4
conf-example/rtmps.yaml
Normal file
4
conf-example/rtmps.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
# 开启接受rtmps
|
||||
rtmp:
|
||||
tcp:
|
||||
listenaddrtls: :443
|
||||
16
conf-example/rtsp.yaml
Normal file
16
conf-example/rtsp.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
# rtsp 拉流配置
|
||||
global:
|
||||
disableall: true # 需要转换其他协议的话,需要将disableall设置为false
|
||||
enableavcc: false # 如果需要转换成rtmp和flv的话,需要改成true
|
||||
publish:
|
||||
delayclosetimeout: 2s # 无订阅者时,2s后关闭拉流
|
||||
preview:
|
||||
enable: true
|
||||
rtsp:
|
||||
enable: true # 如果disableall为false的话,这个可以不需要写
|
||||
pull:
|
||||
pullonstart:
|
||||
rtsp/test: rtsp://localhost:8554/live
|
||||
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
|
||||
5
conf-example/说明.txt
Normal file
5
conf-example/说明.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
本目录下所有配置文件都是代表某些配置的例子,只是例子!!!
|
||||
monibuca 不会读取这个目录下的任何文件!!!
|
||||
monibuca 默认读取的是 config.yaml
|
||||
请根据需要自行修改 config.yaml
|
||||
当然也可以通过 -c 命令指定读取的配置文件
|
||||
85
config.toml
85
config.toml
@@ -1,85 +0,0 @@
|
||||
[Monibuca]
|
||||
# 是否等待流,如果为true则订阅一个尚未发布的流会进入等待发布的状态,否则返回订阅失败
|
||||
EnableWaitStream = true
|
||||
EnableAudio = true
|
||||
EnableVideo = true
|
||||
# 缓冲环大小默认是2的10次方
|
||||
RingSize = 10
|
||||
# 发布流默认过期时间 1分钟
|
||||
PublishTimeout = 60000000000
|
||||
[RTMP]
|
||||
ListenAddr = ":1935"
|
||||
[GateWay]
|
||||
ListenAddr = ":8081"
|
||||
#ListenAddrTLS = ":8082"
|
||||
#CertFile = "xxx.cert"
|
||||
#KeyFile = "xxx.key"
|
||||
[Jessica]
|
||||
ListenAddr = ":8080"
|
||||
#ListenAddrTLS = ":8083"
|
||||
#CertFile = "xxx.cert"
|
||||
#KeyFile = "xxx.key"
|
||||
[LogRotate]
|
||||
# 日志存储目录相对或绝对
|
||||
Path = "logs"
|
||||
# 日志是否按大小分割,0表示不按大小分割,非零代表按该大小字节进行分割
|
||||
Size = 0
|
||||
Days = 1
|
||||
[Cluster]
|
||||
# 监听端口代表该服务器为源服务器
|
||||
ListenAddr = ":2019"
|
||||
# 源服务器地址,用于向源服务器进行推或拉流
|
||||
OriginServer = ""
|
||||
# 推送模式,true表示如果此服务器有发布流,就会推送到源服务器,否则表示拉模式,即如果此服务器有订阅流则从源服务器拉流
|
||||
Push = true
|
||||
[HLS]
|
||||
# 是否开启写磁盘,开启后侦测到发布流就会开始写TS文件
|
||||
EnableWrite = false
|
||||
# 是否打开内存模式,在内存中保留TS数据,方便直接读取
|
||||
EnableMemory = false
|
||||
# 分片大小 单位秒
|
||||
Fragment = 10
|
||||
# 窗口数里,代表一个m3u8文件里面有几个ts
|
||||
Window = 2
|
||||
# ts文件存放目录,m3u8会存放在上一级
|
||||
Path = "resource"
|
||||
[HDL]
|
||||
ListenAddr = ":2020"
|
||||
#ListenAddrTLS = ":2021"
|
||||
#CertFile = "xxx.cert"
|
||||
#KeyFile = "xxx.key"
|
||||
[TS]
|
||||
# 是否自动发布,开启后一旦有订阅流就会读取ts文件进行发布,方便测试
|
||||
AutoPublish = false
|
||||
# ts存放目录
|
||||
Path = "resource"
|
||||
[Record]
|
||||
Path = "resource"
|
||||
# 是否自动发布,开启后一旦有订阅流就会读取flv文件进行发布,方便测试
|
||||
AutoPublish = false
|
||||
# 自动录制功能
|
||||
AutoRecord = false
|
||||
[RTSP]
|
||||
# 端口接收推流
|
||||
ListenAddr = ":554"
|
||||
# 开启自动拉流后,一旦有订阅流,就会从RemoteAddr进行拉流
|
||||
AutoPull = false
|
||||
Reconnect = true
|
||||
# 远程地址配合AutoPull配置起作用
|
||||
RemoteAddr = "rtsp://admin:admin@192.168.1.212:554/cam/realmonitor?channel=1&subtype=1"
|
||||
# 发布流的名称配合AutoPull配置起作用 远程拉流后在本地起的流名称
|
||||
StreamPath = "live/rtsp"
|
||||
#[[RTSP.AutoPullList]]
|
||||
#URL = "rtsp://admin:admin@192.168.1.212:554/cam/realmonitor?channel=1&subtype=1"
|
||||
#StreamPath = "live/rtsp2"
|
||||
[WebRTC]
|
||||
# 公网IP地址
|
||||
PublicIP = ["127.0.0.1"]
|
||||
# 端口范围不配置的话是自动分配
|
||||
# PortMin = 30000
|
||||
# PortMax = 40000
|
||||
[GB28181]
|
||||
Serial = "34020000002000000001"
|
||||
Realm = "3402000000"
|
||||
Expires = 3600
|
||||
ListenAddr = "192.168.1.120:5060"
|
||||
10
config.yaml
Normal file
10
config.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
# 支持零配置启动,即无需填写配置默认启用所有的插件。
|
||||
# 只需要填写需要修改的配置项即可。不需要将所有的配置都填写进来!!。
|
||||
# 全局配置参考 https://m7s.live/guide/config.html
|
||||
# 插件配置参考各个插件的文档
|
||||
# 插件都有一个enable配置,如果为false则不启用该插件,默认为true即不需要配置。
|
||||
|
||||
hls:
|
||||
enable: false
|
||||
monitor:
|
||||
enable: false
|
||||
10
docker-compose.yaml
Normal file
10
docker-compose.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
monibuca:
|
||||
build:
|
||||
dockerfile: ./Dockerfile
|
||||
image: monibuca:v4
|
||||
restart: unless-stopped
|
||||
#please use host mode as expose large number of ports will cause docker extremely slow
|
||||
network_mode: host
|
||||
volumes:
|
||||
- ${PWD}/config.yaml:/monibuca/config.yaml
|
||||
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
26
go.gv
26
go.gv
@@ -1,26 +0,0 @@
|
||||
digraph G {
|
||||
wall[label="翻墙"]
|
||||
wall2[label="翻墙"]
|
||||
gateway[label="访问8081"]
|
||||
proxy[label="export GOPROXY=https://goproxy.io,direct"]
|
||||
build[label="go build"]
|
||||
get[label="go get"]
|
||||
mod[label="go mod init"]
|
||||
run[label="go run main.go"]
|
||||
bin[label="./monibuca"]
|
||||
bin2[label="GOPATH/bin/monibuca"]
|
||||
clone[label="clone project"]
|
||||
getDemo[label="go get github.com/langhuihui/monibuca"]
|
||||
hasGoMod[shape=diamond label="has go.mod"]
|
||||
clone->hasGoMod
|
||||
hasGoMod->proxy[label="yes"]
|
||||
proxy->build
|
||||
hasGoMod->wall[label="no"]
|
||||
hasGoMod->mod[label="no"]
|
||||
mod->proxy
|
||||
wall->get
|
||||
get->run
|
||||
get->build->bin->gateway
|
||||
run->gateway
|
||||
wall2->getDemo->bin2->gateway
|
||||
}
|
||||
144
go.mod
144
go.mod
@@ -1,49 +1,107 @@
|
||||
module github.com/langhuihui/monibuca
|
||||
module monibuca
|
||||
|
||||
go 1.16
|
||||
go 1.21
|
||||
|
||||
toolchain go1.21.8
|
||||
|
||||
require (
|
||||
github.com/Monibuca/engine/v2 v2.4.0
|
||||
github.com/Monibuca/plugin-cluster v1.2.0
|
||||
github.com/Monibuca/plugin-gateway v1.3.0
|
||||
github.com/Monibuca/plugin-gb28181 v1.1.0
|
||||
github.com/Monibuca/plugin-hdl v1.2.7
|
||||
github.com/Monibuca/plugin-hls v1.3.0
|
||||
github.com/Monibuca/plugin-jessica v1.4.1
|
||||
github.com/Monibuca/plugin-logrotate v1.3.0
|
||||
github.com/Monibuca/plugin-record v1.1.0
|
||||
github.com/Monibuca/plugin-rtmp v1.2.5
|
||||
github.com/Monibuca/plugin-rtsp v1.4.1
|
||||
github.com/Monibuca/plugin-ts v1.2.3
|
||||
github.com/Monibuca/plugin-webrtc v1.3.0
|
||||
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
|
||||
github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75 // indirect
|
||||
go.uber.org/zap v1.27.0
|
||||
m7s.live/engine/v4 v4.15.2-0.20240507090929-4a481a016544
|
||||
m7s.live/plugin/debug/v4 v4.0.3
|
||||
m7s.live/plugin/fmp4/v4 v4.0.6
|
||||
m7s.live/plugin/gb28181/v4 v4.4.5-0.20240403021512-d35b18f1a977
|
||||
m7s.live/plugin/hdl/v4 v4.1.11-0.20240313041408-780dcc14aa1b
|
||||
m7s.live/plugin/hls/v4 v4.3.9-0.20240313063851-81841202e6ab
|
||||
m7s.live/plugin/hook/v4 v4.0.3
|
||||
m7s.live/plugin/jessica/v4 v4.2.1
|
||||
m7s.live/plugin/logrotate/v4 v4.0.6
|
||||
m7s.live/plugin/monitor/v4 v4.0.5
|
||||
m7s.live/plugin/preview/v4 v4.1.5-0.20240313053841-3228fb004004
|
||||
m7s.live/plugin/record/v4 v4.4.7-0.20240326145629-cfa781bce27d
|
||||
m7s.live/plugin/room/v4 v4.1.1-0.20240402112256-da53fe368413
|
||||
m7s.live/plugin/rtmp/v4 v4.3.1-0.20240307124858-efe5c2b0ee20
|
||||
m7s.live/plugin/rtsp/v4 v4.3.5-0.20240228010654-14ef344d0848
|
||||
m7s.live/plugin/snap/v4 v4.0.8
|
||||
m7s.live/plugin/webrtc/v4 v4.2.6-0.20240228010952-272f6e1bc8bd
|
||||
m7s.live/plugin/webtransport/v4 v4.0.11-0.20240315020839-41e8fdf847bc
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Eyevinn/mp4ff v0.42.0 // indirect
|
||||
github.com/bluenviron/gortsplib/v4 v4.8.0 // indirect
|
||||
github.com/bluenviron/mediacommon v1.9.2 // indirect
|
||||
github.com/cnotch/ipchub v1.1.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/deepch/vdk v0.0.27 // indirect
|
||||
github.com/denisbrodbeck/machineid v1.0.1 // indirect
|
||||
github.com/discoviking/fsm v0.0.0-20150126104936-f4a273feecca // indirect
|
||||
github.com/ghettovoice/gosip v0.0.0-20231227123312-6b80e2d3e6f7 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
||||
github.com/gobwas/httphead v0.1.0 // indirect
|
||||
github.com/gobwas/pool v0.2.1 // indirect
|
||||
github.com/gobwas/ws v1.0.4 // indirect
|
||||
github.com/golang/protobuf v1.5.1 // indirect
|
||||
github.com/google/uuid v1.2.0 // indirect
|
||||
github.com/lucas-clemente/quic-go v0.20.0 // indirect
|
||||
github.com/marten-seemann/chacha20 v0.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.8 // indirect
|
||||
github.com/pion/dtls/v2 v2.0.8 // indirect
|
||||
github.com/pion/mdns v0.0.5 // indirect
|
||||
github.com/pion/quic v0.1.4 // indirect
|
||||
github.com/pion/rtcp v1.2.6 // indirect
|
||||
github.com/pion/rtp v1.6.2 // indirect
|
||||
github.com/pion/sctp v1.7.12 // indirect
|
||||
github.com/pion/srtp v1.5.2 // indirect
|
||||
github.com/pion/turn/v2 v2.0.5 // indirect
|
||||
github.com/pion/udp v0.1.1 // indirect
|
||||
github.com/pion/webrtc/v2 v2.2.26 // indirect
|
||||
github.com/shirou/gopsutil v3.21.2+incompatible // indirect
|
||||
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
|
||||
golang.org/x/net v0.0.0-20210324051636-2c4c8ecb7826 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492 // indirect
|
||||
golang.org/x/text v0.3.5 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
|
||||
github.com/gobwas/ws v1.3.2 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/husanpao/ip v0.0.0-20220711082147-73160bb611a8 // indirect
|
||||
github.com/logrusorgru/aurora/v4 v4.0.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect
|
||||
github.com/marten-seemann/qpack v0.3.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mcuadros/go-defaults v1.2.0 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.16.0 // indirect
|
||||
github.com/pion/datachannel v1.5.5 // indirect
|
||||
github.com/pion/dtls/v2 v2.2.10 // indirect
|
||||
github.com/pion/ice/v3 v3.0.3 // indirect
|
||||
github.com/pion/interceptor v0.1.25 // indirect
|
||||
github.com/pion/logging v0.2.2 // indirect
|
||||
github.com/pion/mdns v0.0.12 // indirect
|
||||
github.com/pion/randutil v0.1.0 // indirect
|
||||
github.com/pion/rtcp v1.2.14 // indirect
|
||||
github.com/pion/rtp v1.8.3 // indirect
|
||||
github.com/pion/sctp v1.8.12 // indirect
|
||||
github.com/pion/sdp/v3 v3.0.8 // indirect
|
||||
github.com/pion/srtp/v3 v3.0.1 // indirect
|
||||
github.com/pion/stun/v2 v2.0.0 // indirect
|
||||
github.com/pion/transport/v2 v2.2.4 // indirect
|
||||
github.com/pion/transport/v3 v3.0.1 // indirect
|
||||
github.com/pion/turn/v3 v3.0.1 // indirect
|
||||
github.com/pion/webrtc/v3 v3.2.29 // indirect
|
||||
github.com/pion/webrtc/v4 v4.0.0-beta.13 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||
github.com/q191201771/naza v0.30.48 // indirect
|
||||
github.com/quangngotan95/go-m3u8 v0.1.0 // indirect
|
||||
github.com/quic-go/qpack v0.4.0 // indirect
|
||||
github.com/quic-go/quic-go v0.41.0 // indirect
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.24.2 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/stretchr/testify v1.9.0 // indirect
|
||||
github.com/tevino/abool v1.2.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.13 // indirect
|
||||
github.com/tklauser/numcpus v0.7.0 // indirect
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
|
||||
github.com/yapingcat/gomedia v0.0.0-20240106100545-1b855b02fa0d // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
go.uber.org/mock v0.4.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.21.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect
|
||||
golang.org/x/mod v0.16.0 // indirect
|
||||
golang.org/x/net v0.22.0 // indirect
|
||||
golang.org/x/sync v0.6.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/term v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/tools v0.19.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
m7s.live/plugin/ps/v4 v4.1.5-0.20240228014109-36ba11968b92 // indirect
|
||||
|
||||
)
|
||||
|
||||
23
goreleaser.yml
Normal file
23
goreleaser.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
project_name: m7s
|
||||
archives:
|
||||
-
|
||||
files:
|
||||
- config.yaml
|
||||
- favicon.ico
|
||||
- conf-example/*
|
||||
builds:
|
||||
- id: "all"
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Tag}}
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- arm64
|
||||
- amd64
|
||||
hooks:
|
||||
pre:
|
||||
- go mod tidy
|
||||
27
local.monibuca.com.key
Normal file
27
local.monibuca.com.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEA28nTcgJqaNhqE1O/pOhWYXCstILuszRPxVH74fHLBezXrnBw
|
||||
EaoD7J2/iv7tbG5sW4TF3E85hEuQ7gIjrTliEot58ADvao16y9sxZuYPckMn4nWu
|
||||
5uc4MWf+8TYQn3cM16yg/e8+Qm9EliaCkXUf42xZCvCJ3ZJ4hW8/2yl+yPeFcAw2
|
||||
MyG7LzO1s96FqWCaMv6sZAHIAAlyfdvAhuASi5ADL16qCT4+S02GZdSWBkxs1F9Z
|
||||
4ZMvnw4vbu2zT+WU3eMYIq5Y1MpHve1PPtHqMttZMiISpPFtSiWIhWSZRIYJU8Qd
|
||||
WCFVAXmkbuKWOG0QB+/N8jlHiZXf2A/BdxY+6wIDAQABAoIBAQC93flqqQmRrzrb
|
||||
nWKWLBvLK1IW0nEwoEU1OaC1zHJNmQ+tYvZ9W/jt5Ex+38DtBetXmDhxHIOcdMcr
|
||||
xO9bCpJdYN4i5jvtOXFWP/HKaX34gGkpKe7BDAewLp2/dKwhhe+zNS8SjyWisIp4
|
||||
h6YN0DeO+J9nYupGXez9oGByjMM5CXiKEMGTfxPs3PCBmAAShpfQgk0uF+qenngP
|
||||
glexa3kVEQa/30IhxKy7S+E2QzDCKhGHg0cwmoTY0GMrJITQL6dpTT8fjMbv99zq
|
||||
8tn1xYqXuOrhdnOfl5xX906MV2Zs+lnsn3y/jxR/VzLeO/aixKEyjfOwNTnHwO01
|
||||
YWyW10OxAoGBAPkqfNR+pAlfK6T4QaeM8fDxcPBE08onIXhiwantF6fIf78wvKUk
|
||||
di+SD4u+fzx2tuGKey9SyTB48v+QgbQDgdXjis7yGOwtZ6l1FRM6hVZecxPlNsE2
|
||||
dpzGQFuzlSFOIfuEQz9dA6t9cLBddtL1avqEH91H4q/1yKx/7LblowhzAoGBAOHR
|
||||
EHv9K8RqWwidJt54bd9xypcZq/SxW72BVTEBII7AuIRYLEWvnYl8OiNJHtlO7Zth
|
||||
BWAeYREk3JVKLCsMQDBKBR6dHHOJgZtDzc7CTA9x1b6asTC63ESawkTq7LB4JN8n
|
||||
sbIuzzyAxrHod9GAhD5LwC0VpQ706ZRRF/e05+mpAoGAKsOQCShzHuimpPm2yvr1
|
||||
y1Sk/ZfSga+VnwPUGUYH+VQAGOBUgENxxVhcMq/PRqFZYfxSiBy9SwR3MEWs/Shc
|
||||
8EjNWhdTD7X7RKpDo7k3iUtMlO2SKDcgxGeCRDreLYkra++XWxiruJMe9CYWbr6Q
|
||||
Tc6/aUsdLPYSKwkJp5piEOECgYADVdsweaTT2d5OWkPgtVaqHjwnzzFDA/ue6PIh
|
||||
LysT8LTI/6RnwxhIl5UkQEg8XXYU/XHe4ZP9dNXtPpM4b43jKLS6pwdsjXNkn7PC
|
||||
ggwtjjjh/9buKVRnjwGfkvi8AopI4YU2ZIqbEivdJNngNk29vdCw2cj+V4+7qRb5
|
||||
iaqDQQKBgQCSW9FGXQUSvhDRRJRnbEPN9wQ7d1FO2NdD5Lw1Ztp6jaxMcFIvSYZH
|
||||
xUE/W2ZW8bIX1RmD3lQx/gyFypMpnQjt09EYPan0YkxbToaviL2dptbSfHzJY4x2
|
||||
oLKzOUgFJcwvWu5EmIxrbQqzMwn7KK6a/acKbCd8BZWE74T0PCmECA==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
66
local.monibuca.com_bundle.pem
Normal file
66
local.monibuca.com_bundle.pem
Normal file
@@ -0,0 +1,66 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
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
|
||||
P710Esdx5eHD8jhLRS9Aynx32g==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFBzCCA++gAwIBAgIRALIM7VUuMaC/NDp1KHQ76aswDQYJKoZIhvcNAQELBQAw
|
||||
ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
|
||||
A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
|
||||
BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0yMjAxMTAwMDAwMDBaFw0y
|
||||
ODEyMzEyMzU5NTlaMFkxCzAJBgNVBAYTAkNOMSUwIwYDVQQKExxUcnVzdEFzaWEg
|
||||
VGVjaG5vbG9naWVzLCBJbmMuMSMwIQYDVQQDExpUcnVzdEFzaWEgUlNBIERWIFRM
|
||||
UyBDQSBHMjCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKjGDe0GSaBs
|
||||
Yl/VhMaTM6GhfR1TAt4mrhN8zfAMwEfLZth+N2ie5ULbW8YvSGzhqkDhGgSBlafm
|
||||
qq05oeESrIJQyz24j7icGeGyIZ/jIChOOvjt4M8EVi3O0Se7E6RAgVYcX+QWVp5c
|
||||
Sy+l7XrrtL/pDDL9Bngnq/DVfjCzm5ZYUb1PpyvYTP7trsV+yYOCNmmwQvB4yVjf
|
||||
IIpHC1OcsPBntMUGeH1Eja4D+qJYhGOxX9kpa+2wTCW06L8T6OhkpJWYn5JYiht5
|
||||
8exjAR7b8Zi3DeG9oZO5o6Qvhl3f8uGU8lK1j9jCUN/18mI/5vZJ76i+hsgdlfZB
|
||||
Rh5lmAQjD80M9TY+oD4MYUqB5XrigPfFAUwXFGehhlwCVw7y6+5kpbq/NpvM5Ba8
|
||||
SeQYUUuMA8RXpTtGlrrTPqJryfa55hTuX/ThhX4gcCVkbyujo0CYr+Uuc14IOyNY
|
||||
1fD0/qORbllbgV41wiy/2ZUWZQUodqHWkjT1CwIMbQOY5jmrSYGBwwIDAQABo4IB
|
||||
JjCCASIwHwYDVR0jBBgwFoAUoBEKIz6W8Qfs4q8p74Klf9AwpLQwHQYDVR0OBBYE
|
||||
FF86fBEQfgxncWHci6O1AANn9VccMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E
|
||||
CDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAiBgNVHSAE
|
||||
GzAZMA0GCysGAQQBsjEBAgIxMAgGBmeBDAECATBDBgNVHR8EPDA6MDigNqA0hjJo
|
||||
dHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNy
|
||||
bDA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9k
|
||||
b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY
|
||||
eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO
|
||||
2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4
|
||||
3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP
|
||||
v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s
|
||||
Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g==
|
||||
-----END CERTIFICATE-----
|
||||
96
main.go
96
main.go
@@ -1,45 +1,73 @@
|
||||
package main
|
||||
|
||||
//go:generate go run gen.go $debug
|
||||
|
||||
/*
|
||||
███ ███ ██████ ███ ██ 👑 ██████ ██ ██ ██████ █████
|
||||
████ ████ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||
██ ████ ██ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ███████
|
||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||
██ ██ ██████ ██ ████ ██ ██████ ██████ ██████ ██ ██
|
||||
|
||||
The live stream server for Go
|
||||
(c) dexter 2019-present
|
||||
|
||||
说明:
|
||||
本项目为 monibuca 的启动工程,你也可以自己创建一个启动工程
|
||||
本启动工程引入了 engine 和一些列官方插件,并且保证版本依赖关系
|
||||
自己创建工程的时候,版本依赖必须参考本工程,否则容易出现依赖关系错乱
|
||||
流的播放地址请查看文档:https://m7s.live/guide/qa/play.html
|
||||
推拉流的配置方法看文档:https://m7s.live/guide/config.html#%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE
|
||||
|
||||
高频问题:
|
||||
1、OBS只能推送 rtmp 协议,如需推送 rtsp 需要安装插件
|
||||
2、除了rtsp协议以外其他协议播放H265需要使用jessibuca播放器(preview 插件内置了jessibuca播放器)
|
||||
3、浏览器不能直接播放rtmp、rtsp等基于tcp的协议,因为在js的环境中,无法直接使用tcp或者udp传数据(js没提供接口),而rtsp或rtmp的流是基于tcp或者udp, 所以纯web的方式目前是没办法直接播放rtsp或rtmp流的
|
||||
4、webrtc是否可以播放h265取决于浏览器是否包含h265解码器(通常不包含)
|
||||
5、webrtc不支持aac格式的音频
|
||||
6、gb插件能收到设备的注册,但是没有流,可能:1、媒体端口被防火墙拦截默认是58200,2、使用公网IP需要配置sipip字段或者mediaip字段用于设备向指定IP发送流。3、配置范围端口(部分设备ssrc乱搞导致的)
|
||||
7、当没有订阅者的时候如何自动停止拉流:设置publish 配置下的 delayclosetimeout 参数例如 10s,代表最后一个订阅者离开后 10s 后自动停止流
|
||||
8、使用 ffmpeg 推流时请加-c:v h264 -c:a aac,否则 ffmpeg 会自动将流转换成系统不支持的格式
|
||||
9、StreamPath 必须形如 live/test 。不能只有一级,或者斜杠开头,如/live 是错误的。
|
||||
10、如果遇到直接退出(崩溃)查看一下fatal.log。
|
||||
*/
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"fmt"
|
||||
|
||||
. "github.com/Monibuca/engine/v2"
|
||||
_ "github.com/Monibuca/plugin-cluster"
|
||||
_ "github.com/Monibuca/plugin-gateway"
|
||||
_ "github.com/Monibuca/plugin-gb28181"
|
||||
_ "github.com/Monibuca/plugin-hdl"
|
||||
_ "github.com/Monibuca/plugin-hls"
|
||||
_ "github.com/Monibuca/plugin-jessica"
|
||||
_ "github.com/Monibuca/plugin-logrotate"
|
||||
_ "github.com/Monibuca/plugin-record"
|
||||
_ "github.com/Monibuca/plugin-rtmp"
|
||||
_ "github.com/Monibuca/plugin-rtsp"
|
||||
_ "github.com/Monibuca/plugin-ts"
|
||||
_ "github.com/Monibuca/plugin-webrtc"
|
||||
"m7s.live/engine/v4"
|
||||
"m7s.live/engine/v4/util"
|
||||
|
||||
_ "m7s.live/plugin/logrotate/v4"
|
||||
_ "m7s.live/plugin/debug/v4"
|
||||
_ "m7s.live/plugin/gb28181/v4"
|
||||
_ "m7s.live/plugin/hdl/v4"
|
||||
_ "m7s.live/plugin/hls/v4"
|
||||
_ "m7s.live/plugin/hook/v4"
|
||||
_ "m7s.live/plugin/jessica/v4"
|
||||
_ "m7s.live/plugin/preview/v4"
|
||||
_ "m7s.live/plugin/record/v4"
|
||||
_ "m7s.live/plugin/room/v4"
|
||||
_ "m7s.live/plugin/rtmp/v4"
|
||||
_ "m7s.live/plugin/rtsp/v4"
|
||||
_ "m7s.live/plugin/snap/v4"
|
||||
_ "m7s.live/plugin/webrtc/v4"
|
||||
_ "m7s.live/plugin/webtransport/v4"
|
||||
_ "m7s.live/plugin/fmp4/v4"
|
||||
_ "m7s.live/plugin/monitor/v4"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
)
|
||||
|
||||
func main() {
|
||||
addr := flag.String("c", "", "config file")
|
||||
fmt.Println("start github.com/langhuihui/monibuca version:", version)
|
||||
conf := flag.String("c", "config.yaml", "config file")
|
||||
flag.Parse()
|
||||
if *addr == "" {
|
||||
// _, currentFile, _, _ := runtime.Caller(0)
|
||||
// configFile := filepath.Join(filepath.Dir(currentFile), "config.toml")
|
||||
Run(filepath.Join(filepath.Dir(os.Args[0]), "config.toml"))
|
||||
} else {
|
||||
Run(*addr)
|
||||
}
|
||||
waiter(context.Background())
|
||||
}
|
||||
|
||||
func waiter(ctx context.Context) {
|
||||
sigc := make(chan os.Signal, 1)
|
||||
signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM)
|
||||
defer signal.Stop(sigc)
|
||||
<-sigc
|
||||
ctx.Done()
|
||||
ctx, cancel := context.WithCancel(context.WithValue(context.Background(), "version", version))
|
||||
go util.WaitTerm(cancel)
|
||||
engine.Run(ctx, *conf)
|
||||
}
|
||||
|
||||
BIN
monibuca_windows_amd64.syso
Normal file
BIN
monibuca_windows_amd64.syso
Normal file
Binary file not shown.
4
test/config.yaml
Normal file
4
test/config.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
global:
|
||||
# loglevel: trace
|
||||
publish:
|
||||
ringsize: 20
|
||||
52
test/stream_test.go
Normal file
52
test/stream_test.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// TestPubAndSub 测试发布和订阅
|
||||
func TestPubAndSub(t *testing.T) {
|
||||
t.Cleanup(FreeEngine)
|
||||
UseEngine()
|
||||
t.Run("publish", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var pub UnitTestPublisher
|
||||
unitTestPlugin.Publish("test/001", &pub)
|
||||
})
|
||||
t.Run("subscribe", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var sub UnitTestSubsciber
|
||||
sub.tb = t
|
||||
err := unitTestPlugin.Subscribe("test/001", &sub)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
sub.PlayRaw()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func BenchmarkPubAndSub(b *testing.B) {
|
||||
b.Cleanup(FreeEngine)
|
||||
UseEngine()
|
||||
for i := 0; i < 10; i++ {
|
||||
i := i
|
||||
go func(i int) {
|
||||
var pub UnitTestPublisher
|
||||
unitTestPlugin.Publish(fmt.Sprintf("testb/%d", i), &pub)
|
||||
}(i)
|
||||
go b.RunParallel(func(pb *testing.PB) {
|
||||
var sub UnitTestSubsciber
|
||||
sub.tb = b
|
||||
err := unitTestPlugin.Subscribe(fmt.Sprintf("testb/%d", i), &sub)
|
||||
if err != nil {
|
||||
// b.Fatal(err)
|
||||
} else {
|
||||
sub.PlayRaw()
|
||||
}
|
||||
})
|
||||
}
|
||||
time.Sleep(time.Second * 10)
|
||||
}
|
||||
33
test/subscriber_test.go
Normal file
33
test/subscriber_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
. "m7s.live/engine/v4"
|
||||
)
|
||||
|
||||
type SlowSubsciber struct {
|
||||
Subscriber
|
||||
}
|
||||
|
||||
func (s *SlowSubsciber) OnEvent(event any) {
|
||||
switch event.(type) {
|
||||
case AudioFrame:
|
||||
case VideoFrame:
|
||||
// 模拟慢消费,导致长时间占用后被发布者移除
|
||||
time.Sleep(1000 * time.Millisecond)
|
||||
default:
|
||||
s.Subscriber.OnEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSlowSubscriber(t *testing.T) {
|
||||
t.Cleanup(FreeEngine)
|
||||
UseEngine()
|
||||
var pub UnitTestPublisher
|
||||
unitTestPlugin.Publish("test/slow", &pub)
|
||||
var suber SlowSubsciber
|
||||
unitTestPlugin.Subscribe("test/slow", &suber)
|
||||
suber.PlayRaw()
|
||||
}
|
||||
123
test/type.go
Normal file
123
test/type.go
Normal file
@@ -0,0 +1,123 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
. "m7s.live/engine/v4"
|
||||
"m7s.live/engine/v4/config"
|
||||
"m7s.live/engine/v4/track"
|
||||
"m7s.live/engine/v4/util"
|
||||
)
|
||||
|
||||
var conf UnitTestConfig
|
||||
var unitTestPlugin = InstallPlugin(&conf)
|
||||
var spsppsbase64 = "AAABJ2QANKwTGqAoALWgHixLcAAAAAEozgVywA=="
|
||||
var spspps, _ = base64.RawStdEncoding.DecodeString(spsppsbase64)
|
||||
var EngineChan = make(chan int, 10)
|
||||
var WaitEngine sync.WaitGroup
|
||||
|
||||
func UseEngine() {
|
||||
EngineChan <- 1
|
||||
WaitEngine.Wait()
|
||||
}
|
||||
func FreeEngine() {
|
||||
EngineChan <- -1
|
||||
}
|
||||
func init() {
|
||||
WaitEngine.Add(1)
|
||||
go func() {
|
||||
var use = 0
|
||||
bg := context.Background()
|
||||
var ctx context.Context
|
||||
var cancel context.CancelFunc
|
||||
for {
|
||||
select {
|
||||
case delta := <-EngineChan:
|
||||
use += delta
|
||||
switch use {
|
||||
case 1:
|
||||
ctx, cancel = context.WithTimeout(bg, time.Second*20)
|
||||
go Run(ctx, "config.yaml")
|
||||
case 0:
|
||||
cancel()
|
||||
WaitEngine.Add(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
type UnitTestConfig struct {
|
||||
config.Subscribe
|
||||
config.Publish
|
||||
}
|
||||
|
||||
func (t *UnitTestConfig) OnEvent(event any) {
|
||||
switch event.(type) {
|
||||
case FirstConfig:
|
||||
WaitEngine.Done()
|
||||
}
|
||||
}
|
||||
|
||||
type UnitTestPublisher struct {
|
||||
tb testing.TB
|
||||
Publisher
|
||||
}
|
||||
|
||||
type UnitTestSubsciber struct {
|
||||
tb testing.TB
|
||||
Subscriber
|
||||
}
|
||||
|
||||
func (s *UnitTestSubsciber) OnEvent(event any) {
|
||||
switch v := event.(type) {
|
||||
case AudioFrame:
|
||||
case VideoFrame:
|
||||
b := v.AUList.ToBytes()
|
||||
seq := (uint16(b[1]) << 8) | uint16(b[2])
|
||||
// s.Trace("sequence", zap.Uint32("sequence", v.Sequence), zap.Uint16("seq", seq), zap.Int("len", len(b)))
|
||||
if v.Sequence != uint32(seq) {
|
||||
s.tb.Fatal("sequence error", v.Sequence, seq)
|
||||
}
|
||||
default:
|
||||
s.Subscriber.OnEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
func (pub *UnitTestPublisher) OnEvent(event any) {
|
||||
switch event.(type) {
|
||||
case IPublisher:
|
||||
pub.VideoTrack = track.NewH264(pub)
|
||||
pub.VideoTrack.WriteAnnexB(0, 0, spspps)
|
||||
pub.AudioTrack = track.NewAAC(pub)
|
||||
go pub.WriteAudio()
|
||||
go pub.WriteVideo()
|
||||
}
|
||||
}
|
||||
func (pub *UnitTestPublisher) WriteAudio() {
|
||||
for i := uint32(0); pub.Err() == nil; i++ {
|
||||
time.Sleep(40 * time.Millisecond)
|
||||
elapse := time.Since(pub.StartTime)
|
||||
pts := uint32(elapse.Milliseconds() * 90)
|
||||
pub.AudioTrack.WriteADTS(pts, util.Buffer([]byte{0xFF, 0xE1, 0x20, 0x00, 0x29, 0xA7, 0xF0, byte(i >> 8), byte(i), 0}))
|
||||
}
|
||||
}
|
||||
func (pub *UnitTestPublisher) WriteVideo() {
|
||||
for i := uint32(0); pub.Err() == nil; i++ {
|
||||
time.Sleep(40 * time.Millisecond)
|
||||
elapse := time.Since(pub.StartTime)
|
||||
pts := uint32(elapse.Milliseconds() * 90)
|
||||
var naluType byte = 0x61
|
||||
if elapse%8 == 0 {
|
||||
naluType = 0x65
|
||||
}
|
||||
data := []byte{naluType, byte(i >> 8), byte(i)}
|
||||
pub.Trace("data", zap.Uint32("i", i))
|
||||
pub.VideoTrack.WriteNalu(pts, pts, data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user