Compare commits
179 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c6257a560f | ||
![]() |
3b3ffc18aa | ||
![]() |
938bd92dca | ||
![]() |
0c10c07be1 | ||
![]() |
65d6f5c33e | ||
![]() |
08c871653d | ||
![]() |
8bae7cace2 | ||
![]() |
133bf6eaa3 | ||
![]() |
d2d09b0386 | ||
![]() |
668c1318c2 | ||
![]() |
dc4cf67705 | ||
![]() |
f3de8f2864 | ||
![]() |
9e876fb424 | ||
![]() |
7533d83ae7 | ||
![]() |
69a61a77bd | ||
![]() |
727d083079 | ||
![]() |
4d8f4db08b | ||
![]() |
c01e148f84 | ||
![]() |
8d0b344859 | ||
![]() |
0faada1a13 | ||
![]() |
3ffa4ab8b6 | ||
![]() |
ac742d07cf | ||
![]() |
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 | ||
![]() |
b0c6bff8ae | ||
![]() |
439eb0afc0 | ||
![]() |
f7e6c5084c | ||
![]() |
e0f424fd2c | ||
![]() |
98995de88a | ||
![]() |
b5c5976312 | ||
![]() |
c6dbda22f9 | ||
![]() |
1e78f687d7 | ||
![]() |
701b9b63f3 | ||
![]() |
58f134cda1 | ||
![]() |
d772ed3336 | ||
![]() |
fc4f13fa00 | ||
![]() |
2ee71755b7 | ||
![]() |
7e165fe9d4 | ||
![]() |
dd7a2e8dc7 | ||
![]() |
bd7f5249aa | ||
![]() |
bb9a154a00 | ||
![]() |
e3c7c9514e | ||
![]() |
b3a485ddfb | ||
![]() |
01a74b245e | ||
![]() |
4482f0232f | ||
![]() |
919f7ad78b | ||
![]() |
0c1f1c9770 | ||
![]() |
18a9398f66 | ||
![]() |
5828b8d803 | ||
![]() |
c328db87a8 | ||
![]() |
cc89bbb61b | ||
![]() |
cd34607c86 | ||
![]() |
cfb6dacf73 | ||
![]() |
eba5b6b8f1 | ||
![]() |
597407a4e5 | ||
![]() |
3fcd22d1e7 | ||
![]() |
65de4806c4 | ||
![]() |
55eb2218be | ||
![]() |
5c0b22b1df | ||
![]() |
474581d9b1 | ||
![]() |
3907422b3e | ||
![]() |
d3b7fa04ef | ||
![]() |
d16aa756f8 | ||
![]() |
8304314e49 | ||
![]() |
c2d0cbb1d0 | ||
![]() |
67ab443f1a | ||
![]() |
c80beec8f3 | ||
![]() |
1ce4fd2db0 | ||
![]() |
a20f30d76d | ||
![]() |
afa44eb173 | ||
![]() |
592034adce | ||
![]() |
6e8ac88aaf | ||
![]() |
da66df9302 | ||
![]() |
360f7faf35 | ||
![]() |
bee477e685 | ||
![]() |
4a0c4e36e7 | ||
![]() |
1ed3e6249f | ||
![]() |
1ac06ef252 | ||
![]() |
620d96b39c | ||
![]() |
66a396df0b | ||
![]() |
029abe3187 | ||
![]() |
40fba0d348 | ||
![]() |
73941d1e0b | ||
![]() |
709c2c6ac7 | ||
![]() |
f96bc11ddb | ||
![]() |
5563ddc0d2 | ||
![]() |
95657bd6df | ||
![]() |
b9e19e75c8 | ||
![]() |
eac623639d | ||
![]() |
fea6e98ca7 | ||
![]() |
649a5b558a | ||
![]() |
b3c8d35fad | ||
![]() |
ab745145d9 | ||
![]() |
a1bdc8528b | ||
![]() |
ecb931ccb0 | ||
![]() |
13c357493f | ||
![]() |
87776b9540 | ||
![]() |
543d735c41 | ||
![]() |
966f9b9d0d | ||
![]() |
5eb7f03dec |
86
.github/workflows/go.yml
vendored
Executable file
@@ -0,0 +1,86 @@
|
||||
name: Go
|
||||
|
||||
on:
|
||||
create:
|
||||
tags:
|
||||
- v3*
|
||||
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 up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.18
|
||||
|
||||
- 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: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Deploy Windows
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: dist/m7s_${{ env.version }}_windows_amd64.tar.gz
|
||||
remote: /opt/dexter/windows.tgz
|
||||
host: monibuca.com
|
||||
username: root
|
||||
privateKey: ${{ secrets.PEM }}
|
||||
|
||||
- name: Deploy Mac
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: dist/m7s_${{ env.version }}_darwin_amd64.tar.gz
|
||||
remote: /opt/dexter/mac.tgz
|
||||
host: monibuca.com
|
||||
username: root
|
||||
privateKey: ${{ secrets.PEM }}
|
||||
|
||||
- name: Deploy Mac arm64
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: dist/m7s_${{ env.version }}_darwin_arm64.tar.gz
|
||||
remote: /opt/dexter/mac_arm64.tgz
|
||||
host: monibuca.com
|
||||
username: root
|
||||
privateKey: ${{ secrets.PEM }}
|
||||
|
||||
- name: Deploy Linux
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: dist/m7s_${{ env.version }}_linux_amd64.tar.gz
|
||||
remote: /opt/dexter/linux.tgz
|
||||
host: monibuca.com
|
||||
username: root
|
||||
privateKey: ${{ secrets.PEM }}
|
||||
|
||||
- name: Deploy Linux arm64
|
||||
uses: garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
local: dist/m7s_${{ env.version }}_linux_arm64.tar.gz
|
||||
remote: /opt/dexter/linux_arm64.tgz
|
||||
host: monibuca.com
|
||||
username: root
|
||||
privateKey: ${{ secrets.PEM }}
|
||||
|
||||
|
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
*.exe
|
||||
.vscode
|
||||
.idea
|
||||
resource
|
||||
*.log
|
||||
/monibuca
|
||||
node_modules
|
||||
shutdown.bat
|
||||
shutdown.sh
|
||||
.m7s
|
||||
debug.go
|
||||
dist/
|
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019-present, dexter
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
98
README.md
@@ -1 +1,97 @@
|
||||
[中文文档](http://monibuca.com/docs)
|
||||
|
||||
<h2 align="center">
|
||||
<img src="https://monibuca.com/img/logo.089ef700.png"></h2>
|
||||
## Stargazers over time
|
||||
|
||||
# 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
|
||||
|
||||
# Quick start
|
||||
|
||||
## Go has not been installed
|
||||
```
|
||||
bash <(curl -s -S -L https://monibuca.com/go.sh)
|
||||
```
|
||||
## Go is already installed
|
||||
|
||||
1. git clone https://github.com/langhuihui/monibuca
|
||||
2. go build && ./monibuca
|
||||
3. open your browser http://localhost:8080
|
||||
4. use ffmpeg or OBS to push video streaming to rtmp://localhost/live/user1
|
||||
|
||||
# Ecosystem
|
||||
|
||||
go to
|
||||
[https://plugins.monibuca.com](https://plugins.monibuca.com).
|
||||
to submit your own plugin
|
||||
|
||||
| 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.
|
||||
|
||||
[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|✔||✔
|
||||
|
||||
# Build & Test with docker
|
||||
|
||||
> development and testing only: IP and udp ports need to be exposed carefully in production.
|
||||
```shell
|
||||
docker build . -f dockerfile -t m7s:3.0
|
||||
docker run --name m7s -p 1935:1935 -p 8081:8081 -p 8082:8082 -p 554:554 m7s:3.0
|
||||
```
|
||||
|
||||
# Documentation
|
||||
|
||||
中文文档:
|
||||
[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.
|
||||
|
77
README_zh.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# 主页
|
||||
|
||||
[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. git clone https://github.com/langhuihui/monibuca
|
||||
2. 执行go build得到可执行文件(windows下为monibuca.exe)
|
||||
3. 启动可执行文件后,浏览器打开8080端口查看后台界面
|
||||
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)
|
||||
|
||||
📈可视化
|
||||
|
||||
功能强大的仪表盘可以直观的看到服务器运行的状态、消耗的资源、以及其他统计信息。用户可以利用控制台对服务器进行配置和控制。
|
||||
|
||||
# 在 Docker 中编译和测试
|
||||
|
||||
> 生产服务需要暴露IP和大量端口,建议容器仅用于开发和测试
|
||||
```shell
|
||||
docker build . -f dockerfile -t m7s:3.0
|
||||
docker run --name m7s -p 1935:1935 -p 8081:8081 -p 8082:8082 -p 554:554 m7s:3.0
|
||||
```
|
||||
|
||||
# 交流微信群
|
||||
|
||||
进入网站首页上进行扫码
|
||||
|
||||
# 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
|
108
config.toml
@@ -1,18 +1,92 @@
|
||||
[Plugins.HDL]
|
||||
ListenAddr = ":2020"
|
||||
[Plugins.Jessica]
|
||||
ListenAddr = ":8080"
|
||||
[Plugins.RTMP]
|
||||
[Engine]
|
||||
EnableAudio = true
|
||||
EnableVideo = true
|
||||
# 发布流默认过期时间单位秒
|
||||
PublishTimeout = 60
|
||||
# 自动关闭触发后延迟的秒数(期间内如果有新的订阅则取消触发关闭)
|
||||
AutoCloseAfter = 10
|
||||
# RTP包乱序重排
|
||||
RTPReorder = false
|
||||
[Summary]
|
||||
# 1秒中采样一次
|
||||
SampleRate = 1
|
||||
[RTMP]
|
||||
ListenAddr = ":1935"
|
||||
[Plugins.GateWay]
|
||||
ListenAddr = ":81"
|
||||
#[Plugins.Cluster]
|
||||
#Master = "localhost:2019"
|
||||
#ListenAddr = ":2019"
|
||||
#
|
||||
#[Plugins.Auth]
|
||||
#Key="www.monibuca.com"
|
||||
#[Plugins.RecordFlv]
|
||||
#Path="./resouce"
|
||||
[Plugins.QoS]
|
||||
Suffix = ["high","medium","low"]
|
||||
[GateWay]
|
||||
ListenAddr = ":8081"
|
||||
ListenAddrTLS = ":8082"
|
||||
CertFile = "server.pem"
|
||||
KeyFile = "server.key"
|
||||
[Jessica]
|
||||
#ListenAddr = ":8081"
|
||||
#ListenAddrTLS = ":8083"
|
||||
#CertFile = "xxx.cert"
|
||||
#KeyFile = "xxx.key"
|
||||
[LogRotate]
|
||||
# 日志存储目录相对或绝对
|
||||
Path = "logs"
|
||||
# 日志是否按大小分割,0表示不按大小分割,非零代表按该大小字节进行分割
|
||||
Size = 0
|
||||
Days = 1
|
||||
# 按照go layout格式化,默认按照小时
|
||||
Formatter = "2006-01-02T15"
|
||||
# [FFMPEG]
|
||||
[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"
|
||||
#Reconnect = true
|
||||
[HDL.AutoPullList]
|
||||
# "live/hdl" = "http://flv.bdplay.nodemedia.cn/live/bbb.flv"
|
||||
[TS]
|
||||
# ts存放目录
|
||||
Path = "resource"
|
||||
[Record]
|
||||
Path = "resource"
|
||||
# 自动录制功能
|
||||
AutoRecord = false
|
||||
[RTSP]
|
||||
# 端口接收推流
|
||||
ListenAddr = ":554"
|
||||
Reconnect = true
|
||||
#启动后自动拉流,可以配置多个
|
||||
[RTSP.AutoPullList]
|
||||
# "live/rtsp" = "rtsp://114.116.215.52:38558/sub/3"
|
||||
# "live/rtsp" = "rtsp://admin:12345678ab@42.193.7.166:9514/11"
|
||||
# "live/rtc" = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4"
|
||||
# "live/rtsp" = "rtsp://admin:123456@42.193.7.166:9018/video1"
|
||||
[WebRTC]
|
||||
# 端口范围不配置的话是自动分配
|
||||
# PortMin = 30000
|
||||
# PortMax = 40000
|
||||
# 公网访问必须配置PublicIP,否则无法建立连接
|
||||
# PublicIP = ["192.168.1.120"]
|
||||
# WebRTC 推流时控制GOP大小,单位毫秒
|
||||
# PLI = 2000
|
||||
[GB28181]
|
||||
Serial = "34020000002000000001"
|
||||
Realm = "3402000000"
|
||||
Expires = 3600
|
||||
# 媒体端口
|
||||
# MediaPort = 58200
|
||||
# 开启TCP拉流,默认关闭
|
||||
# TCP = true
|
||||
# TCP端口数量,超过一个的话将会每个设备轮流使用,从MediaPort往下递增
|
||||
# TCPMediaPortNum = 1
|
||||
ListenAddr = "192.168.1.120:5060"
|
||||
# 自动停止发布,当订阅者数量将为0时,延迟N秒自动断开,-1代表不断开
|
||||
AutoCloseAfter = -1
|
||||
# 自动拉流,如果开启,则拿到设备注册信息后,就从设备拉流
|
||||
AutoInvite = true
|
21
dashboard/.gitignore
vendored
@@ -1,21 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
@@ -1,24 +0,0 @@
|
||||
# dashboard
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
|
||||
}
|
1
dashboard/dist/css/app.b4fc79e8.css
vendored
@@ -1 +0,0 @@
|
||||
#app,body,html{height:100%}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#184c18;position:relative}#app>div:first-child{position:absolute;top:10px;left:30px;font-size:x-large}.content{padding-top:60px}.feature-title[data-v-54efad41]{color:#eb5e46;font-weight:700;font-size:larger}p[data-v-54efad41]{margin:30px;font-size:20px}img[data-v-54efad41]{margin:20px}.root[data-v-e34eab40]{background:#d3d3d3}.root>img[data-v-e34eab40]{width:300px;margin:30px}@-webkit-keyframes recording-data-v-7b106554{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}@keyframes recording-data-v-7b106554{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}.recording[data-v-7b106554]{-webkit-animation:recording-data-v-7b106554 1s infinite;animation:recording-data-v-7b106554 1s infinite}.layout[data-v-7b106554]{padding-bottom:30px;position:relative}.room[data-v-7b106554]{width:250px;margin:10px;text-align:left}.empty[data-v-7b106554]{color:#eb5e46;width:100%;min-height:500px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.empty[data-v-7b106554],.status[data-v-7b106554]{display:-webkit-box;display:-ms-flexbox;display:flex}.status[data-v-7b106554]{position:fixed;left:5px;bottom:10px}.status>div[data-v-7b106554]{margin:0 5px}
|
17
dashboard/dist/docs/404.html
vendored
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.83ce04b6.js"><link rel="prefetch" href="/docs/assets/js/2.142d04d2.js"><link rel="prefetch" href="/docs/assets/js/3.2b6c987b.js"><link rel="prefetch" href="/docs/assets/js/4.ad90d74a.js"><link rel="prefetch" href="/docs/assets/js/5.36121818.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="content"><h1>404</h1><blockquote>There's nothing here.</blockquote><a href="/docs/" class="router-link-active">Take me home.</a></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><g stroke-width="2" stroke="#aaa" fill="none"><path d="M11.29 11.71l-4-4"/><circle cx="5" cy="5" r="4"/></g></svg>
|
Before Width: | Height: | Size: 216 B |
1
dashboard/dist/docs/assets/js/1.83ce04b6.js
vendored
1
dashboard/dist/docs/assets/js/2.142d04d2.js
vendored
1
dashboard/dist/docs/assets/js/3.2b6c987b.js
vendored
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{161:function(t,e,s){"use strict";s.r(e);var n=s(0),i=Object(n.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"更新历史"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#更新历史","aria-hidden":"true"}},[this._v("#")]),this._v(" 更新历史")]),e("ul",[e("li",[this._v("2020/1/27\n1.0完成")])])])}],!1,null,null,null);e.default=i.exports}}]);
|
1
dashboard/dist/docs/assets/js/4.ad90d74a.js
vendored
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{164:function(t,n,e){"use strict";e.r(n);var s=e(0),c=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"content"})}),[],!1,null,null,null);n.default=c.exports}}]);
|
1
dashboard/dist/docs/assets/js/5.36121818.js
vendored
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{165:function(s,a,t){"use strict";t.r(a);var e=t(0),n=Object(e.a)({},(function(){var s=this.$createElement;this._self._c;return this._m(0)}),[function(){var s=this,a=s.$createElement,t=s._self._c||a;return t("div",{staticClass:"content"},[t("h1",{attrs:{id:"jessica"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#jessica","aria-hidden":"true"}},[s._v("#")]),s._v(" Jessica")]),t("p",[s._v("该插件为基于WebSocket协议传输音视频的订阅者,音视频数据以裸数据的形式进行传输,我们需要Jessibuca播放器来进行播放\nJessibua播放器已内置于源码中,该播放器通过js解码H264并用canvas进行渲染,可以运行在几乎所有的终端浏览器上面。\n在Monibuca的Web界面中预览功能就是使用的Jessibuca播放器。")]),t("h2",{attrs:{id:"配置"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#配置","aria-hidden":"true"}},[s._v("#")]),s._v(" 配置")]),t("p",[s._v("目前仅有的配置是监听的端口号")]),t("div",{staticClass:"language-toml extra-class"},[t("pre",{pre:!0,attrs:{class:"language-toml"}},[t("code",[t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),t("span",{pre:!0,attrs:{class:"token table class-name"}},[s._v("Plugins.Jessica")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token key property"}},[s._v("ListenAddr")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("=")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[s._v('":8080"')]),s._v("\n")])])])])}],!1,null,null,null);a.default=n.exports}}]);
|
173
dashboard/dist/docs/develop.html
vendored
@@ -1,173 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>插件开发 | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="preload" href="/docs/assets/js/2.142d04d2.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.83ce04b6.js"><link rel="prefetch" href="/docs/assets/js/3.2b6c987b.js"><link rel="prefetch" href="/docs/assets/js/4.ad90d74a.js"><link rel="prefetch" href="/docs/assets/js/5.36121818.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">起步</a></li><li><a href="/docs/develop.html" class="active sidebar-link">插件开发</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/develop.html#插件的定义" class="sidebar-link">插件的定义</a></li><li class="sidebar-sub-header"><a href="/docs/develop.html#插件的安装" class="sidebar-link">插件的安装</a></li><li class="sidebar-sub-header"><a href="/docs/develop.html#开发订阅者插件" class="sidebar-link">开发订阅者插件</a></li><li class="sidebar-sub-header"><a href="/docs/develop.html#开发发布者插件" class="sidebar-link">开发发布者插件</a></li><li class="sidebar-sub-header"><a href="/docs/develop.html#开发钩子插件" class="sidebar-link">开发钩子插件</a></li></ul></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="插件开发"><a href="#插件开发" aria-hidden="true" class="header-anchor">#</a> 插件开发</h1><h2 id="插件的定义"><a href="#插件的定义" aria-hidden="true" class="header-anchor">#</a> 插件的定义</h2><p>所谓的插件,没有什么固定的规则,只需要完成<code>安装</code>操作即可。插件可以实现任意的功能扩展,最常见的是实现某种传输协议用来推流或者拉流</p><h2 id="插件的安装"><a href="#插件的安装" aria-hidden="true" class="header-anchor">#</a> 插件的安装</h2><p>下面是内置插件jessica的源码,代表了典型的插件安装</p><div class="language-go extra-class"><pre class="language-go"><code><span class="token keyword">package</span> jessica
|
||||
|
||||
<span class="token keyword">import</span> <span class="token punctuation">(</span>
|
||||
<span class="token punctuation">.</span> <span class="token string">"github.com/langhuihui/monibuca/monica"</span>
|
||||
<span class="token string">"log"</span>
|
||||
<span class="token string">"net/http"</span>
|
||||
<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">var</span> config <span class="token operator">=</span> <span class="token function">new</span><span class="token punctuation">(</span>ListenerConfig<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token function">InstallPlugin</span><span class="token punctuation">(</span><span class="token operator">&</span>PluginConfig<span class="token punctuation">{</span>
|
||||
Name<span class="token punctuation">:</span> <span class="token string">"Jessica"</span><span class="token punctuation">,</span>
|
||||
Type<span class="token punctuation">:</span> PLUGIN_SUBSCRIBER<span class="token punctuation">,</span>
|
||||
Config<span class="token punctuation">:</span> config<span class="token punctuation">,</span>
|
||||
Run<span class="token punctuation">:</span> run<span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">func</span> <span class="token function">run</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
log<span class="token punctuation">.</span><span class="token function">Printf</span><span class="token punctuation">(</span><span class="token string">"server Jessica start at %s"</span><span class="token punctuation">,</span> config<span class="token punctuation">.</span>ListenAddr<span class="token punctuation">)</span>
|
||||
log<span class="token punctuation">.</span><span class="token function">Fatal</span><span class="token punctuation">(</span>http<span class="token punctuation">.</span><span class="token function">ListenAndServe</span><span class="token punctuation">(</span>config<span class="token punctuation">.</span>ListenAddr<span class="token punctuation">,</span> http<span class="token punctuation">.</span><span class="token function">HandlerFunc</span><span class="token punctuation">(</span>WsHandler<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre></div><p>当主程序读取配置文件完成解析后,会调用各个插件的Run函数,上面代码中执行了一个http的端口监听</p><h2 id="开发订阅者插件"><a href="#开发订阅者插件" aria-hidden="true" class="header-anchor">#</a> 开发订阅者插件</h2><p>所谓订阅者就是用来从流媒体服务器接收音视频流的程序,例如RTMP协议执行play命令后、http-flv请求响应程序、websocket响应程序。内置插件中录制flv程序也是一个特殊的订阅者。
|
||||
下面是http-flv插件的源码,供参考</p><div class="language-go extra-class"><pre class="language-go"><code><span class="token keyword">package</span> HDL
|
||||
|
||||
<span class="token keyword">import</span> <span class="token punctuation">(</span>
|
||||
<span class="token punctuation">.</span> <span class="token string">"github.com/langhuihui/monibuca/monica"</span>
|
||||
<span class="token string">"github.com/langhuihui/monibuca/monica/avformat"</span>
|
||||
<span class="token string">"github.com/langhuihui/monibuca/monica/pool"</span>
|
||||
<span class="token string">"log"</span>
|
||||
<span class="token string">"net/http"</span>
|
||||
<span class="token string">"strings"</span>
|
||||
<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">var</span> config <span class="token operator">=</span> <span class="token function">new</span><span class="token punctuation">(</span>ListenerConfig<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token function">InstallPlugin</span><span class="token punctuation">(</span><span class="token operator">&</span>PluginConfig<span class="token punctuation">{</span>
|
||||
Name<span class="token punctuation">:</span> <span class="token string">"HDL"</span><span class="token punctuation">,</span>
|
||||
Type<span class="token punctuation">:</span> PLUGIN_SUBSCRIBER<span class="token punctuation">,</span>
|
||||
Config<span class="token punctuation">:</span> config<span class="token punctuation">,</span>
|
||||
Run<span class="token punctuation">:</span> run<span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">run</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
log<span class="token punctuation">.</span><span class="token function">Printf</span><span class="token punctuation">(</span><span class="token string">"HDL start at %s"</span><span class="token punctuation">,</span> config<span class="token punctuation">.</span>ListenAddr<span class="token punctuation">)</span>
|
||||
log<span class="token punctuation">.</span><span class="token function">Fatal</span><span class="token punctuation">(</span>http<span class="token punctuation">.</span><span class="token function">ListenAndServe</span><span class="token punctuation">(</span>config<span class="token punctuation">.</span>ListenAddr<span class="token punctuation">,</span> http<span class="token punctuation">.</span><span class="token function">HandlerFunc</span><span class="token punctuation">(</span>HDLHandler<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">HDLHandler</span><span class="token punctuation">(</span>w http<span class="token punctuation">.</span>ResponseWriter<span class="token punctuation">,</span> r <span class="token operator">*</span>http<span class="token punctuation">.</span>Request<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
sign <span class="token operator">:=</span> r<span class="token punctuation">.</span>URL<span class="token punctuation">.</span><span class="token function">Query</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Get</span><span class="token punctuation">(</span><span class="token string">"sign"</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> err <span class="token operator">:=</span> AuthHooks<span class="token punctuation">.</span><span class="token function">Trigger</span><span class="token punctuation">(</span>sign<span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
|
||||
w<span class="token punctuation">.</span><span class="token function">WriteHeader</span><span class="token punctuation">(</span><span class="token number">403</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
stringPath <span class="token operator">:=</span> strings<span class="token punctuation">.</span><span class="token function">TrimLeft</span><span class="token punctuation">(</span>r<span class="token punctuation">.</span>RequestURI<span class="token punctuation">,</span> <span class="token string">"/"</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> strings<span class="token punctuation">.</span><span class="token function">HasSuffix</span><span class="token punctuation">(</span>stringPath<span class="token punctuation">,</span> <span class="token string">".flv"</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
stringPath <span class="token operator">=</span> strings<span class="token punctuation">.</span><span class="token function">TrimRight</span><span class="token punctuation">(</span>stringPath<span class="token punctuation">,</span> <span class="token string">".flv"</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">if</span> <span class="token boolean">_</span><span class="token punctuation">,</span> ok <span class="token operator">:=</span> AllRoom<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span>stringPath<span class="token punctuation">)</span><span class="token punctuation">;</span> ok <span class="token punctuation">{</span>
|
||||
<span class="token comment">//atomic.AddInt32(&hdlId, 1)</span>
|
||||
w<span class="token punctuation">.</span><span class="token function">Header</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Set</span><span class="token punctuation">(</span><span class="token string">"Transfer-Encoding"</span><span class="token punctuation">,</span> <span class="token string">"chunked"</span><span class="token punctuation">)</span>
|
||||
w<span class="token punctuation">.</span><span class="token function">Header</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Set</span><span class="token punctuation">(</span><span class="token string">"Content-Type"</span><span class="token punctuation">,</span> <span class="token string">"video/x-flv"</span><span class="token punctuation">)</span>
|
||||
w<span class="token punctuation">.</span><span class="token function">Write</span><span class="token punctuation">(</span>avformat<span class="token punctuation">.</span>FLVHeader<span class="token punctuation">)</span>
|
||||
p <span class="token operator">:=</span> OutputStream<span class="token punctuation">{</span>
|
||||
Sign<span class="token punctuation">:</span> sign<span class="token punctuation">,</span>
|
||||
SendHandler<span class="token punctuation">:</span> <span class="token keyword">func</span><span class="token punctuation">(</span>packet <span class="token operator">*</span>pool<span class="token punctuation">.</span>SendPacket<span class="token punctuation">)</span> <span class="token builtin">error</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span> avformat<span class="token punctuation">.</span><span class="token function">WriteFLVTag</span><span class="token punctuation">(</span>w<span class="token punctuation">,</span> packet<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
SubscriberInfo<span class="token punctuation">:</span> SubscriberInfo<span class="token punctuation">{</span>
|
||||
ID<span class="token punctuation">:</span> r<span class="token punctuation">.</span>RemoteAddr<span class="token punctuation">,</span> Type<span class="token punctuation">:</span> <span class="token string">"FLV"</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">Play</span><span class="token punctuation">(</span>stringPath<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
|
||||
w<span class="token punctuation">.</span><span class="token function">WriteHeader</span><span class="token punctuation">(</span><span class="token number">404</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre></div><p>其中,核心逻辑就是创建OutputStream对象,每一个订阅者需要提供SendHandler函数,用来接收来自发布者广播出来的音视频数据。
|
||||
最后调用该对象的Play函数进行播放。请注意:Play函数会阻塞当前goroutine。</p><h2 id="开发发布者插件"><a href="#开发发布者插件" aria-hidden="true" class="header-anchor">#</a> 开发发布者插件</h2><p>所谓发布者,就是提供音视频数据的程序,例如接收来自OBS、ffmpeg的推流的程序。内置插件中,集群功能里面有一个特殊的发布者,它接收来自源服务器的音视频数据,然后在本服务器中广播音视频。
|
||||
以此为例,我们需要提供一个结构体定义来表示特定的发布者:</p><div class="language-go extra-class"><pre class="language-go"><code><span class="token keyword">type</span> Receiver <span class="token keyword">struct</span> <span class="token punctuation">{</span>
|
||||
InputStream
|
||||
io<span class="token punctuation">.</span>Reader
|
||||
<span class="token operator">*</span>bufio<span class="token punctuation">.</span>Writer
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre></div><p>其中InputStream 是固定的,必须包含,且必须以组合继承的方式定义。其余的成员则是任意的。
|
||||
发布者的发布动作需要特定条件的触发,例如在集群插件中,当本服务器有订阅者订阅了某个流,而该流并没有发布者的时候就会触发向源服务器拉流的函数:</p><div class="language-go extra-class"><pre class="language-go"><code><span class="token keyword">func</span> <span class="token function">PullUpStream</span><span class="token punctuation">(</span>streamPath <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
addr<span class="token punctuation">,</span> err <span class="token operator">:=</span> net<span class="token punctuation">.</span><span class="token function">ResolveTCPAddr</span><span class="token punctuation">(</span><span class="token string">"tcp"</span><span class="token punctuation">,</span> config<span class="token punctuation">.</span>Master<span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> <span class="token function">MayBeError</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
conn<span class="token punctuation">,</span> err <span class="token operator">:=</span> net<span class="token punctuation">.</span><span class="token function">DialTCP</span><span class="token punctuation">(</span><span class="token string">"tcp"</span><span class="token punctuation">,</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> addr<span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> <span class="token function">MayBeError</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
brw <span class="token operator">:=</span> bufio<span class="token punctuation">.</span><span class="token function">NewReadWriter</span><span class="token punctuation">(</span>bufio<span class="token punctuation">.</span><span class="token function">NewReader</span><span class="token punctuation">(</span>conn<span class="token punctuation">)</span><span class="token punctuation">,</span> bufio<span class="token punctuation">.</span><span class="token function">NewWriter</span><span class="token punctuation">(</span>conn<span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||||
p <span class="token operator">:=</span> <span class="token operator">&</span>Receiver<span class="token punctuation">{</span>
|
||||
Reader<span class="token punctuation">:</span> conn<span class="token punctuation">,</span>
|
||||
Writer<span class="token punctuation">:</span> brw<span class="token punctuation">.</span>Writer<span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">if</span> p<span class="token punctuation">.</span><span class="token function">Publish</span><span class="token punctuation">(</span>streamPath<span class="token punctuation">,</span> p<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">WriteByte</span><span class="token punctuation">(</span>MSG_SUBSCRIBE<span class="token punctuation">)</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">WriteString</span><span class="token punctuation">(</span>streamPath<span class="token punctuation">)</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">WriteByte</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">Flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">for</span> <span class="token boolean">_</span><span class="token punctuation">,</span> v <span class="token operator">:=</span> <span class="token keyword">range</span> p<span class="token punctuation">.</span>Subscribers <span class="token punctuation">{</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">Auth</span><span class="token punctuation">(</span>v<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">defer</span> p<span class="token punctuation">.</span><span class="token function">Cancel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">for</span> <span class="token punctuation">{</span>
|
||||
cmd<span class="token punctuation">,</span> err <span class="token operator">:=</span> brw<span class="token punctuation">.</span><span class="token function">ReadByte</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> <span class="token function">MayBeError</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">switch</span> cmd <span class="token punctuation">{</span>
|
||||
<span class="token keyword">case</span> MSG_AUDIO<span class="token punctuation">:</span>
|
||||
<span class="token keyword">if</span> audio<span class="token punctuation">,</span> err <span class="token operator">:=</span> p<span class="token punctuation">.</span><span class="token function">readAVPacket</span><span class="token punctuation">(</span>avformat<span class="token punctuation">.</span>FLV_TAG_TYPE_AUDIO<span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">==</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">PushAudio</span><span class="token punctuation">(</span>audio<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">case</span> MSG_VIDEO<span class="token punctuation">:</span>
|
||||
<span class="token keyword">if</span> video<span class="token punctuation">,</span> err <span class="token operator">:=</span> p<span class="token punctuation">.</span><span class="token function">readAVPacket</span><span class="token punctuation">(</span>avformat<span class="token punctuation">.</span>FLV_TAG_TYPE_VIDEO<span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">==</span> <span class="token boolean">nil</span> <span class="token operator">&&</span> <span class="token function">len</span><span class="token punctuation">(</span>video<span class="token punctuation">.</span>Payload<span class="token punctuation">)</span> <span class="token operator">></span> <span class="token number">2</span> <span class="token punctuation">{</span>
|
||||
tmp <span class="token operator">:=</span> video<span class="token punctuation">.</span>Payload<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token comment">// 第一个字节保存着视频的相关信息.</span>
|
||||
video<span class="token punctuation">.</span>VideoFrameType <span class="token operator">=</span> tmp <span class="token operator">>></span> <span class="token number">4</span> <span class="token comment">// 帧类型 4Bit, H264一般为1或者2</span>
|
||||
p<span class="token punctuation">.</span><span class="token function">PushVideo</span><span class="token punctuation">(</span>video<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">case</span> MSG_AUTH<span class="token punctuation">:</span>
|
||||
cmd<span class="token punctuation">,</span> err <span class="token operator">=</span> brw<span class="token punctuation">.</span><span class="token function">ReadByte</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> <span class="token function">MayBeError</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
bytes<span class="token punctuation">,</span> err <span class="token operator">:=</span> brw<span class="token punctuation">.</span><span class="token function">ReadBytes</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> <span class="token function">MayBeError</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
subId <span class="token operator">:=</span> strings<span class="token punctuation">.</span><span class="token function">Split</span><span class="token punctuation">(</span><span class="token function">string</span><span class="token punctuation">(</span>bytes<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">:</span><span class="token function">len</span><span class="token punctuation">(</span>bytes<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token string">","</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
|
||||
<span class="token keyword">if</span> v<span class="token punctuation">,</span> ok <span class="token operator">:=</span> p<span class="token punctuation">.</span>Subscribers<span class="token punctuation">[</span>subId<span class="token punctuation">]</span><span class="token punctuation">;</span> ok <span class="token punctuation">{</span>
|
||||
<span class="token keyword">if</span> cmd <span class="token operator">!=</span> <span class="token number">1</span> <span class="token punctuation">{</span>
|
||||
v<span class="token punctuation">.</span><span class="token function">Cancel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
</code></pre></div><p>正在该函数中会向源服务器建立tcp连接,然后发送特定命令表示需要拉流,当我们接收到源服务器的数据的时候,就调用PushVideo和PushAudio函数来广播音视频。</p><p>核心逻辑是调用InputStream的Publish以及PushVideo、PushAudio函数</p><h2 id="开发钩子插件"><a href="#开发钩子插件" aria-hidden="true" class="header-anchor">#</a> 开发钩子插件</h2></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/" class="prev router-link-active">
|
||||
起步
|
||||
</a></span><span class="next"><a href="/docs/history.html">
|
||||
更新日志
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script><script src="/docs/assets/js/2.142d04d2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
26
dashboard/dist/docs/history.html
vendored
@@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>更新历史 | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="preload" href="/docs/assets/js/3.2b6c987b.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.83ce04b6.js"><link rel="prefetch" href="/docs/assets/js/2.142d04d2.js"><link rel="prefetch" href="/docs/assets/js/4.ad90d74a.js"><link rel="prefetch" href="/docs/assets/js/5.36121818.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">起步</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="active sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="更新历史"><a href="#更新历史" aria-hidden="true" class="header-anchor">#</a> 更新历史</h1><ul><li>2020/1/27
|
||||
1.0完成</li></ul></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/develop.html" class="prev">
|
||||
插件开发
|
||||
</a></span><span class="next"><a href="/docs/plugins/jessica.html">
|
||||
Jessica
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script><script src="/docs/assets/js/3.2b6c987b.js" defer></script>
|
||||
</body>
|
||||
</html>
|
54
dashboard/dist/docs/index.html
vendored
@@ -1,54 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca快速起步 | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="preload" href="/docs/assets/js/1.83ce04b6.js" as="script"><link rel="prefetch" href="/docs/assets/js/2.142d04d2.js"><link rel="prefetch" href="/docs/assets/js/3.2b6c987b.js"><link rel="prefetch" href="/docs/assets/js/4.ad90d74a.js"><link rel="prefetch" href="/docs/assets/js/5.36121818.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-exact-active router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="active sidebar-link">起步</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/#介绍" class="sidebar-link">介绍</a></li><li class="sidebar-sub-header"><a href="/docs/#启动" class="sidebar-link">启动</a></li><li class="sidebar-sub-header"><a href="/docs/#配置" class="sidebar-link">配置</a></li></ul></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="monibuca快速起步"><a href="#monibuca快速起步" aria-hidden="true" class="header-anchor">#</a> Monibuca快速起步</h1><h2 id="介绍"><a href="#介绍" aria-hidden="true" class="header-anchor">#</a> 介绍</h2><p>Monibuca 是一个开源的流媒体服务器开发框架,适用于快速定制化开发流媒体服务器,可以对接CDN厂商,作为回源服务器,也可以自己搭建集群部署环境。
|
||||
丰富的内置插件提供了流媒体服务器的常见功能,例如rtmp server、http-flv、视频录制、QoS等。除此以外还内置了后台web界面,方便观察服务器运行的状态。
|
||||
也可以自己开发后台管理界面,通过api方式获取服务器的运行信息。
|
||||
Monibuca 提供了可供定制化开发的插件机制,可以任意扩展其功能。</p><h2 id="启动"><a href="#启动" aria-hidden="true" class="header-anchor">#</a> 启动</h2><p>启用所有内置插件</p><div class="language-go extra-class"><pre class="language-go"><code><span class="token keyword">package</span> main
|
||||
|
||||
<span class="token keyword">import</span> <span class="token punctuation">(</span>
|
||||
<span class="token punctuation">.</span> <span class="token string">"github.com/langhuihui/monibuca/monica"</span>
|
||||
<span class="token boolean">_</span> <span class="token string">"github.com/langhuihui/monibuca/plugins"</span>
|
||||
<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token function">Run</span><span class="token punctuation">(</span><span class="token string">"config.toml"</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">select</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre></div><h2 id="配置"><a href="#配置" aria-hidden="true" class="header-anchor">#</a> 配置</h2><p>要使用<code>Monibuca</code>,需要编写一个<code>toml</code>格式的配置文件,通常可以放在程序的同级目录下例如:<code>config.toml</code>(名称不是必须为<code>config</code>)</p><p>该配置文件主要是为了定制各个插件的配置,例如监听端口号等,具体还是要看各个插件的设计。</p><blockquote><p>如果你编写了自己的插件,就必须在该配置文件中写入对自己插件的配置信息</p></blockquote><p>如果注释掉部分插件的配置,那么该插件就不会启用,典型的配置如下:</p><div class="language-toml extra-class"><pre class="language-toml"><code><span class="token punctuation">[</span><span class="token table class-name">Plugins.HDL</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">ListenAddr</span> <span class="token punctuation">=</span> <span class="token string">":2020"</span>
|
||||
<span class="token punctuation">[</span><span class="token table class-name">Plugins.Jessica</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">ListenAddr</span> <span class="token punctuation">=</span> <span class="token string">":8080"</span>
|
||||
<span class="token punctuation">[</span><span class="token table class-name">Plugins.RTMP</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">ListenAddr</span> <span class="token punctuation">=</span> <span class="token string">":1935"</span>
|
||||
<span class="token punctuation">[</span><span class="token table class-name">Plugins.GateWay</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">ListenAddr</span> <span class="token punctuation">=</span> <span class="token string">":81"</span>
|
||||
<span class="token comment">#[Plugins.Cluster]</span>
|
||||
<span class="token comment">#Master = "localhost:2019"</span>
|
||||
<span class="token comment">#ListenAddr = ":2019"</span>
|
||||
<span class="token comment">#</span>
|
||||
<span class="token comment">#[Plugins.Auth]</span>
|
||||
<span class="token comment">#Key="www.monibuca.com"</span>
|
||||
<span class="token comment">#[Plugins.RecordFlv]</span>
|
||||
<span class="token comment">#Path="./resouce"</span>
|
||||
<span class="token punctuation">[</span><span class="token table class-name">Plugins.QoS</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">Suffix</span> <span class="token punctuation">=</span> <span class="token punctuation">[</span><span class="token string">"high"</span><span class="token punctuation">,</span><span class="token string">"medium"</span><span class="token punctuation">,</span><span class="token string">"low"</span><span class="token punctuation">]</span>
|
||||
</code></pre></div><p>具体配置的含义,可以参考每个插件的说明</p></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><!----><span class="next"><a href="/docs/develop.html">
|
||||
插件开发
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script><script src="/docs/assets/js/1.83ce04b6.js" defer></script>
|
||||
</body>
|
||||
</html>
|
19
dashboard/dist/docs/plugins/index.html
vendored
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="preload" href="/docs/assets/js/4.ad90d74a.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.83ce04b6.js"><link rel="prefetch" href="/docs/assets/js/2.142d04d2.js"><link rel="prefetch" href="/docs/assets/js/3.2b6c987b.js"><link rel="prefetch" href="/docs/assets/js/5.36121818.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">起步</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"></div><div class="page-edit"><!----><!----></div><!----></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script><script src="/docs/assets/js/4.ad90d74a.js" defer></script>
|
||||
</body>
|
||||
</html>
|
26
dashboard/dist/docs/plugins/jessica.html
vendored
@@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Jessica | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.ad3166d6.css" as="style"><link rel="preload" href="/docs/assets/js/app.ad3166d6.js" as="script"><link rel="preload" href="/docs/assets/js/5.36121818.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.83ce04b6.js"><link rel="prefetch" href="/docs/assets/js/2.142d04d2.js"><link rel="prefetch" href="/docs/assets/js/3.2b6c987b.js"><link rel="prefetch" href="/docs/assets/js/4.ad90d74a.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.ad3166d6.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">起步</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading open"><span>内置插件</span><span class="arrow down"></span></p><ul class="sidebar-group-items"><li><a href="/docs/plugins/jessica.html" class="active sidebar-link">Jessica</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/plugins/jessica.html#配置" class="sidebar-link">配置</a></li></ul></li></ul></div></li></ul></div><div class="page"><div class="content"><h1 id="jessica"><a href="#jessica" aria-hidden="true" class="header-anchor">#</a> Jessica</h1><p>该插件为基于WebSocket协议传输音视频的订阅者,音视频数据以裸数据的形式进行传输,我们需要Jessibuca播放器来进行播放
|
||||
Jessibua播放器已内置于源码中,该播放器通过js解码H264并用canvas进行渲染,可以运行在几乎所有的终端浏览器上面。
|
||||
在Monibuca的Web界面中预览功能就是使用的Jessibuca播放器。</p><h2 id="配置"><a href="#配置" aria-hidden="true" class="header-anchor">#</a> 配置</h2><p>目前仅有的配置是监听的端口号</p><div class="language-toml extra-class"><pre class="language-toml"><code><span class="token punctuation">[</span><span class="token table class-name">Plugins.Jessica</span><span class="token punctuation">]</span>
|
||||
<span class="token key property">ListenAddr</span> <span class="token punctuation">=</span> <span class="token string">":8080"</span>
|
||||
</code></pre></div></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/history.html" class="prev">
|
||||
更新日志
|
||||
</a></span><!----></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.ad3166d6.js" defer></script><script src="/docs/assets/js/5.36121818.js" defer></script>
|
||||
</body>
|
||||
</html>
|
80
dashboard/dist/docs/service-worker.js
vendored
@@ -1,80 +0,0 @@
|
||||
/**
|
||||
* Welcome to your Workbox-powered service worker!
|
||||
*
|
||||
* You'll need to register this file in your web app and you should
|
||||
* disable HTTP caching for this file too.
|
||||
* See https://goo.gl/nhQhGp
|
||||
*
|
||||
* The rest of the code is auto-generated. Please don't update this file
|
||||
* directly; instead, make changes to your Workbox build configuration
|
||||
* and re-run your build process.
|
||||
* See https://goo.gl/2aRDsh
|
||||
*/
|
||||
|
||||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
|
||||
|
||||
/**
|
||||
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
|
||||
* requests for URLs in the manifest.
|
||||
* See https://goo.gl/S9QRab
|
||||
*/
|
||||
self.__precacheManifest = [
|
||||
{
|
||||
"url": "404.html",
|
||||
"revision": "a3d9e915fd09958cab2da343fcad58b0"
|
||||
},
|
||||
{
|
||||
"url": "assets/css/styles.ad3166d6.css",
|
||||
"revision": "4a6b650244e5b709f84a81ad0565b485"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/search.83621669.svg",
|
||||
"revision": "83621669651b9a3d4bf64d1a670ad856"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/1.83ce04b6.js",
|
||||
"revision": "3cabebb5c79c8280aee24ac6e4545650"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/2.142d04d2.js",
|
||||
"revision": "027f4f643a10a465692035fe692cd94f"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/3.2b6c987b.js",
|
||||
"revision": "27a988ab518e3f04db65045269d55841"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/4.ad90d74a.js",
|
||||
"revision": "dcbfc54b67e9e6e33dbb2a303e842bdc"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/5.36121818.js",
|
||||
"revision": "550520f0f388530dfbc4cc40a3dee264"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/app.ad3166d6.js",
|
||||
"revision": "fdeb68e4b7b08c2c7bdcaf7462f34b16"
|
||||
},
|
||||
{
|
||||
"url": "develop.html",
|
||||
"revision": "f7461297bdc3ce303d517f0fc6dedd78"
|
||||
},
|
||||
{
|
||||
"url": "history.html",
|
||||
"revision": "c4ba2b13246f7a9e0039852fe381de6e"
|
||||
},
|
||||
{
|
||||
"url": "index.html",
|
||||
"revision": "3371a6066d0c2229a521d0659f25b174"
|
||||
},
|
||||
{
|
||||
"url": "plugins/index.html",
|
||||
"revision": "511b5cef98368f5f0ab35e667766e367"
|
||||
},
|
||||
{
|
||||
"url": "plugins/jessica.html",
|
||||
"revision": "65ca2965d5d514441d64b4d5e38cd696"
|
||||
}
|
||||
].concat(self.__precacheManifest || []);
|
||||
workbox.precaching.suppressWarnings();
|
||||
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
|
BIN
dashboard/dist/favicon.ico
vendored
Before Width: | Height: | Size: 21 KiB |
BIN
dashboard/dist/fonts/ionicons.143146fa.woff2
vendored
BIN
dashboard/dist/fonts/ionicons.99ac3308.woff
vendored
BIN
dashboard/dist/fonts/ionicons.d535a25a.ttf
vendored
BIN
dashboard/dist/img/alipay.e872ea78.png
vendored
Before Width: | Height: | Size: 38 KiB |
870
dashboard/dist/img/ionicons.a2c4a261.svg
vendored
Before Width: | Height: | Size: 542 KiB |
BIN
dashboard/dist/img/logo.b5357057.png
vendored
Before Width: | Height: | Size: 4.8 KiB |
BIN
dashboard/dist/img/wechat.ff453262.jpg
vendored
Before Width: | Height: | Size: 102 KiB |
1
dashboard/dist/index.html
vendored
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Monibuca</title><script src=jessibuca/ajax.js></script><script src=jessibuca/renderer.js></script><link href=/css/app.b4fc79e8.css rel=preload as=style><link href=/css/chunk-vendors.22ebf426.css rel=preload as=style><link href=/js/app.9cc902b4.js rel=preload as=script><link href=/js/chunk-vendors.ae8ac63d.js rel=preload as=script><link href=/css/chunk-vendors.22ebf426.css rel=stylesheet><link href=/css/app.b4fc79e8.css rel=stylesheet></head><body><noscript><strong>We're sorry but dashboard doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ae8ac63d.js></script><script src=/js/app.9cc902b4.js></script></body></html>
|
535
dashboard/dist/jessibuca/ajax.js
vendored
@@ -1,535 +0,0 @@
|
||||
// a simple ajax
|
||||
!(function () {
|
||||
|
||||
var jsonType = 'application/json';
|
||||
var htmlType = 'text/html';
|
||||
var xmlTypeRE = /^(?:text|application)\/xml/i;
|
||||
var blankRE = /^\s*$/; // \s
|
||||
|
||||
/*
|
||||
* default setting
|
||||
* */
|
||||
var _settings = {
|
||||
|
||||
type: "GET",
|
||||
|
||||
beforeSend: noop,
|
||||
|
||||
success: noop,
|
||||
|
||||
error: noop,
|
||||
|
||||
complete: noop,
|
||||
|
||||
context: null,
|
||||
|
||||
xhr: function () {
|
||||
return new window.XMLHttpRequest();
|
||||
},
|
||||
|
||||
accepts: {
|
||||
json: jsonType,
|
||||
xml: 'application/xml, text/xml',
|
||||
html: htmlType,
|
||||
text: 'text/plain'
|
||||
},
|
||||
|
||||
crossDomain: false,
|
||||
|
||||
timeout: 0,
|
||||
|
||||
username: null,
|
||||
|
||||
password: null,
|
||||
|
||||
processData: true,
|
||||
|
||||
promise: noop
|
||||
};
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
var ajax = function (options) {
|
||||
|
||||
//
|
||||
var settings = extend({}, options || {});
|
||||
|
||||
//
|
||||
for (var key in _settings) {
|
||||
if (settings[key] === undefined) {
|
||||
settings[key] = _settings[key];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
try {
|
||||
var q = {};
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
q.resolve = resolve;
|
||||
q.reject = reject;
|
||||
});
|
||||
|
||||
promise.resolve = q.resolve;
|
||||
promise.reject = q.reject;
|
||||
|
||||
settings.promise = promise;
|
||||
}
|
||||
catch (e) {
|
||||
//
|
||||
settings.promise = {
|
||||
resolve: noop,
|
||||
reject: noop
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
if (!settings.crossDomain) {
|
||||
settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && RegExp.$2 !== window.location.href;
|
||||
}
|
||||
|
||||
var dataType = settings.dataType;
|
||||
// jsonp
|
||||
if (dataType === 'jsonp') {
|
||||
//
|
||||
var hasPlaceholder = /=\?/.test(settings.url);
|
||||
if (!hasPlaceholder) {
|
||||
var jsonpCallback = (settings.jsonp || 'callback') + '=?';
|
||||
|
||||
settings.url = appendQuery(settings.url, jsonpCallback)
|
||||
}
|
||||
return JSONP(settings);
|
||||
}
|
||||
|
||||
// url
|
||||
if (!settings.url) {
|
||||
settings.url = window.location.toString();
|
||||
}
|
||||
|
||||
//
|
||||
serializeData(settings);
|
||||
|
||||
var mime = settings.accepts[dataType]; // mime
|
||||
var baseHeader = {}; // header
|
||||
var protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol; // protocol
|
||||
var xhr = _settings.xhr();
|
||||
var abortTimeout;
|
||||
|
||||
// X-Requested-With header
|
||||
// For cross-domain requests, seeing as conditions for a preflight are
|
||||
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
||||
// (it can always be set on a per-request basis or even using ajaxSetup)
|
||||
// For same-domain requests, won't change header if already provided.
|
||||
if (!settings.crossDomain && !baseHeader['X-Requested-With']) {
|
||||
baseHeader['X-Requested-With'] = 'XMLHttpRequest';
|
||||
}
|
||||
|
||||
// mime
|
||||
if (mime) {
|
||||
//
|
||||
baseHeader['Accept'] = mime;
|
||||
|
||||
if (mime.indexOf(',') > -1) {
|
||||
mime = mime.split(',', 2)[0]
|
||||
}
|
||||
//
|
||||
xhr.overrideMimeType && xhr.overrideMimeType(mime);
|
||||
}
|
||||
|
||||
// contentType
|
||||
if (settings.contentType || (settings.data && settings.type.toUpperCase() !== 'GET')) {
|
||||
baseHeader['Content-Type'] = (settings.contentType || 'application/x-www-form-urlencoded; charset=UTF-8');
|
||||
}
|
||||
|
||||
// headers
|
||||
settings.headers = extend(baseHeader, settings.headers || {});
|
||||
|
||||
// on ready state change
|
||||
xhr.onreadystatechange = function () {
|
||||
// readystate
|
||||
if (xhr.readyState === 4) {
|
||||
clearTimeout(abortTimeout);
|
||||
var result;
|
||||
var error = false;
|
||||
//
|
||||
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) {
|
||||
dataType = dataType || mimeToDataType(xhr.getResponseHeader('content-type'));
|
||||
result = xhr.responseText;
|
||||
|
||||
try {
|
||||
// xml
|
||||
if (dataType === 'xml') {
|
||||
result = xhr.responseXML;
|
||||
}
|
||||
// json
|
||||
else if (dataType === 'json') {
|
||||
result = blankRE.test(result) ? null : JSON.parse(result);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
ajaxError(error, 'parseerror', xhr, settings);
|
||||
}
|
||||
else {
|
||||
ajaxSuccess(result, xhr, settings);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ajaxError(null, 'error', xhr, settings);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// async
|
||||
var async = 'async' in settings ? settings.async : true;
|
||||
|
||||
// open
|
||||
xhr.open(settings.type, settings.url, async, settings.username, settings.password);
|
||||
|
||||
// xhrFields
|
||||
if (settings.xhrFields) {
|
||||
for (var name in settings.xhrFields) {
|
||||
xhr[name] = settings.xhrFields[name];
|
||||
}
|
||||
}
|
||||
|
||||
// Override mime type if needed
|
||||
if (settings.mimeType && xhr.overrideMimeType) {
|
||||
xhr.overrideMimeType(settings.mimeType);
|
||||
}
|
||||
|
||||
|
||||
// set request header
|
||||
for (var name in settings.headers) {
|
||||
// Support: IE<9
|
||||
// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
|
||||
// request header to a null-value.
|
||||
//
|
||||
// To keep consistent with other XHR implementations, cast the value
|
||||
// to string and ignore `undefined`.
|
||||
if (settings.headers[name] !== undefined) {
|
||||
xhr.setRequestHeader(name, settings.headers[name] + "");
|
||||
}
|
||||
}
|
||||
|
||||
// before send
|
||||
if (ajaxBeforeSend(xhr, settings) === false) {
|
||||
xhr.abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
// timeout
|
||||
if (settings.timeout > 0) {
|
||||
abortTimeout = window.setTimeout(function () {
|
||||
xhr.onreadystatechange = noop;
|
||||
xhr.abort();
|
||||
ajaxError(null, 'timeout', xhr, settings);
|
||||
}, settings.timeout);
|
||||
}
|
||||
|
||||
// send
|
||||
xhr.send(settings.data ? settings.data : null);
|
||||
|
||||
return settings.promise;
|
||||
};
|
||||
|
||||
/*
|
||||
* method get
|
||||
* */
|
||||
ajax.get = function (url, data, success, dataType) {
|
||||
if (isFunction(data)) {
|
||||
dataType = dataType || success;
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
return ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: dataType
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* method post
|
||||
*
|
||||
* dataType:
|
||||
* */
|
||||
ajax.post = function (url, data, success, dataType) {
|
||||
if (isFunction(data)) {
|
||||
dataType = dataType || success;
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
return ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: dataType
|
||||
})
|
||||
};
|
||||
|
||||
/*
|
||||
* method getJSON
|
||||
* */
|
||||
ajax.getJSON = function (url, data, success) {
|
||||
|
||||
if (isFunction(data)) {
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
return ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: 'json'
|
||||
})
|
||||
};
|
||||
|
||||
/*
|
||||
* method ajaxSetup
|
||||
* */
|
||||
ajax.ajaxSetup = function (target, settings) {
|
||||
return settings ? extend(extend(target, _settings), settings) : extend(_settings, target);
|
||||
};
|
||||
|
||||
/*
|
||||
* utils
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
// triggers and extra global event ajaxBeforeSend that's like ajaxSend but cancelable
|
||||
function ajaxBeforeSend(xhr, settings) {
|
||||
var context = settings.context;
|
||||
//
|
||||
if (settings.beforeSend.call(context, xhr, settings) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ajax success
|
||||
function ajaxSuccess(data, xhr, settings) {
|
||||
var context = settings.context;
|
||||
var status = 'success';
|
||||
settings.success.call(context, data, status, xhr);
|
||||
settings.promise.resolve(data, status, xhr);
|
||||
ajaxComplete(status, xhr, settings);
|
||||
}
|
||||
|
||||
// status: "success", "notmodified", "error", "timeout", "abort", "parsererror"
|
||||
function ajaxComplete(status, xhr, settings) {
|
||||
var context = settings.context;
|
||||
settings.complete.call(context, xhr, status);
|
||||
}
|
||||
|
||||
// type: "timeout", "error", "abort", "parsererror"
|
||||
function ajaxError(error, type, xhr, settings) {
|
||||
var context = settings.context;
|
||||
settings.error.call(context, xhr, type, error);
|
||||
settings.promise.reject(xhr, type, error);
|
||||
ajaxComplete(type, xhr, settings);
|
||||
}
|
||||
|
||||
|
||||
// jsonp
|
||||
/*
|
||||
* tks: https://www.cnblogs.com/rubylouvre/archive/2011/02/13/1953087.html
|
||||
* */
|
||||
function JSONP(options) {
|
||||
//
|
||||
var callbackName = options.jsonpCallback || 'jsonp' + (new Date().getTime());
|
||||
|
||||
var script = window.document.createElement('script');
|
||||
|
||||
var abort = function () {
|
||||
// 设置 window.xxx = noop
|
||||
if (callbackName in window) {
|
||||
window[callbackName] = noop;
|
||||
}
|
||||
};
|
||||
|
||||
var xhr = {abort: abort};
|
||||
var abortTimeout;
|
||||
|
||||
var head = window.document.getElementsByTagName('head')[0] || window.document.documentElement;
|
||||
|
||||
// ie8+
|
||||
script.onerror = function (error) {
|
||||
_error(error);
|
||||
};
|
||||
|
||||
function _error(error) {
|
||||
window.clearTimeout(abortTimeout);
|
||||
xhr.abort();
|
||||
ajaxError(error.type, xhr, error.type, options);
|
||||
_removeScript();
|
||||
}
|
||||
|
||||
window[callbackName] = function (data) {
|
||||
window.clearTimeout(abortTimeout);
|
||||
ajaxSuccess(data, xhr, options);
|
||||
_removeScript();
|
||||
};
|
||||
|
||||
//
|
||||
serializeData(options);
|
||||
|
||||
script.src = options.url.replace(/=\?/, '=' + callbackName);
|
||||
//
|
||||
script.src = appendQuery(script.src, '_=' + (new Date()).getTime());
|
||||
//
|
||||
script.async = true;
|
||||
|
||||
// script charset
|
||||
if (options.scriptCharset) {
|
||||
script.charset = options.scriptCharset;
|
||||
}
|
||||
|
||||
//
|
||||
head.insertBefore(script, head.firstChild);
|
||||
|
||||
//
|
||||
if (options.timeout > 0) {
|
||||
abortTimeout = window.setTimeout(function () {
|
||||
xhr.abort();
|
||||
ajaxError('timeout', xhr, 'timeout', options);
|
||||
_removeScript();
|
||||
}, options.timeout);
|
||||
}
|
||||
|
||||
// remove script
|
||||
function _removeScript() {
|
||||
if (script.clearAttributes) {
|
||||
script.clearAttributes();
|
||||
} else {
|
||||
script.onload = script.onreadystatechange = script.onerror = null;
|
||||
}
|
||||
|
||||
if (script.parentNode) {
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
//
|
||||
script = null;
|
||||
|
||||
delete window[callbackName];
|
||||
}
|
||||
|
||||
return options.promise;
|
||||
}
|
||||
|
||||
// mime to data type
|
||||
function mimeToDataType(mime) {
|
||||
return mime && (mime === htmlType ? 'html' : mime === jsonType ? 'json' : xmlTypeRE.test(mime) && 'xml') || 'text'
|
||||
}
|
||||
|
||||
// append query
|
||||
function appendQuery(url, query) {
|
||||
return (url + '&' + query).replace(/[&?]{1,2}/, '?');
|
||||
}
|
||||
|
||||
// serialize data
|
||||
function serializeData(options) {
|
||||
// formData
|
||||
if (isObject(options) && !isFormData(options.data) && options.processData) {
|
||||
options.data = param(options.data);
|
||||
}
|
||||
|
||||
if (options.data && (!options.type || options.type.toUpperCase() === 'GET')) {
|
||||
options.url = appendQuery(options.url, options.data);
|
||||
}
|
||||
}
|
||||
|
||||
// serialize
|
||||
function serialize(params, obj, traditional, scope) {
|
||||
var _isArray = isArray(obj);
|
||||
|
||||
for (var key in obj) {
|
||||
var value = obj[key];
|
||||
|
||||
if (scope) {
|
||||
key = traditional ? scope : scope + '[' + (_isArray ? '' : key) + ']';
|
||||
}
|
||||
|
||||
// handle data in serializeArray format
|
||||
if (!scope && _isArray) {
|
||||
params.add(value.name, value.value);
|
||||
|
||||
}
|
||||
else if (traditional ? _isArray(value) : isObject(value)) {
|
||||
serialize(params, value, traditional, key);
|
||||
}
|
||||
else {
|
||||
params.add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// param
|
||||
function param(obj, traditional) {
|
||||
var params = [];
|
||||
//
|
||||
params.add = function (k, v) {
|
||||
this.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));
|
||||
};
|
||||
serialize(params, obj, traditional);
|
||||
return params.join('&').replace('%20', '+');
|
||||
}
|
||||
|
||||
// extend
|
||||
function extend(target) {
|
||||
var slice = Array.prototype.slice;
|
||||
var args = slice.call(arguments, 1);
|
||||
//
|
||||
for (var i = 0, length = args.length; i < length; i++) {
|
||||
var source = args[i] || {};
|
||||
for (var key in source) {
|
||||
if (source.hasOwnProperty(key) && source[key] !== undefined) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
// is object
|
||||
function isObject(obj) {
|
||||
var type = typeof obj;
|
||||
return type === 'function' || type === 'object' && !!obj;
|
||||
}
|
||||
|
||||
// is formData
|
||||
function isFormData(obj) {
|
||||
return obj instanceof FormData;
|
||||
}
|
||||
|
||||
// is array
|
||||
function isArray(value) {
|
||||
return Object.prototype.toString.call(value) === "[object Array]";
|
||||
}
|
||||
|
||||
// is function
|
||||
function isFunction(value) {
|
||||
return typeof value === "function";
|
||||
}
|
||||
|
||||
// browser
|
||||
window.ajax = ajax;
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
25
dashboard/dist/jessibuca/ff.js
vendored
460
dashboard/dist/jessibuca/renderer.js
vendored
@@ -1,460 +0,0 @@
|
||||
function Jessibuca(opt) {
|
||||
this.canvasElement = opt.canvas;
|
||||
this.contextOptions = opt.contextOptions;
|
||||
this.videoBuffer = opt.videoBuffer || 1
|
||||
if (!opt.forceNoGL) this.initContextGL();
|
||||
|
||||
if (this.contextGL) {
|
||||
this.initProgram();
|
||||
this.initBuffers();
|
||||
this.initTextures();
|
||||
};
|
||||
this.decoderWorker = new Worker(opt.decoder || '264_mp3.js')
|
||||
var _this = this
|
||||
function draw(output) {
|
||||
_this.drawNextOutputPicture(_this.width, _this.height, null, output)
|
||||
postMessage({ cmd: "setBuffer", buffer: output }, '*', [output[0].buffer, output[1].buffer, output[2].buffer])
|
||||
}
|
||||
this.decoderWorker.onmessage = function (event) {
|
||||
var msg = event.data
|
||||
switch (msg.cmd) {
|
||||
case "init":
|
||||
console.log("decoder worker init")
|
||||
postMessage({ cmd: "setVideoBuffer", time: _this.videoBuffer }, "*")
|
||||
if (_this.onLoad) {
|
||||
_this.onLoad()
|
||||
delete _this.onLoad;
|
||||
}
|
||||
break
|
||||
case "initSize":
|
||||
_this.width = msg.w
|
||||
_this.height = msg.h
|
||||
if (_this.isWebGL()) {
|
||||
// var buffer = new ArrayBuffer(msg.w * msg.h + (msg.w * msg.h >> 1))
|
||||
// this.postMessage({ cmd: "setBuffer", buffer: buffer }, [buffer])
|
||||
}
|
||||
else {
|
||||
_this.initRGB(msg.w, msg.h)
|
||||
}
|
||||
break
|
||||
case "render":
|
||||
if (_this.onPlay) {
|
||||
_this.onPlay()
|
||||
delete _this.onPlay;
|
||||
}
|
||||
// if (msg.compositionTime) {
|
||||
// console.log(msg.compositionTime)
|
||||
// setTimeout(draw, msg.compositionTime, msg.output)
|
||||
// } else {
|
||||
// draw(msg.output)
|
||||
// }
|
||||
draw(msg.output)
|
||||
break
|
||||
case "initAudio":
|
||||
_this.initAudioPlay(msg.frameCount, msg.samplerate, msg.channels)
|
||||
break
|
||||
case "playAudio":
|
||||
_this.playAudio(msg.buffer)
|
||||
break
|
||||
case "print":
|
||||
console.log(msg.text);
|
||||
break
|
||||
case "printErr":
|
||||
console.error(msg.text);
|
||||
break
|
||||
}
|
||||
}
|
||||
};
|
||||
window.AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
function _unlock() {
|
||||
var context = Jessibuca.prototype.audioContext = Jessibuca.prototype.audioContext || new window.AudioContext();
|
||||
context.resume();
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = context.createBuffer(1, 1, 22050);
|
||||
source.connect(context.destination);
|
||||
if (source.noteOn)
|
||||
source.noteOn(0);
|
||||
else
|
||||
source.start(0);
|
||||
}
|
||||
// document.addEventListener("mousedown", _unlock, true);
|
||||
// document.addEventListener("touchend", _unlock, true);
|
||||
Jessibuca.prototype.audioEnabled = function (flag) {
|
||||
if (flag) {
|
||||
_unlock()
|
||||
this.audioEnabled = function (flag) {
|
||||
if (flag) {
|
||||
this.audioContext.resume();
|
||||
} else {
|
||||
this.audioContext.suspend();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Jessibuca.prototype.playAudio = function (data) {
|
||||
var context = this.audioContext;
|
||||
var isPlaying = false;
|
||||
var isDecoding = false;
|
||||
if (!context) return false;
|
||||
var audioBuffers = [];
|
||||
var decodeQueue = []
|
||||
var _this = this
|
||||
var playNextBuffer = function (e) {
|
||||
// isPlaying = false;
|
||||
if (audioBuffers.length) {
|
||||
playBuffer(audioBuffers.shift())
|
||||
}
|
||||
//if (audioBuffers.length > 1) audioBuffers.shift();
|
||||
};
|
||||
var playBuffer = function (buffer) {
|
||||
isPlaying = true;
|
||||
var audioBufferSouceNode = context.createBufferSource();
|
||||
audioBufferSouceNode.buffer = buffer;
|
||||
audioBufferSouceNode.connect(context.destination);
|
||||
// audioBufferSouceNode.onended = playNextBuffer;
|
||||
audioBufferSouceNode.start();
|
||||
if (!_this.audioInterval) {
|
||||
_this.audioInterval = setInterval(playNextBuffer, buffer.duration * 1000 - 1);
|
||||
}
|
||||
// setTimeout(playNextBuffer, buffer.duration * 1000)
|
||||
}
|
||||
var tryPlay = function (buffer) {
|
||||
if (decodeQueue.length) {
|
||||
context.decodeAudioData(decodeQueue.shift(), tryPlay, console.error);
|
||||
} else {
|
||||
isDecoding = false
|
||||
}
|
||||
if (isPlaying) {
|
||||
audioBuffers.push(buffer);
|
||||
} else {
|
||||
playBuffer(buffer)
|
||||
}
|
||||
}
|
||||
var playAudio = function (data) {
|
||||
decodeQueue.push(...data)
|
||||
if (!isDecoding) {
|
||||
isDecoding = true
|
||||
context.decodeAudioData(decodeQueue.shift(), tryPlay, console.error);
|
||||
}
|
||||
}
|
||||
this.playAudio = playAudio
|
||||
playAudio(data)
|
||||
}
|
||||
Jessibuca.prototype.initAudioPlay = function (frameCount, samplerate, channels) {
|
||||
var context = this.audioContext;
|
||||
var isPlaying = false;
|
||||
var audioBuffers = [];
|
||||
if (!context) return false;
|
||||
var resampled = samplerate < 22050;
|
||||
var audioBuffer = resampled ? context.createBuffer(channels, frameCount << 1, samplerate << 1) : context.createBuffer(channels, frameCount, samplerate);
|
||||
var playNextBuffer = function () {
|
||||
isPlaying = false;
|
||||
console.log("~", audioBuffers.length)
|
||||
if (audioBuffers.length) {
|
||||
playAudio(audioBuffers.shift());
|
||||
}
|
||||
//if (audioBuffers.length > 1) audioBuffers.shift();
|
||||
};
|
||||
|
||||
var copyToCtxBuffer = channels > 1 ? function (fromBuffer) {
|
||||
for (var channel = 0; channel < channels; channel++) {
|
||||
var nowBuffering = audioBuffer.getChannelData(channel);
|
||||
if (resampled) {
|
||||
for (var i = 0; i < frameCount; i++) {
|
||||
nowBuffering[i * 2] = nowBuffering[i * 2 + 1] = fromBuffer[i * (channel + 1)] / 32768;
|
||||
}
|
||||
} else
|
||||
for (var i = 0; i < frameCount; i++) {
|
||||
nowBuffering[i] = fromBuffer[i * (channel + 1)] / 32768;
|
||||
}
|
||||
}
|
||||
} : function (fromBuffer) {
|
||||
var nowBuffering = audioBuffer.getChannelData(0);
|
||||
for (var i = 0; i < nowBuffering.length; i++) {
|
||||
nowBuffering[i] = fromBuffer[i] / 32768;
|
||||
}
|
||||
// nowBuffering.set(fromBuffer);
|
||||
};
|
||||
var playAudio = function (fromBuffer) {
|
||||
if (isPlaying) {
|
||||
audioBuffers.push(fromBuffer);
|
||||
console.log(audioBuffers.length)
|
||||
return;
|
||||
}
|
||||
isPlaying = true;
|
||||
copyToCtxBuffer(fromBuffer);
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = audioBuffer;
|
||||
source.connect(context.destination);
|
||||
source.onended = playNextBuffer;
|
||||
//setTimeout(playNextBuffer, audioBufferTime-audioBuffers.length*200);
|
||||
source.start();
|
||||
};
|
||||
this.playAudio = playAudio;
|
||||
}
|
||||
/**
|
||||
* Returns true if the canvas supports WebGL
|
||||
*/
|
||||
Jessibuca.prototype.isWebGL = function () {
|
||||
return !!this.contextGL;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create the GL context from the canvas element
|
||||
*/
|
||||
Jessibuca.prototype.initContextGL = function () {
|
||||
var canvas = this.canvasElement;
|
||||
var gl = null;
|
||||
|
||||
var validContextNames = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"];
|
||||
var nameIndex = 0;
|
||||
|
||||
while (!gl && nameIndex < validContextNames.length) {
|
||||
var contextName = validContextNames[nameIndex];
|
||||
|
||||
try {
|
||||
if (this.contextOptions) {
|
||||
gl = canvas.getContext(contextName, this.contextOptions);
|
||||
} else {
|
||||
gl = canvas.getContext(contextName);
|
||||
};
|
||||
} catch (e) {
|
||||
gl = null;
|
||||
}
|
||||
|
||||
if (!gl || typeof gl.getParameter !== "function") {
|
||||
gl = null;
|
||||
}
|
||||
|
||||
++nameIndex;
|
||||
};
|
||||
|
||||
this.contextGL = gl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize GL shader program
|
||||
*/
|
||||
Jessibuca.prototype.initProgram = function () {
|
||||
var gl = this.contextGL;
|
||||
|
||||
var vertexShaderScript = [
|
||||
'attribute vec4 vertexPos;',
|
||||
'attribute vec4 texturePos;',
|
||||
'varying vec2 textureCoord;',
|
||||
|
||||
'void main()',
|
||||
'{',
|
||||
'gl_Position = vertexPos;',
|
||||
'textureCoord = texturePos.xy;',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
var fragmentShaderScript = [
|
||||
'precision highp float;',
|
||||
'varying highp vec2 textureCoord;',
|
||||
'uniform sampler2D ySampler;',
|
||||
'uniform sampler2D uSampler;',
|
||||
'uniform sampler2D vSampler;',
|
||||
'const mat4 YUV2RGB = mat4',
|
||||
'(',
|
||||
'1.1643828125, 0, 1.59602734375, -.87078515625,',
|
||||
'1.1643828125, -.39176171875, -.81296875, .52959375,',
|
||||
'1.1643828125, 2.017234375, 0, -1.081390625,',
|
||||
'0, 0, 0, 1',
|
||||
');',
|
||||
|
||||
'void main(void) {',
|
||||
'highp float y = texture2D(ySampler, textureCoord).r;',
|
||||
'highp float u = texture2D(uSampler, textureCoord).r;',
|
||||
'highp float v = texture2D(vSampler, textureCoord).r;',
|
||||
'gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
var vertexShader = gl.createShader(gl.VERTEX_SHADER);
|
||||
gl.shaderSource(vertexShader, vertexShaderScript);
|
||||
gl.compileShader(vertexShader);
|
||||
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
|
||||
console.log('Vertex shader failed to compile: ' + gl.getShaderInfoLog(vertexShader));
|
||||
}
|
||||
|
||||
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
gl.shaderSource(fragmentShader, fragmentShaderScript);
|
||||
gl.compileShader(fragmentShader);
|
||||
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
|
||||
console.log('Fragment shader failed to compile: ' + gl.getShaderInfoLog(fragmentShader));
|
||||
}
|
||||
|
||||
var program = gl.createProgram();
|
||||
gl.attachShader(program, vertexShader);
|
||||
gl.attachShader(program, fragmentShader);
|
||||
gl.linkProgram(program);
|
||||
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
||||
console.log('Program failed to compile: ' + gl.getProgramInfoLog(program));
|
||||
}
|
||||
|
||||
gl.useProgram(program);
|
||||
|
||||
this.shaderProgram = program;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize vertex buffers and attach to shader program
|
||||
*/
|
||||
Jessibuca.prototype.initBuffers = function () {
|
||||
var gl = this.contextGL;
|
||||
var program = this.shaderProgram;
|
||||
|
||||
var vertexPosBuffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);
|
||||
|
||||
var vertexPosRef = gl.getAttribLocation(program, 'vertexPos');
|
||||
gl.enableVertexAttribArray(vertexPosRef);
|
||||
gl.vertexAttribPointer(vertexPosRef, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
var texturePosBuffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.STATIC_DRAW);
|
||||
|
||||
var texturePosRef = gl.getAttribLocation(program, 'texturePos');
|
||||
gl.enableVertexAttribArray(texturePosRef);
|
||||
gl.vertexAttribPointer(texturePosRef, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
this.texturePosBuffer = texturePosBuffer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize GL textures and attach to shader program
|
||||
*/
|
||||
Jessibuca.prototype.initTextures = function () {
|
||||
var gl = this.contextGL;
|
||||
var program = this.shaderProgram;
|
||||
|
||||
var yTextureRef = this.initTexture();
|
||||
var ySamplerRef = gl.getUniformLocation(program, 'ySampler');
|
||||
gl.uniform1i(ySamplerRef, 0);
|
||||
this.yTextureRef = yTextureRef;
|
||||
|
||||
var uTextureRef = this.initTexture();
|
||||
var uSamplerRef = gl.getUniformLocation(program, 'uSampler');
|
||||
gl.uniform1i(uSamplerRef, 1);
|
||||
this.uTextureRef = uTextureRef;
|
||||
|
||||
var vTextureRef = this.initTexture();
|
||||
var vSamplerRef = gl.getUniformLocation(program, 'vSampler');
|
||||
gl.uniform1i(vSamplerRef, 2);
|
||||
this.vTextureRef = vTextureRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create and configure a single texture
|
||||
*/
|
||||
Jessibuca.prototype.initTexture = function () {
|
||||
var gl = this.contextGL;
|
||||
|
||||
var textureRef = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, textureRef);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
gl.bindTexture(gl.TEXTURE_2D, null);
|
||||
|
||||
return textureRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw picture data to the canvas.
|
||||
* If this object is using WebGL, the data must be an I420 formatted ArrayBuffer,
|
||||
* Otherwise, data must be an RGBA formatted ArrayBuffer.
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOutputPicture = function (width, height, croppingParams, data) {
|
||||
var gl = this.contextGL;
|
||||
if (gl) {
|
||||
this.drawNextOuptutPictureGL(width, height, croppingParams, data);
|
||||
} else {
|
||||
this.drawNextOuptutPictureRGBA(width, height, croppingParams, data);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the next output picture using WebGL
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOuptutPictureGL = function (width, height, croppingParams, data) {
|
||||
var gl = this.contextGL;
|
||||
var texturePosBuffer = this.texturePosBuffer;
|
||||
var yTextureRef = this.yTextureRef;
|
||||
var uTextureRef = this.uTextureRef;
|
||||
var vTextureRef = this.vTextureRef;
|
||||
this.contextGL.viewport(0, 0, this.canvasElement.width, this.canvasElement.height);
|
||||
// if (!croppingParams) {
|
||||
// gl.viewport(0, 0, width, height);
|
||||
// } else {
|
||||
// gl.viewport(0, 0, croppingParams.width, croppingParams.height);
|
||||
|
||||
// var tTop = croppingParams.top / height;
|
||||
// var tLeft = croppingParams.left / width;
|
||||
// var tBottom = croppingParams.height / height;
|
||||
// var tRight = croppingParams.width / width;
|
||||
// var texturePosValues = new Float32Array([tRight, tTop, tLeft, tTop, tRight, tBottom, tLeft, tBottom]);
|
||||
|
||||
// gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
|
||||
// gl.bufferData(gl.ARRAY_BUFFER, texturePosValues, gl.DYNAMIC_DRAW);
|
||||
// }
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[0]);
|
||||
|
||||
gl.activeTexture(gl.TEXTURE1);
|
||||
gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width / 2, height / 2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[1]);
|
||||
|
||||
gl.activeTexture(gl.TEXTURE2);
|
||||
gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width / 2, height / 2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[2]);
|
||||
|
||||
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw next output picture using ARGB data on a 2d canvas.
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOuptutPictureRGBA = function (width, height, croppingParams, data) {
|
||||
// var canvas = this.canvasElement;
|
||||
//var argbData = data;
|
||||
//var ctx = canvas.getContext('2d');
|
||||
// var imageData = ctx.getImageData(0, 0, width, height);
|
||||
//this.imageData = this.ctx2d.getImageData(0, 0, width, height);
|
||||
this.imageData.data.set(data);
|
||||
//Module.print(typeof this.imageData.data);
|
||||
if (!croppingParams) {
|
||||
this.ctx2d.putImageData(this.imageData, 0, 0);
|
||||
} else {
|
||||
this.ctx2d.putImageData(this.imageData, -croppingParams.left, -croppingParams.top, 0, 0, croppingParams.width, croppingParams.height);
|
||||
}
|
||||
};
|
||||
Jessibuca.prototype.ctx2d = null;
|
||||
Jessibuca.prototype.imageData = null;
|
||||
Jessibuca.prototype.initRGB = function (width, height) {
|
||||
this.ctx2d = this.canvasElement.getContext('2d');
|
||||
this.imageData = this.ctx2d.getImageData(0, 0, width, height);
|
||||
this.clear = function () {
|
||||
this.ctx2d.clearRect(0, 0, width, height)
|
||||
};
|
||||
//Module.print(this.imageData);
|
||||
};
|
||||
Jessibuca.prototype.close = function () {
|
||||
if (this.audioInterval) {
|
||||
clearInterval(this.audioInterval)
|
||||
}
|
||||
this.decoderWorker.postMessage({ cmd: "close" })
|
||||
this.contextGL.clear(this.contextGL.COLOR_BUFFER_BIT);
|
||||
}
|
||||
Jessibuca.prototype.destroy = function(){
|
||||
this.decoderWorker.terminate()
|
||||
}
|
||||
Jessibuca.prototype.play = function (url) {
|
||||
this.decoderWorker.postMessage({ cmd: "play", url: url, isWebGL: this.isWebGL() })
|
||||
}
|
2
dashboard/dist/js/app.9cc902b4.js
vendored
1
dashboard/dist/js/app.9cc902b4.js.map
vendored
44
dashboard/dist/js/chunk-vendors.ae8ac63d.js
vendored
@@ -1,20 +0,0 @@
|
||||
module.exports = {
|
||||
dest: 'public/docs',
|
||||
serviceWorker: true,
|
||||
themeConfig: {
|
||||
sidebar: [
|
||||
['/', '起步'],
|
||||
['/develop', '插件开发'],
|
||||
[ '/history', '更新日志' ],
|
||||
{
|
||||
title: '内置插件',
|
||||
path: '/plugins/',
|
||||
children: [
|
||||
'/plugins/jessica'
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
title: 'Monibuca',
|
||||
base: '/docs/'
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
import upperFirst from 'lodash/upperFirst'
|
||||
import camelCase from 'lodash/camelCase'
|
||||
export default ({
|
||||
Vue, // the version of Vue being used in the VuePress app
|
||||
options, // the options for the root Vue instance
|
||||
router, // the router instance for the app
|
||||
siteData // site metadata
|
||||
}) => {
|
||||
// ...apply enhancements to the app
|
||||
|
||||
const requireComponent = require.context(
|
||||
// The relative path of the components folder
|
||||
'../../src/components',
|
||||
// Whether or not to look in subfolders
|
||||
true,
|
||||
// The regular expression used to match base component filenames
|
||||
/.(vue|js)$/
|
||||
)
|
||||
|
||||
|
||||
requireComponent.keys().forEach(fileName => {
|
||||
// Get component config
|
||||
const componentConfig = requireComponent(fileName)
|
||||
const fc = fileName.split('/')
|
||||
const f = fc[fc.length - 1]
|
||||
// Get PascalCase name of component
|
||||
const componentName = upperFirst(
|
||||
camelCase(
|
||||
f.replace(/.*\//, '$1').replace(/\.\w+$/,'')
|
||||
)
|
||||
)
|
||||
// Register component globally
|
||||
Vue.component(
|
||||
componentName,
|
||||
componentConfig.default || componentConfig
|
||||
)
|
||||
})
|
||||
}
|
@@ -1,53 +0,0 @@
|
||||
# Monibuca快速起步
|
||||
## 介绍
|
||||
Monibuca 是一个开源的流媒体服务器开发框架,适用于快速定制化开发流媒体服务器,可以对接CDN厂商,作为回源服务器,也可以自己搭建集群部署环境。
|
||||
丰富的内置插件提供了流媒体服务器的常见功能,例如rtmp server、http-flv、视频录制、QoS等。除此以外还内置了后台web界面,方便观察服务器运行的状态。
|
||||
也可以自己开发后台管理界面,通过api方式获取服务器的运行信息。
|
||||
Monibuca 提供了可供定制化开发的插件机制,可以任意扩展其功能。
|
||||
|
||||
## 启动
|
||||
启用所有内置插件
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
. "github.com/langhuihui/monibuca/monica"
|
||||
_ "github.com/langhuihui/monibuca/plugins"
|
||||
)
|
||||
|
||||
func main() {
|
||||
Run("config.toml")
|
||||
select {}
|
||||
}
|
||||
```
|
||||
|
||||
## 配置
|
||||
|
||||
要使用`Monibuca`,需要编写一个`toml`格式的配置文件,通常可以放在程序的同级目录下例如:`config.toml`(名称不是必须为`config`)
|
||||
|
||||
该配置文件主要是为了定制各个插件的配置,例如监听端口号等,具体还是要看各个插件的设计。
|
||||
|
||||
> 如果你编写了自己的插件,就必须在该配置文件中写入对自己插件的配置信息
|
||||
|
||||
如果注释掉部分插件的配置,那么该插件就不会启用,典型的配置如下:
|
||||
```toml
|
||||
[Plugins.HDL]
|
||||
ListenAddr = ":2020"
|
||||
[Plugins.Jessica]
|
||||
ListenAddr = ":8080"
|
||||
[Plugins.RTMP]
|
||||
ListenAddr = ":1935"
|
||||
[Plugins.GateWay]
|
||||
ListenAddr = ":81"
|
||||
#[Plugins.Cluster]
|
||||
#Master = "localhost:2019"
|
||||
#ListenAddr = ":2019"
|
||||
#
|
||||
#[Plugins.Auth]
|
||||
#Key="www.monibuca.com"
|
||||
#[Plugins.RecordFlv]
|
||||
#Path="./resouce"
|
||||
[Plugins.QoS]
|
||||
Suffix = ["high","medium","low"]
|
||||
```
|
||||
具体配置的含义,可以参考每个插件的说明
|
@@ -1,178 +0,0 @@
|
||||
# 插件开发
|
||||
## 插件的定义
|
||||
所谓的插件,没有什么固定的规则,只需要完成`安装`操作即可。插件可以实现任意的功能扩展,最常见的是实现某种传输协议用来推流或者拉流
|
||||
|
||||
## 插件的安装
|
||||
下面是内置插件jessica的源码,代表了典型的插件安装
|
||||
```go
|
||||
package jessica
|
||||
|
||||
import (
|
||||
. "github.com/langhuihui/monibuca/monica"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var config = new(ListenerConfig)
|
||||
|
||||
func init() {
|
||||
InstallPlugin(&PluginConfig{
|
||||
Name: "Jessica",
|
||||
Type: PLUGIN_SUBSCRIBER,
|
||||
Config: config,
|
||||
Run: run,
|
||||
})
|
||||
}
|
||||
func run() {
|
||||
log.Printf("server Jessica start at %s", config.ListenAddr)
|
||||
log.Fatal(http.ListenAndServe(config.ListenAddr, http.HandlerFunc(WsHandler)))
|
||||
}
|
||||
```
|
||||
当主程序读取配置文件完成解析后,会调用各个插件的Run函数,上面代码中执行了一个http的端口监听
|
||||
|
||||
## 开发订阅者插件
|
||||
所谓订阅者就是用来从流媒体服务器接收音视频流的程序,例如RTMP协议执行play命令后、http-flv请求响应程序、websocket响应程序。内置插件中录制flv程序也是一个特殊的订阅者。
|
||||
下面是http-flv插件的源码,供参考
|
||||
```go
|
||||
package HDL
|
||||
|
||||
import (
|
||||
. "github.com/langhuihui/monibuca/monica"
|
||||
"github.com/langhuihui/monibuca/monica/avformat"
|
||||
"github.com/langhuihui/monibuca/monica/pool"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var config = new(ListenerConfig)
|
||||
|
||||
func init() {
|
||||
InstallPlugin(&PluginConfig{
|
||||
Name: "HDL",
|
||||
Type: PLUGIN_SUBSCRIBER,
|
||||
Config: config,
|
||||
Run: run,
|
||||
})
|
||||
}
|
||||
|
||||
func run() {
|
||||
log.Printf("HDL start at %s", config.ListenAddr)
|
||||
log.Fatal(http.ListenAndServe(config.ListenAddr, http.HandlerFunc(HDLHandler)))
|
||||
}
|
||||
|
||||
func HDLHandler(w http.ResponseWriter, r *http.Request) {
|
||||
sign := r.URL.Query().Get("sign")
|
||||
if err := AuthHooks.Trigger(sign); err != nil {
|
||||
w.WriteHeader(403)
|
||||
return
|
||||
}
|
||||
stringPath := strings.TrimLeft(r.RequestURI, "/")
|
||||
if strings.HasSuffix(stringPath, ".flv") {
|
||||
stringPath = strings.TrimRight(stringPath, ".flv")
|
||||
}
|
||||
if _, ok := AllRoom.Load(stringPath); ok {
|
||||
//atomic.AddInt32(&hdlId, 1)
|
||||
w.Header().Set("Transfer-Encoding", "chunked")
|
||||
w.Header().Set("Content-Type", "video/x-flv")
|
||||
w.Write(avformat.FLVHeader)
|
||||
p := OutputStream{
|
||||
Sign: sign,
|
||||
SendHandler: func(packet *pool.SendPacket) error {
|
||||
return avformat.WriteFLVTag(w, packet)
|
||||
},
|
||||
SubscriberInfo: SubscriberInfo{
|
||||
ID: r.RemoteAddr, Type: "FLV",
|
||||
},
|
||||
}
|
||||
p.Play(stringPath)
|
||||
} else {
|
||||
w.WriteHeader(404)
|
||||
}
|
||||
}
|
||||
```
|
||||
其中,核心逻辑就是创建OutputStream对象,每一个订阅者需要提供SendHandler函数,用来接收来自发布者广播出来的音视频数据。
|
||||
最后调用该对象的Play函数进行播放。请注意:Play函数会阻塞当前goroutine。
|
||||
|
||||
## 开发发布者插件
|
||||
|
||||
所谓发布者,就是提供音视频数据的程序,例如接收来自OBS、ffmpeg的推流的程序。内置插件中,集群功能里面有一个特殊的发布者,它接收来自源服务器的音视频数据,然后在本服务器中广播音视频。
|
||||
以此为例,我们需要提供一个结构体定义来表示特定的发布者:
|
||||
```go
|
||||
type Receiver struct {
|
||||
InputStream
|
||||
io.Reader
|
||||
*bufio.Writer
|
||||
}
|
||||
```
|
||||
其中InputStream 是固定的,必须包含,且必须以组合继承的方式定义。其余的成员则是任意的。
|
||||
发布者的发布动作需要特定条件的触发,例如在集群插件中,当本服务器有订阅者订阅了某个流,而该流并没有发布者的时候就会触发向源服务器拉流的函数:
|
||||
```go
|
||||
func PullUpStream(streamPath string) {
|
||||
addr, err := net.ResolveTCPAddr("tcp", config.Master)
|
||||
if MayBeError(err) {
|
||||
return
|
||||
}
|
||||
conn, err := net.DialTCP("tcp", nil, addr)
|
||||
if MayBeError(err) {
|
||||
return
|
||||
}
|
||||
brw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn))
|
||||
p := &Receiver{
|
||||
Reader: conn,
|
||||
Writer: brw.Writer,
|
||||
}
|
||||
if p.Publish(streamPath, p) {
|
||||
p.WriteByte(MSG_SUBSCRIBE)
|
||||
p.WriteString(streamPath)
|
||||
p.WriteByte(0)
|
||||
p.Flush()
|
||||
for _, v := range p.Subscribers {
|
||||
p.Auth(v)
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
defer p.Cancel()
|
||||
for {
|
||||
cmd, err := brw.ReadByte()
|
||||
if MayBeError(err) {
|
||||
return
|
||||
}
|
||||
switch cmd {
|
||||
case MSG_AUDIO:
|
||||
if audio, err := p.readAVPacket(avformat.FLV_TAG_TYPE_AUDIO); err == nil {
|
||||
p.PushAudio(audio)
|
||||
}
|
||||
case MSG_VIDEO:
|
||||
if video, err := p.readAVPacket(avformat.FLV_TAG_TYPE_VIDEO); err == nil && len(video.Payload) > 2 {
|
||||
tmp := video.Payload[0] // 第一个字节保存着视频的相关信息.
|
||||
video.VideoFrameType = tmp >> 4 // 帧类型 4Bit, H264一般为1或者2
|
||||
p.PushVideo(video)
|
||||
}
|
||||
case MSG_AUTH:
|
||||
cmd, err = brw.ReadByte()
|
||||
if MayBeError(err) {
|
||||
return
|
||||
}
|
||||
bytes, err := brw.ReadBytes(0)
|
||||
if MayBeError(err) {
|
||||
return
|
||||
}
|
||||
subId := strings.Split(string(bytes[0:len(bytes)-1]), ",")[0]
|
||||
if v, ok := p.Subscribers[subId]; ok {
|
||||
if cmd != 1 {
|
||||
v.Cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
正在该函数中会向源服务器建立tcp连接,然后发送特定命令表示需要拉流,当我们接收到源服务器的数据的时候,就调用PushVideo和PushAudio函数来广播音视频。
|
||||
|
||||
核心逻辑是调用InputStream的Publish以及PushVideo、PushAudio函数
|
||||
|
||||
## 开发钩子插件
|
||||
|
@@ -1,4 +0,0 @@
|
||||
# 更新历史
|
||||
|
||||
- 2020/1/27
|
||||
1.0完成
|
@@ -1,10 +0,0 @@
|
||||
# Jessica
|
||||
该插件为基于WebSocket协议传输音视频的订阅者,音视频数据以裸数据的形式进行传输,我们需要Jessibuca播放器来进行播放
|
||||
Jessibua播放器已内置于源码中,该播放器通过js解码H264并用canvas进行渲染,可以运行在几乎所有的终端浏览器上面。
|
||||
在Monibuca的Web界面中预览功能就是使用的Jessibuca播放器。
|
||||
## 配置
|
||||
目前仅有的配置是监听的端口号
|
||||
```toml
|
||||
[Plugins.Jessica]
|
||||
ListenAddr = ":8080"
|
||||
```
|
19251
dashboard/package-lock.json
generated
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"name": "dashboard",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"docs:build": "vuepress build docs",
|
||||
"docs:dev": "vuepress dev docs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/g2plot": "^0.11.22",
|
||||
"core-js": "^3.4.4",
|
||||
"view-design": "^4.0.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuex": "^3.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.1.0",
|
||||
"@vue/cli-plugin-eslint": "^4.1.0",
|
||||
"@vue/cli-plugin-router": "^4.1.0",
|
||||
"@vue/cli-plugin-vuex": "^4.1.0",
|
||||
"@vue/cli-service": "^4.1.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"iview-loader": "^1.3.0",
|
||||
"less": "^3.0.4",
|
||||
"less-loader": "^5.0.0",
|
||||
"loadash": "^1.0.0",
|
||||
"vue-cli-plugin-iview": "^2.0.0",
|
||||
"vue-cli-plugin-vuepress": "^0.1.1",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"vuepress": "^0.10.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"rules": {
|
||||
"vue/no-parsing-error": [
|
||||
2,
|
||||
{
|
||||
"x-invalid-end-tag": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
]
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="content"><h1>404</h1><blockquote>How did we get here?</blockquote><a href="/docs/" class="router-link-active">Take me home.</a></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><g stroke-width="2" stroke="#aaa" fill="none"><path d="M11.29 11.71l-4-4"/><circle cx="5" cy="5" r="4"/></g></svg>
|
Before Width: | Height: | Size: 216 B |
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{168:function(t,e,n){"use strict";n.r(e);var a=n(0),s=Object(a.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"关于-monibuca"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#关于-monibuca","aria-hidden":"true"}},[this._v("#")]),this._v(" 关于 Monibuca")])])}],!1,null,null,null);e.default=s.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{167:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"page-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Page 2")]),e("p",[this._v("this is a second page")])])}],!1,null,null,null);e.default=i.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{166:function(t,n,e){"use strict";e.r(n);var s=e(0),c=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"content"})}),[],!1,null,null,null);n.default=c.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{165:function(t,e,i){"use strict";i.r(e);var s=i(0),a=Object(s.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"page-3-with-custom-link-page"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-3-with-custom-link-page","aria-hidden":"true"}},[this._v("#")]),this._v(" Page 3 with custom link page")]),e("p",[this._v("this is a third page")])])}],!1,null,null,null);e.default=a.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{164:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"page-1"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-1","aria-hidden":"true"}},[this._v("#")]),this._v(" Page 1")]),e("p",[this._v("this is a page")])])}],!1,null,null,null);e.default=i.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{163:function(t,n,e){"use strict";e.r(n);var s=e(0),c=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"content"})}),[],!1,null,null,null);n.default=c.exports}}]);
|
@@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{162:function(t,s,a){"use strict";a.r(s);var e=a(0),i=Object(e.a)({},(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"jessica"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#jessica","aria-hidden":"true"}},[this._v("#")]),this._v(" Jessica")]),s("h2",{attrs:{id:"配置"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 配置")])])}],!1,null,null,null);s.default=i.exports}}]);
|
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Page 2 | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/2.a6d3efaf.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="active sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="page-2"><a href="#page-2" aria-hidden="true" class="header-anchor">#</a> Page 2</h1><p>this is a second page</p></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/install.html" class="prev">
|
||||
安装
|
||||
</a></span><span class="next"><a href="/docs/develop.html">
|
||||
插件开发
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/2.a6d3efaf.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/3.a9fbea98.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="active sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/config.html" class="prev">
|
||||
配置
|
||||
</a></span><span class="next"><a href="/docs/history.html">
|
||||
更新日志
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/3.a9fbea98.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Page 3 with custom link page | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/4.727e40e9.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="active sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="page-3-with-custom-link-page"><a href="#page-3-with-custom-link-page" aria-hidden="true" class="header-anchor">#</a> Page 3 with custom link page</h1><p>this is a third page</p></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/develop.html" class="prev">
|
||||
插件开发
|
||||
</a></span><span class="next"><a href="/docs/plugins/jessica.html">
|
||||
Jessica
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/4.727e40e9.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>关于 Monibuca | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/1.685ed1cc.js" as="script"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-exact-active router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="active sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="关于-monibuca"><a href="#关于-monibuca" aria-hidden="true" class="header-anchor">#</a> 关于 Monibuca</h1></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><!----><span class="next"><a href="/docs/install.html">
|
||||
安装
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/1.685ed1cc.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Page 1 | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/5.78b155e8.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="active sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"><h1 id="page-1"><a href="#page-1" aria-hidden="true" class="header-anchor">#</a> Page 1</h1><p>this is a page</p></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/" class="prev router-link-active">
|
||||
介绍
|
||||
</a></span><span class="next"><a href="/docs/config.html">
|
||||
配置
|
||||
</a> →
|
||||
</span></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/5.78b155e8.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/6.35a311c9.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/7.ab3a52c1.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>内置插件</span><span class="arrow right"></span></p><!----></div></li></ul></div><div class="page"><div class="content"></div><div class="page-edit"><!----><!----></div><!----></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/6.35a311c9.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Jessica | Monibuca</title>
|
||||
<meta name="description" content="">
|
||||
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/styles.92893aed.css" as="style"><link rel="preload" href="/docs/assets/js/app.92893aed.js" as="script"><link rel="preload" href="/docs/assets/js/7.ab3a52c1.js" as="script"><link rel="prefetch" href="/docs/assets/js/1.685ed1cc.js"><link rel="prefetch" href="/docs/assets/js/2.a6d3efaf.js"><link rel="prefetch" href="/docs/assets/js/3.a9fbea98.js"><link rel="prefetch" href="/docs/assets/js/4.727e40e9.js"><link rel="prefetch" href="/docs/assets/js/5.78b155e8.js"><link rel="prefetch" href="/docs/assets/js/6.35a311c9.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/styles.92893aed.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/docs/" class="home-link router-link-active"><!----><span class="site-name">
|
||||
Monibuca
|
||||
</span></a><div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""><!----></div><!----></div></header><div class="sidebar-mask"></div><div class="sidebar"><!----><ul class="sidebar-links"><li><a href="/docs/" class="sidebar-link">介绍</a></li><li><a href="/docs/install.html" class="sidebar-link">安装</a></li><li><a href="/docs/config.html" class="sidebar-link">配置</a></li><li><a href="/docs/develop.html" class="sidebar-link">插件开发</a></li><li><a href="/docs/history.html" class="sidebar-link">更新日志</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading open"><span>内置插件</span><span class="arrow down"></span></p><ul class="sidebar-group-items"><li><a href="/docs/plugins/jessica.html" class="active sidebar-link">Jessica</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/plugins/jessica.html#配置" class="sidebar-link">配置</a></li></ul></li></ul></div></li></ul></div><div class="page"><div class="content"><h1 id="jessica"><a href="#jessica" aria-hidden="true" class="header-anchor">#</a> Jessica</h1><h2 id="配置"><a href="#配置" aria-hidden="true" class="header-anchor">#</a> 配置</h2></div><div class="page-edit"><!----><!----></div><div class="page-nav"><p class="inner"><span class="prev">
|
||||
← <a href="/docs/history.html" class="prev">
|
||||
更新日志
|
||||
</a></span><!----></p></div></div></div></div>
|
||||
<script src="/docs/assets/js/app.92893aed.js" defer></script><script src="/docs/assets/js/7.ab3a52c1.js" defer></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,96 +0,0 @@
|
||||
/**
|
||||
* Welcome to your Workbox-powered service worker!
|
||||
*
|
||||
* You'll need to register this file in your web app and you should
|
||||
* disable HTTP caching for this file too.
|
||||
* See https://goo.gl/nhQhGp
|
||||
*
|
||||
* The rest of the code is auto-generated. Please don't update this file
|
||||
* directly; instead, make changes to your Workbox build configuration
|
||||
* and re-run your build process.
|
||||
* See https://goo.gl/2aRDsh
|
||||
*/
|
||||
|
||||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
|
||||
|
||||
/**
|
||||
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
|
||||
* requests for URLs in the manifest.
|
||||
* See https://goo.gl/S9QRab
|
||||
*/
|
||||
self.__precacheManifest = [
|
||||
{
|
||||
"url": "404.html",
|
||||
"revision": "0e4ff0fd403c5d29a13752bf3ef14d6d"
|
||||
},
|
||||
{
|
||||
"url": "assets/css/styles.92893aed.css",
|
||||
"revision": "07fa9a1fb782ef296585900714fac621"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/search.83621669.svg",
|
||||
"revision": "83621669651b9a3d4bf64d1a670ad856"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/1.685ed1cc.js",
|
||||
"revision": "97247c4d4a60db87b22488bfdf99197d"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/2.a6d3efaf.js",
|
||||
"revision": "dca15d8c2b94dadcdce4386e7d628716"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/3.a9fbea98.js",
|
||||
"revision": "7f6bca508f94f8f508a61cd05b582084"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/4.727e40e9.js",
|
||||
"revision": "b8fca87e9c559c1fe3fa03b76d15c3bd"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/5.78b155e8.js",
|
||||
"revision": "73d1f3053737ad68ee4ec4fa395fcae9"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/6.35a311c9.js",
|
||||
"revision": "8bd2ad3294cf6a29e7326ca860d43250"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/7.ab3a52c1.js",
|
||||
"revision": "437c1f4739f884dcff81135f7bc8450c"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/app.92893aed.js",
|
||||
"revision": "6962a63ee86d8a65c9ae46100427d812"
|
||||
},
|
||||
{
|
||||
"url": "config.html",
|
||||
"revision": "73b0335d99419df53f57913cd7303509"
|
||||
},
|
||||
{
|
||||
"url": "develop.html",
|
||||
"revision": "bc1b3cad3f88b61fee351464cffc7d0f"
|
||||
},
|
||||
{
|
||||
"url": "history.html",
|
||||
"revision": "dc6b1088d3cc72f1f3a402c56a441a57"
|
||||
},
|
||||
{
|
||||
"url": "index.html",
|
||||
"revision": "577c237555d953d8a22d045212f0a92e"
|
||||
},
|
||||
{
|
||||
"url": "install.html",
|
||||
"revision": "d06af57877e4695ae1a81528e2f128f1"
|
||||
},
|
||||
{
|
||||
"url": "plugins/index.html",
|
||||
"revision": "e578381fed44a65589053470ea33795d"
|
||||
},
|
||||
{
|
||||
"url": "plugins/jessica.html",
|
||||
"revision": "fe406bf63d2d349727c63d6045fd2efa"
|
||||
}
|
||||
].concat(self.__precacheManifest || []);
|
||||
workbox.precaching.suppressWarnings();
|
||||
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
|
Before Width: | Height: | Size: 21 KiB |
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>Monibuca</title>
|
||||
<script src="jessibuca/ajax.js"></script>
|
||||
<script src="jessibuca/renderer.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but dashboard doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
@@ -1,535 +0,0 @@
|
||||
// a simple ajax
|
||||
!(function () {
|
||||
|
||||
var jsonType = 'application/json';
|
||||
var htmlType = 'text/html';
|
||||
var xmlTypeRE = /^(?:text|application)\/xml/i;
|
||||
var blankRE = /^\s*$/; // \s
|
||||
|
||||
/*
|
||||
* default setting
|
||||
* */
|
||||
var _settings = {
|
||||
|
||||
type: "GET",
|
||||
|
||||
beforeSend: noop,
|
||||
|
||||
success: noop,
|
||||
|
||||
error: noop,
|
||||
|
||||
complete: noop,
|
||||
|
||||
context: null,
|
||||
|
||||
xhr: function () {
|
||||
return new window.XMLHttpRequest();
|
||||
},
|
||||
|
||||
accepts: {
|
||||
json: jsonType,
|
||||
xml: 'application/xml, text/xml',
|
||||
html: htmlType,
|
||||
text: 'text/plain'
|
||||
},
|
||||
|
||||
crossDomain: false,
|
||||
|
||||
timeout: 0,
|
||||
|
||||
username: null,
|
||||
|
||||
password: null,
|
||||
|
||||
processData: true,
|
||||
|
||||
promise: noop
|
||||
};
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
var ajax = function (options) {
|
||||
|
||||
//
|
||||
var settings = extend({}, options || {});
|
||||
|
||||
//
|
||||
for (var key in _settings) {
|
||||
if (settings[key] === undefined) {
|
||||
settings[key] = _settings[key];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
try {
|
||||
var q = {};
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
q.resolve = resolve;
|
||||
q.reject = reject;
|
||||
});
|
||||
|
||||
promise.resolve = q.resolve;
|
||||
promise.reject = q.reject;
|
||||
|
||||
settings.promise = promise;
|
||||
}
|
||||
catch (e) {
|
||||
//
|
||||
settings.promise = {
|
||||
resolve: noop,
|
||||
reject: noop
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
if (!settings.crossDomain) {
|
||||
settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && RegExp.$2 !== window.location.href;
|
||||
}
|
||||
|
||||
var dataType = settings.dataType;
|
||||
// jsonp
|
||||
if (dataType === 'jsonp') {
|
||||
//
|
||||
var hasPlaceholder = /=\?/.test(settings.url);
|
||||
if (!hasPlaceholder) {
|
||||
var jsonpCallback = (settings.jsonp || 'callback') + '=?';
|
||||
|
||||
settings.url = appendQuery(settings.url, jsonpCallback)
|
||||
}
|
||||
return JSONP(settings);
|
||||
}
|
||||
|
||||
// url
|
||||
if (!settings.url) {
|
||||
settings.url = window.location.toString();
|
||||
}
|
||||
|
||||
//
|
||||
serializeData(settings);
|
||||
|
||||
var mime = settings.accepts[dataType]; // mime
|
||||
var baseHeader = {}; // header
|
||||
var protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol; // protocol
|
||||
var xhr = _settings.xhr();
|
||||
var abortTimeout;
|
||||
|
||||
// X-Requested-With header
|
||||
// For cross-domain requests, seeing as conditions for a preflight are
|
||||
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
||||
// (it can always be set on a per-request basis or even using ajaxSetup)
|
||||
// For same-domain requests, won't change header if already provided.
|
||||
if (!settings.crossDomain && !baseHeader['X-Requested-With']) {
|
||||
baseHeader['X-Requested-With'] = 'XMLHttpRequest';
|
||||
}
|
||||
|
||||
// mime
|
||||
if (mime) {
|
||||
//
|
||||
baseHeader['Accept'] = mime;
|
||||
|
||||
if (mime.indexOf(',') > -1) {
|
||||
mime = mime.split(',', 2)[0]
|
||||
}
|
||||
//
|
||||
xhr.overrideMimeType && xhr.overrideMimeType(mime);
|
||||
}
|
||||
|
||||
// contentType
|
||||
if (settings.contentType || (settings.data && settings.type.toUpperCase() !== 'GET')) {
|
||||
baseHeader['Content-Type'] = (settings.contentType || 'application/x-www-form-urlencoded; charset=UTF-8');
|
||||
}
|
||||
|
||||
// headers
|
||||
settings.headers = extend(baseHeader, settings.headers || {});
|
||||
|
||||
// on ready state change
|
||||
xhr.onreadystatechange = function () {
|
||||
// readystate
|
||||
if (xhr.readyState === 4) {
|
||||
clearTimeout(abortTimeout);
|
||||
var result;
|
||||
var error = false;
|
||||
//
|
||||
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) {
|
||||
dataType = dataType || mimeToDataType(xhr.getResponseHeader('content-type'));
|
||||
result = xhr.responseText;
|
||||
|
||||
try {
|
||||
// xml
|
||||
if (dataType === 'xml') {
|
||||
result = xhr.responseXML;
|
||||
}
|
||||
// json
|
||||
else if (dataType === 'json') {
|
||||
result = blankRE.test(result) ? null : JSON.parse(result);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
ajaxError(error, 'parseerror', xhr, settings);
|
||||
}
|
||||
else {
|
||||
ajaxSuccess(result, xhr, settings);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ajaxError(null, 'error', xhr, settings);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// async
|
||||
var async = 'async' in settings ? settings.async : true;
|
||||
|
||||
// open
|
||||
xhr.open(settings.type, settings.url, async, settings.username, settings.password);
|
||||
|
||||
// xhrFields
|
||||
if (settings.xhrFields) {
|
||||
for (var name in settings.xhrFields) {
|
||||
xhr[name] = settings.xhrFields[name];
|
||||
}
|
||||
}
|
||||
|
||||
// Override mime type if needed
|
||||
if (settings.mimeType && xhr.overrideMimeType) {
|
||||
xhr.overrideMimeType(settings.mimeType);
|
||||
}
|
||||
|
||||
|
||||
// set request header
|
||||
for (var name in settings.headers) {
|
||||
// Support: IE<9
|
||||
// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
|
||||
// request header to a null-value.
|
||||
//
|
||||
// To keep consistent with other XHR implementations, cast the value
|
||||
// to string and ignore `undefined`.
|
||||
if (settings.headers[name] !== undefined) {
|
||||
xhr.setRequestHeader(name, settings.headers[name] + "");
|
||||
}
|
||||
}
|
||||
|
||||
// before send
|
||||
if (ajaxBeforeSend(xhr, settings) === false) {
|
||||
xhr.abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
// timeout
|
||||
if (settings.timeout > 0) {
|
||||
abortTimeout = window.setTimeout(function () {
|
||||
xhr.onreadystatechange = noop;
|
||||
xhr.abort();
|
||||
ajaxError(null, 'timeout', xhr, settings);
|
||||
}, settings.timeout);
|
||||
}
|
||||
|
||||
// send
|
||||
xhr.send(settings.data ? settings.data : null);
|
||||
|
||||
return settings.promise;
|
||||
};
|
||||
|
||||
/*
|
||||
* method get
|
||||
* */
|
||||
ajax.get = function (url, data, success, dataType) {
|
||||
if (isFunction(data)) {
|
||||
dataType = dataType || success;
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
return ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: dataType
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* method post
|
||||
*
|
||||
* dataType:
|
||||
* */
|
||||
ajax.post = function (url, data, success, dataType) {
|
||||
if (isFunction(data)) {
|
||||
dataType = dataType || success;
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
return ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: dataType
|
||||
})
|
||||
};
|
||||
|
||||
/*
|
||||
* method getJSON
|
||||
* */
|
||||
ajax.getJSON = function (url, data, success) {
|
||||
|
||||
if (isFunction(data)) {
|
||||
success = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
return ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
success: success,
|
||||
dataType: 'json'
|
||||
})
|
||||
};
|
||||
|
||||
/*
|
||||
* method ajaxSetup
|
||||
* */
|
||||
ajax.ajaxSetup = function (target, settings) {
|
||||
return settings ? extend(extend(target, _settings), settings) : extend(_settings, target);
|
||||
};
|
||||
|
||||
/*
|
||||
* utils
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
// triggers and extra global event ajaxBeforeSend that's like ajaxSend but cancelable
|
||||
function ajaxBeforeSend(xhr, settings) {
|
||||
var context = settings.context;
|
||||
//
|
||||
if (settings.beforeSend.call(context, xhr, settings) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ajax success
|
||||
function ajaxSuccess(data, xhr, settings) {
|
||||
var context = settings.context;
|
||||
var status = 'success';
|
||||
settings.success.call(context, data, status, xhr);
|
||||
settings.promise.resolve(data, status, xhr);
|
||||
ajaxComplete(status, xhr, settings);
|
||||
}
|
||||
|
||||
// status: "success", "notmodified", "error", "timeout", "abort", "parsererror"
|
||||
function ajaxComplete(status, xhr, settings) {
|
||||
var context = settings.context;
|
||||
settings.complete.call(context, xhr, status);
|
||||
}
|
||||
|
||||
// type: "timeout", "error", "abort", "parsererror"
|
||||
function ajaxError(error, type, xhr, settings) {
|
||||
var context = settings.context;
|
||||
settings.error.call(context, xhr, type, error);
|
||||
settings.promise.reject(xhr, type, error);
|
||||
ajaxComplete(type, xhr, settings);
|
||||
}
|
||||
|
||||
|
||||
// jsonp
|
||||
/*
|
||||
* tks: https://www.cnblogs.com/rubylouvre/archive/2011/02/13/1953087.html
|
||||
* */
|
||||
function JSONP(options) {
|
||||
//
|
||||
var callbackName = options.jsonpCallback || 'jsonp' + (new Date().getTime());
|
||||
|
||||
var script = window.document.createElement('script');
|
||||
|
||||
var abort = function () {
|
||||
// 设置 window.xxx = noop
|
||||
if (callbackName in window) {
|
||||
window[callbackName] = noop;
|
||||
}
|
||||
};
|
||||
|
||||
var xhr = {abort: abort};
|
||||
var abortTimeout;
|
||||
|
||||
var head = window.document.getElementsByTagName('head')[0] || window.document.documentElement;
|
||||
|
||||
// ie8+
|
||||
script.onerror = function (error) {
|
||||
_error(error);
|
||||
};
|
||||
|
||||
function _error(error) {
|
||||
window.clearTimeout(abortTimeout);
|
||||
xhr.abort();
|
||||
ajaxError(error.type, xhr, error.type, options);
|
||||
_removeScript();
|
||||
}
|
||||
|
||||
window[callbackName] = function (data) {
|
||||
window.clearTimeout(abortTimeout);
|
||||
ajaxSuccess(data, xhr, options);
|
||||
_removeScript();
|
||||
};
|
||||
|
||||
//
|
||||
serializeData(options);
|
||||
|
||||
script.src = options.url.replace(/=\?/, '=' + callbackName);
|
||||
//
|
||||
script.src = appendQuery(script.src, '_=' + (new Date()).getTime());
|
||||
//
|
||||
script.async = true;
|
||||
|
||||
// script charset
|
||||
if (options.scriptCharset) {
|
||||
script.charset = options.scriptCharset;
|
||||
}
|
||||
|
||||
//
|
||||
head.insertBefore(script, head.firstChild);
|
||||
|
||||
//
|
||||
if (options.timeout > 0) {
|
||||
abortTimeout = window.setTimeout(function () {
|
||||
xhr.abort();
|
||||
ajaxError('timeout', xhr, 'timeout', options);
|
||||
_removeScript();
|
||||
}, options.timeout);
|
||||
}
|
||||
|
||||
// remove script
|
||||
function _removeScript() {
|
||||
if (script.clearAttributes) {
|
||||
script.clearAttributes();
|
||||
} else {
|
||||
script.onload = script.onreadystatechange = script.onerror = null;
|
||||
}
|
||||
|
||||
if (script.parentNode) {
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
//
|
||||
script = null;
|
||||
|
||||
delete window[callbackName];
|
||||
}
|
||||
|
||||
return options.promise;
|
||||
}
|
||||
|
||||
// mime to data type
|
||||
function mimeToDataType(mime) {
|
||||
return mime && (mime === htmlType ? 'html' : mime === jsonType ? 'json' : xmlTypeRE.test(mime) && 'xml') || 'text'
|
||||
}
|
||||
|
||||
// append query
|
||||
function appendQuery(url, query) {
|
||||
return (url + '&' + query).replace(/[&?]{1,2}/, '?');
|
||||
}
|
||||
|
||||
// serialize data
|
||||
function serializeData(options) {
|
||||
// formData
|
||||
if (isObject(options) && !isFormData(options.data) && options.processData) {
|
||||
options.data = param(options.data);
|
||||
}
|
||||
|
||||
if (options.data && (!options.type || options.type.toUpperCase() === 'GET')) {
|
||||
options.url = appendQuery(options.url, options.data);
|
||||
}
|
||||
}
|
||||
|
||||
// serialize
|
||||
function serialize(params, obj, traditional, scope) {
|
||||
var _isArray = isArray(obj);
|
||||
|
||||
for (var key in obj) {
|
||||
var value = obj[key];
|
||||
|
||||
if (scope) {
|
||||
key = traditional ? scope : scope + '[' + (_isArray ? '' : key) + ']';
|
||||
}
|
||||
|
||||
// handle data in serializeArray format
|
||||
if (!scope && _isArray) {
|
||||
params.add(value.name, value.value);
|
||||
|
||||
}
|
||||
else if (traditional ? _isArray(value) : isObject(value)) {
|
||||
serialize(params, value, traditional, key);
|
||||
}
|
||||
else {
|
||||
params.add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// param
|
||||
function param(obj, traditional) {
|
||||
var params = [];
|
||||
//
|
||||
params.add = function (k, v) {
|
||||
this.push(encodeURIComponent(k) + '=' + encodeURIComponent(v));
|
||||
};
|
||||
serialize(params, obj, traditional);
|
||||
return params.join('&').replace('%20', '+');
|
||||
}
|
||||
|
||||
// extend
|
||||
function extend(target) {
|
||||
var slice = Array.prototype.slice;
|
||||
var args = slice.call(arguments, 1);
|
||||
//
|
||||
for (var i = 0, length = args.length; i < length; i++) {
|
||||
var source = args[i] || {};
|
||||
for (var key in source) {
|
||||
if (source.hasOwnProperty(key) && source[key] !== undefined) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
// is object
|
||||
function isObject(obj) {
|
||||
var type = typeof obj;
|
||||
return type === 'function' || type === 'object' && !!obj;
|
||||
}
|
||||
|
||||
// is formData
|
||||
function isFormData(obj) {
|
||||
return obj instanceof FormData;
|
||||
}
|
||||
|
||||
// is array
|
||||
function isArray(value) {
|
||||
return Object.prototype.toString.call(value) === "[object Array]";
|
||||
}
|
||||
|
||||
// is function
|
||||
function isFunction(value) {
|
||||
return typeof value === "function";
|
||||
}
|
||||
|
||||
// browser
|
||||
window.ajax = ajax;
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,460 +0,0 @@
|
||||
function Jessibuca(opt) {
|
||||
this.canvasElement = opt.canvas;
|
||||
this.contextOptions = opt.contextOptions;
|
||||
this.videoBuffer = opt.videoBuffer || 1
|
||||
if (!opt.forceNoGL) this.initContextGL();
|
||||
|
||||
if (this.contextGL) {
|
||||
this.initProgram();
|
||||
this.initBuffers();
|
||||
this.initTextures();
|
||||
};
|
||||
this.decoderWorker = new Worker(opt.decoder || '264_mp3.js')
|
||||
var _this = this
|
||||
function draw(output) {
|
||||
_this.drawNextOutputPicture(_this.width, _this.height, null, output)
|
||||
postMessage({ cmd: "setBuffer", buffer: output }, '*', [output[0].buffer, output[1].buffer, output[2].buffer])
|
||||
}
|
||||
this.decoderWorker.onmessage = function (event) {
|
||||
var msg = event.data
|
||||
switch (msg.cmd) {
|
||||
case "init":
|
||||
console.log("decoder worker init")
|
||||
postMessage({ cmd: "setVideoBuffer", time: _this.videoBuffer }, "*")
|
||||
if (_this.onLoad) {
|
||||
_this.onLoad()
|
||||
delete _this.onLoad;
|
||||
}
|
||||
break
|
||||
case "initSize":
|
||||
_this.width = msg.w
|
||||
_this.height = msg.h
|
||||
if (_this.isWebGL()) {
|
||||
// var buffer = new ArrayBuffer(msg.w * msg.h + (msg.w * msg.h >> 1))
|
||||
// this.postMessage({ cmd: "setBuffer", buffer: buffer }, [buffer])
|
||||
}
|
||||
else {
|
||||
_this.initRGB(msg.w, msg.h)
|
||||
}
|
||||
break
|
||||
case "render":
|
||||
if (_this.onPlay) {
|
||||
_this.onPlay()
|
||||
delete _this.onPlay;
|
||||
}
|
||||
// if (msg.compositionTime) {
|
||||
// console.log(msg.compositionTime)
|
||||
// setTimeout(draw, msg.compositionTime, msg.output)
|
||||
// } else {
|
||||
// draw(msg.output)
|
||||
// }
|
||||
draw(msg.output)
|
||||
break
|
||||
case "initAudio":
|
||||
_this.initAudioPlay(msg.frameCount, msg.samplerate, msg.channels)
|
||||
break
|
||||
case "playAudio":
|
||||
_this.playAudio(msg.buffer)
|
||||
break
|
||||
case "print":
|
||||
console.log(msg.text);
|
||||
break
|
||||
case "printErr":
|
||||
console.error(msg.text);
|
||||
break
|
||||
}
|
||||
}
|
||||
};
|
||||
window.AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
function _unlock() {
|
||||
var context = Jessibuca.prototype.audioContext = Jessibuca.prototype.audioContext || new window.AudioContext();
|
||||
context.resume();
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = context.createBuffer(1, 1, 22050);
|
||||
source.connect(context.destination);
|
||||
if (source.noteOn)
|
||||
source.noteOn(0);
|
||||
else
|
||||
source.start(0);
|
||||
}
|
||||
// document.addEventListener("mousedown", _unlock, true);
|
||||
// document.addEventListener("touchend", _unlock, true);
|
||||
Jessibuca.prototype.audioEnabled = function (flag) {
|
||||
if (flag) {
|
||||
_unlock()
|
||||
this.audioEnabled = function (flag) {
|
||||
if (flag) {
|
||||
this.audioContext.resume();
|
||||
} else {
|
||||
this.audioContext.suspend();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Jessibuca.prototype.playAudio = function (data) {
|
||||
var context = this.audioContext;
|
||||
var isPlaying = false;
|
||||
var isDecoding = false;
|
||||
if (!context) return false;
|
||||
var audioBuffers = [];
|
||||
var decodeQueue = []
|
||||
var _this = this
|
||||
var playNextBuffer = function (e) {
|
||||
// isPlaying = false;
|
||||
if (audioBuffers.length) {
|
||||
playBuffer(audioBuffers.shift())
|
||||
}
|
||||
//if (audioBuffers.length > 1) audioBuffers.shift();
|
||||
};
|
||||
var playBuffer = function (buffer) {
|
||||
isPlaying = true;
|
||||
var audioBufferSouceNode = context.createBufferSource();
|
||||
audioBufferSouceNode.buffer = buffer;
|
||||
audioBufferSouceNode.connect(context.destination);
|
||||
// audioBufferSouceNode.onended = playNextBuffer;
|
||||
audioBufferSouceNode.start();
|
||||
if (!_this.audioInterval) {
|
||||
_this.audioInterval = setInterval(playNextBuffer, buffer.duration * 1000 - 1);
|
||||
}
|
||||
// setTimeout(playNextBuffer, buffer.duration * 1000)
|
||||
}
|
||||
var tryPlay = function (buffer) {
|
||||
if (decodeQueue.length) {
|
||||
context.decodeAudioData(decodeQueue.shift(), tryPlay, console.error);
|
||||
} else {
|
||||
isDecoding = false
|
||||
}
|
||||
if (isPlaying) {
|
||||
audioBuffers.push(buffer);
|
||||
} else {
|
||||
playBuffer(buffer)
|
||||
}
|
||||
}
|
||||
var playAudio = function (data) {
|
||||
decodeQueue.push(...data)
|
||||
if (!isDecoding) {
|
||||
isDecoding = true
|
||||
context.decodeAudioData(decodeQueue.shift(), tryPlay, console.error);
|
||||
}
|
||||
}
|
||||
this.playAudio = playAudio
|
||||
playAudio(data)
|
||||
}
|
||||
Jessibuca.prototype.initAudioPlay = function (frameCount, samplerate, channels) {
|
||||
var context = this.audioContext;
|
||||
var isPlaying = false;
|
||||
var audioBuffers = [];
|
||||
if (!context) return false;
|
||||
var resampled = samplerate < 22050;
|
||||
var audioBuffer = resampled ? context.createBuffer(channels, frameCount << 1, samplerate << 1) : context.createBuffer(channels, frameCount, samplerate);
|
||||
var playNextBuffer = function () {
|
||||
isPlaying = false;
|
||||
console.log("~", audioBuffers.length)
|
||||
if (audioBuffers.length) {
|
||||
playAudio(audioBuffers.shift());
|
||||
}
|
||||
//if (audioBuffers.length > 1) audioBuffers.shift();
|
||||
};
|
||||
|
||||
var copyToCtxBuffer = channels > 1 ? function (fromBuffer) {
|
||||
for (var channel = 0; channel < channels; channel++) {
|
||||
var nowBuffering = audioBuffer.getChannelData(channel);
|
||||
if (resampled) {
|
||||
for (var i = 0; i < frameCount; i++) {
|
||||
nowBuffering[i * 2] = nowBuffering[i * 2 + 1] = fromBuffer[i * (channel + 1)] / 32768;
|
||||
}
|
||||
} else
|
||||
for (var i = 0; i < frameCount; i++) {
|
||||
nowBuffering[i] = fromBuffer[i * (channel + 1)] / 32768;
|
||||
}
|
||||
}
|
||||
} : function (fromBuffer) {
|
||||
var nowBuffering = audioBuffer.getChannelData(0);
|
||||
for (var i = 0; i < nowBuffering.length; i++) {
|
||||
nowBuffering[i] = fromBuffer[i] / 32768;
|
||||
}
|
||||
// nowBuffering.set(fromBuffer);
|
||||
};
|
||||
var playAudio = function (fromBuffer) {
|
||||
if (isPlaying) {
|
||||
audioBuffers.push(fromBuffer);
|
||||
console.log(audioBuffers.length)
|
||||
return;
|
||||
}
|
||||
isPlaying = true;
|
||||
copyToCtxBuffer(fromBuffer);
|
||||
var source = context.createBufferSource();
|
||||
source.buffer = audioBuffer;
|
||||
source.connect(context.destination);
|
||||
source.onended = playNextBuffer;
|
||||
//setTimeout(playNextBuffer, audioBufferTime-audioBuffers.length*200);
|
||||
source.start();
|
||||
};
|
||||
this.playAudio = playAudio;
|
||||
}
|
||||
/**
|
||||
* Returns true if the canvas supports WebGL
|
||||
*/
|
||||
Jessibuca.prototype.isWebGL = function () {
|
||||
return !!this.contextGL;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create the GL context from the canvas element
|
||||
*/
|
||||
Jessibuca.prototype.initContextGL = function () {
|
||||
var canvas = this.canvasElement;
|
||||
var gl = null;
|
||||
|
||||
var validContextNames = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"];
|
||||
var nameIndex = 0;
|
||||
|
||||
while (!gl && nameIndex < validContextNames.length) {
|
||||
var contextName = validContextNames[nameIndex];
|
||||
|
||||
try {
|
||||
if (this.contextOptions) {
|
||||
gl = canvas.getContext(contextName, this.contextOptions);
|
||||
} else {
|
||||
gl = canvas.getContext(contextName);
|
||||
};
|
||||
} catch (e) {
|
||||
gl = null;
|
||||
}
|
||||
|
||||
if (!gl || typeof gl.getParameter !== "function") {
|
||||
gl = null;
|
||||
}
|
||||
|
||||
++nameIndex;
|
||||
};
|
||||
|
||||
this.contextGL = gl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize GL shader program
|
||||
*/
|
||||
Jessibuca.prototype.initProgram = function () {
|
||||
var gl = this.contextGL;
|
||||
|
||||
var vertexShaderScript = [
|
||||
'attribute vec4 vertexPos;',
|
||||
'attribute vec4 texturePos;',
|
||||
'varying vec2 textureCoord;',
|
||||
|
||||
'void main()',
|
||||
'{',
|
||||
'gl_Position = vertexPos;',
|
||||
'textureCoord = texturePos.xy;',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
var fragmentShaderScript = [
|
||||
'precision highp float;',
|
||||
'varying highp vec2 textureCoord;',
|
||||
'uniform sampler2D ySampler;',
|
||||
'uniform sampler2D uSampler;',
|
||||
'uniform sampler2D vSampler;',
|
||||
'const mat4 YUV2RGB = mat4',
|
||||
'(',
|
||||
'1.1643828125, 0, 1.59602734375, -.87078515625,',
|
||||
'1.1643828125, -.39176171875, -.81296875, .52959375,',
|
||||
'1.1643828125, 2.017234375, 0, -1.081390625,',
|
||||
'0, 0, 0, 1',
|
||||
');',
|
||||
|
||||
'void main(void) {',
|
||||
'highp float y = texture2D(ySampler, textureCoord).r;',
|
||||
'highp float u = texture2D(uSampler, textureCoord).r;',
|
||||
'highp float v = texture2D(vSampler, textureCoord).r;',
|
||||
'gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
var vertexShader = gl.createShader(gl.VERTEX_SHADER);
|
||||
gl.shaderSource(vertexShader, vertexShaderScript);
|
||||
gl.compileShader(vertexShader);
|
||||
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
|
||||
console.log('Vertex shader failed to compile: ' + gl.getShaderInfoLog(vertexShader));
|
||||
}
|
||||
|
||||
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
gl.shaderSource(fragmentShader, fragmentShaderScript);
|
||||
gl.compileShader(fragmentShader);
|
||||
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
|
||||
console.log('Fragment shader failed to compile: ' + gl.getShaderInfoLog(fragmentShader));
|
||||
}
|
||||
|
||||
var program = gl.createProgram();
|
||||
gl.attachShader(program, vertexShader);
|
||||
gl.attachShader(program, fragmentShader);
|
||||
gl.linkProgram(program);
|
||||
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
||||
console.log('Program failed to compile: ' + gl.getProgramInfoLog(program));
|
||||
}
|
||||
|
||||
gl.useProgram(program);
|
||||
|
||||
this.shaderProgram = program;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize vertex buffers and attach to shader program
|
||||
*/
|
||||
Jessibuca.prototype.initBuffers = function () {
|
||||
var gl = this.contextGL;
|
||||
var program = this.shaderProgram;
|
||||
|
||||
var vertexPosBuffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);
|
||||
|
||||
var vertexPosRef = gl.getAttribLocation(program, 'vertexPos');
|
||||
gl.enableVertexAttribArray(vertexPosRef);
|
||||
gl.vertexAttribPointer(vertexPosRef, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
var texturePosBuffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.STATIC_DRAW);
|
||||
|
||||
var texturePosRef = gl.getAttribLocation(program, 'texturePos');
|
||||
gl.enableVertexAttribArray(texturePosRef);
|
||||
gl.vertexAttribPointer(texturePosRef, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
this.texturePosBuffer = texturePosBuffer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize GL textures and attach to shader program
|
||||
*/
|
||||
Jessibuca.prototype.initTextures = function () {
|
||||
var gl = this.contextGL;
|
||||
var program = this.shaderProgram;
|
||||
|
||||
var yTextureRef = this.initTexture();
|
||||
var ySamplerRef = gl.getUniformLocation(program, 'ySampler');
|
||||
gl.uniform1i(ySamplerRef, 0);
|
||||
this.yTextureRef = yTextureRef;
|
||||
|
||||
var uTextureRef = this.initTexture();
|
||||
var uSamplerRef = gl.getUniformLocation(program, 'uSampler');
|
||||
gl.uniform1i(uSamplerRef, 1);
|
||||
this.uTextureRef = uTextureRef;
|
||||
|
||||
var vTextureRef = this.initTexture();
|
||||
var vSamplerRef = gl.getUniformLocation(program, 'vSampler');
|
||||
gl.uniform1i(vSamplerRef, 2);
|
||||
this.vTextureRef = vTextureRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create and configure a single texture
|
||||
*/
|
||||
Jessibuca.prototype.initTexture = function () {
|
||||
var gl = this.contextGL;
|
||||
|
||||
var textureRef = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, textureRef);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
gl.bindTexture(gl.TEXTURE_2D, null);
|
||||
|
||||
return textureRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw picture data to the canvas.
|
||||
* If this object is using WebGL, the data must be an I420 formatted ArrayBuffer,
|
||||
* Otherwise, data must be an RGBA formatted ArrayBuffer.
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOutputPicture = function (width, height, croppingParams, data) {
|
||||
var gl = this.contextGL;
|
||||
if (gl) {
|
||||
this.drawNextOuptutPictureGL(width, height, croppingParams, data);
|
||||
} else {
|
||||
this.drawNextOuptutPictureRGBA(width, height, croppingParams, data);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the next output picture using WebGL
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOuptutPictureGL = function (width, height, croppingParams, data) {
|
||||
var gl = this.contextGL;
|
||||
var texturePosBuffer = this.texturePosBuffer;
|
||||
var yTextureRef = this.yTextureRef;
|
||||
var uTextureRef = this.uTextureRef;
|
||||
var vTextureRef = this.vTextureRef;
|
||||
this.contextGL.viewport(0, 0, this.canvasElement.width, this.canvasElement.height);
|
||||
// if (!croppingParams) {
|
||||
// gl.viewport(0, 0, width, height);
|
||||
// } else {
|
||||
// gl.viewport(0, 0, croppingParams.width, croppingParams.height);
|
||||
|
||||
// var tTop = croppingParams.top / height;
|
||||
// var tLeft = croppingParams.left / width;
|
||||
// var tBottom = croppingParams.height / height;
|
||||
// var tRight = croppingParams.width / width;
|
||||
// var texturePosValues = new Float32Array([tRight, tTop, tLeft, tTop, tRight, tBottom, tLeft, tBottom]);
|
||||
|
||||
// gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
|
||||
// gl.bufferData(gl.ARRAY_BUFFER, texturePosValues, gl.DYNAMIC_DRAW);
|
||||
// }
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[0]);
|
||||
|
||||
gl.activeTexture(gl.TEXTURE1);
|
||||
gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width / 2, height / 2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[1]);
|
||||
|
||||
gl.activeTexture(gl.TEXTURE2);
|
||||
gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width / 2, height / 2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, data[2]);
|
||||
|
||||
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw next output picture using ARGB data on a 2d canvas.
|
||||
*/
|
||||
Jessibuca.prototype.drawNextOuptutPictureRGBA = function (width, height, croppingParams, data) {
|
||||
// var canvas = this.canvasElement;
|
||||
//var argbData = data;
|
||||
//var ctx = canvas.getContext('2d');
|
||||
// var imageData = ctx.getImageData(0, 0, width, height);
|
||||
//this.imageData = this.ctx2d.getImageData(0, 0, width, height);
|
||||
this.imageData.data.set(data);
|
||||
//Module.print(typeof this.imageData.data);
|
||||
if (!croppingParams) {
|
||||
this.ctx2d.putImageData(this.imageData, 0, 0);
|
||||
} else {
|
||||
this.ctx2d.putImageData(this.imageData, -croppingParams.left, -croppingParams.top, 0, 0, croppingParams.width, croppingParams.height);
|
||||
}
|
||||
};
|
||||
Jessibuca.prototype.ctx2d = null;
|
||||
Jessibuca.prototype.imageData = null;
|
||||
Jessibuca.prototype.initRGB = function (width, height) {
|
||||
this.ctx2d = this.canvasElement.getContext('2d');
|
||||
this.imageData = this.ctx2d.getImageData(0, 0, width, height);
|
||||
this.clear = function () {
|
||||
this.ctx2d.clearRect(0, 0, width, height)
|
||||
};
|
||||
//Module.print(this.imageData);
|
||||
};
|
||||
Jessibuca.prototype.close = function () {
|
||||
if (this.audioInterval) {
|
||||
clearInterval(this.audioInterval)
|
||||
}
|
||||
this.decoderWorker.postMessage({ cmd: "close" })
|
||||
this.contextGL.clear(this.contextGL.COLOR_BUFFER_BIT);
|
||||
}
|
||||
Jessibuca.prototype.destroy = function(){
|
||||
this.decoderWorker.terminate()
|
||||
}
|
||||
Jessibuca.prototype.play = function (url) {
|
||||
this.decoderWorker.postMessage({ cmd: "play", url: url, isWebGL: this.isWebGL() })
|
||||
}
|
@@ -1,80 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div>Monibuca</div>
|
||||
<Menu mode="horizontal" :active-name="selectedMenu" style="position: absolute;top: 0;right: 0;">
|
||||
<MenuItem name="home" to="/">首页</MenuItem>
|
||||
<MenuItem name="docs" to="/docs" target="_blank">
|
||||
文档
|
||||
</MenuItem>
|
||||
<MenuItem name="console" to="console">
|
||||
控制台
|
||||
</MenuItem>
|
||||
<Submenu name="plugins">
|
||||
<template slot="title">
|
||||
内置插件
|
||||
</template>
|
||||
<MenuGroup title="发布者/订阅者">
|
||||
<MenuItem name="cluster">集群</MenuItem>
|
||||
<MenuItem name="rtmp">RTMP</MenuItem>
|
||||
</MenuGroup>
|
||||
<MenuGroup title="订阅者">
|
||||
<MenuItem name="jessica">Jessica</MenuItem>
|
||||
<MenuItem name="HDL">Http-Flv</MenuItem>
|
||||
<MenuItem name="record">录制Flv</MenuItem>
|
||||
</MenuGroup>
|
||||
<MenuGroup title="发布者">
|
||||
<MenuItem name="HLS">HLS</MenuItem>
|
||||
<MenuItem name="TS">TS</MenuItem>
|
||||
</MenuGroup>
|
||||
<MenuGroup title="钩子">
|
||||
<MenuItem name="Auth">验证</MenuItem>
|
||||
<MenuItem name="QoS">QoS</MenuItem>
|
||||
<MenuItem name="gateway">网关</MenuItem>
|
||||
</MenuGroup>
|
||||
</Submenu>
|
||||
<MenuItem name="4" to="about">
|
||||
支持
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<router-view class="content"></router-view>
|
||||
<div>Copyright © 2019-2020 dexter 苏ICP备20001212号</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
data(){
|
||||
return {
|
||||
selectedMenu:"home"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body,html{
|
||||
height: 100%;
|
||||
}
|
||||
#app {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #184c18;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
#app > div:first-child {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 30px;
|
||||
font-size: x-large;
|
||||
}
|
||||
.content{
|
||||
padding-top: 60px;
|
||||
}
|
||||
</style>
|
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 102 KiB |
@@ -1,50 +0,0 @@
|
||||
<template>
|
||||
<Modal
|
||||
v-bind="$attrs" draggable
|
||||
v-on="$listeners"
|
||||
:title="url"
|
||||
@on-ok="onClosePreview"
|
||||
@on-cancel="onClosePreview">
|
||||
<canvas id="canvas" width="488" height="275" style="background: black"/>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let h5lc = null;
|
||||
export default {
|
||||
name: 'Jessibuca',
|
||||
props: {
|
||||
audioEnabled: Boolean,
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
url:""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
audioEnabled(value){
|
||||
h5lc.audioEnabled(value)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
h5lc = new window.Jessibuca({
|
||||
canvas: document.getElementById("canvas"),
|
||||
decoder: "jessibuca/ff.js"
|
||||
});
|
||||
},
|
||||
destroyed() {
|
||||
this.onClosePreview()
|
||||
h5lc.destroy()
|
||||
},
|
||||
methods: {
|
||||
play(url){
|
||||
this.url = url
|
||||
h5lc.play(url)
|
||||
},
|
||||
onClosePreview() {
|
||||
h5lc.close();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,18 +0,0 @@
|
||||
<template>
|
||||
<Poptip trigger="hover" :content="'⌚️'+ new Date(value).toLocaleString()">
|
||||
<Time :time="new Date(value)"></Time>
|
||||
</Poptip>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "StartTime",
|
||||
props:{
|
||||
value:String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -1,13 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import './plugins/iview.js'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
@@ -1,6 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import ViewUI from 'view-design'
|
||||
|
||||
Vue.use(ViewUI)
|
||||
|
||||
import 'view-design/dist/styles/iview.css'
|
@@ -1,32 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Home from '../views/Home.vue'
|
||||
import About from '../views/About'
|
||||
import Console from '../views/Console'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: Home
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
component: About
|
||||
}, {
|
||||
path: '/console',
|
||||
name: 'console',
|
||||
component: Console
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes
|
||||
})
|
||||
|
||||
export default router
|
@@ -1,45 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
let summaryES = null
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
summary:{
|
||||
NetWork:[],
|
||||
Rooms:[],
|
||||
Memory:{
|
||||
Used: 0,
|
||||
Usage: 0
|
||||
},
|
||||
CPUUsage:0,
|
||||
HardDisk:{
|
||||
Used: 0,
|
||||
Usage: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
update(state,payload){
|
||||
Object.assign(state,payload)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
fetchSummary({commit}){
|
||||
summaryES = new EventSource(
|
||||
"//" + location.host + "/api/summary"
|
||||
);
|
||||
summaryES.onmessage = evt=>{
|
||||
if (!evt.data) return
|
||||
let summary = JSON.parse(evt.data)
|
||||
commit("update",{summary})
|
||||
}
|
||||
},
|
||||
stopFetchSummary(){
|
||||
summaryES.close()
|
||||
}
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
})
|
@@ -1,21 +0,0 @@
|
||||
<template>
|
||||
<div class="root">
|
||||
<h1>
|
||||
赞助 Monibuca 的研发
|
||||
</h1>
|
||||
<p>
|
||||
Monibuca 是采用 MIT 许可的开源项目,使用完全免费。 但是随着项目规模的增长,也需要有相应的资金支持才能持续项目的维护的开发。你可以通过下列的方法来赞助 Monibuca 的开发。
|
||||
</p>
|
||||
<img src="../assets/alipay.png">
|
||||
<img src="../assets/wechat.jpg">
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.root{
|
||||
background: lightgray;
|
||||
}
|
||||
.root>img{
|
||||
width: 300px;
|
||||
margin: 30px;
|
||||
}
|
||||
</style>
|
@@ -1,232 +0,0 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<ButtonGroup vertical>
|
||||
<Button icon="ios-folder"></Button>
|
||||
<Button icon="md-bug"></Button>
|
||||
<Button icon="md-settings"></Button>
|
||||
</ButtonGroup>
|
||||
<Card v-for="item in Rooms" :key="item.StreamPath" class="room">
|
||||
<p slot="title">
|
||||
{{typeMap[item.Type]||item.Type}}{{item.StreamPath}}
|
||||
</p>
|
||||
<StartTime slot="extra" :value="item.StartTime"></StartTime>
|
||||
<p>
|
||||
{{SoundFormat(item.AudioInfo.SoundFormat)}} {{item.AudioInfo.PacketCount}}
|
||||
{{SoundRate(item.AudioInfo.SoundRate)}} 声道:{{item.AudioInfo.SoundType}}
|
||||
</p>
|
||||
<p>
|
||||
{{CodecID(item.VideoInfo.CodecID)}} {{item.VideoInfo.PacketCount}}
|
||||
{{item.VideoInfo.SPSInfo.Width}}x{{item.VideoInfo.SPSInfo.Height}}
|
||||
</p>
|
||||
<Button @click="onShowDetail(item)">
|
||||
<Icon type="ios-people"/>
|
||||
{{item.SubscriberInfo?item.SubscriberInfo.length:0}}
|
||||
</Button>
|
||||
<Button v-if="item.Type" @click="preview(item)">
|
||||
<Icon type="md-eye"/>
|
||||
Preview
|
||||
</Button>
|
||||
<Button @click="stopRecord(item)" v-if="isRecording(item)">
|
||||
<Icon type="ios-radio-button-on" class="recording"/>
|
||||
Stop Rec
|
||||
</Button>
|
||||
<Button @click="record(item)" v-else>
|
||||
<Icon type="ios-radio-button-on"/>
|
||||
Rec
|
||||
</Button>
|
||||
</Card>
|
||||
<div v-if="Rooms.length==0" class="empty">
|
||||
<Icon type="md-wine" size="50"/>
|
||||
没有任何房间
|
||||
</div>
|
||||
<div class="status">
|
||||
<Alert>
|
||||
带宽消耗 📥:{{totalInNetSpeed}} 📤:{{totalOutNetSpeed}}
|
||||
</Alert>
|
||||
<Alert :type="memoryStatus">
|
||||
内存使用:{{networkFormat(Memory.Used,"M")}} 占比:{{Memory.Usage.toFixed(2)}}%
|
||||
</Alert>
|
||||
<Alert :type="cpuStatus">
|
||||
CPU使用:{{CPUUsage.toFixed(2)}}%
|
||||
</Alert>
|
||||
<Alert :type="hardDiskStatus">
|
||||
磁盘使用:{{networkFormat(HardDisk.Used,"M")}} 占比:{{HardDisk.Usage.toFixed(2)}}%
|
||||
</Alert>
|
||||
</div>
|
||||
<Jessibuca ref="jessibuca" v-model="showPreview"></Jessibuca>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapActions, mapState} from 'vuex'
|
||||
import Jessibuca from "../components/Jessibuca";
|
||||
import StartTime from "../components/StartTime";
|
||||
|
||||
const uintInc = {
|
||||
"": "K",
|
||||
K: "M",
|
||||
M: "G",
|
||||
G: null
|
||||
}
|
||||
const SoundFormat = {
|
||||
0: "Linear PCM, platform endian",
|
||||
1: "ADPCM",
|
||||
2: "MP3",
|
||||
3: "Linear PCM, little endian",
|
||||
4: "Nellymoser 16kHz mono",
|
||||
5: "Nellymoser 8kHz mono",
|
||||
6: "Nellymoser",
|
||||
7: "G.711 A-law logarithmic PCM",
|
||||
8: "G.711 mu-law logarithmic PCM",
|
||||
9: "reserved",
|
||||
10: "AAC",
|
||||
11: "Speex",
|
||||
14: "MP3 8Khz",
|
||||
15: "Device-specific sound"
|
||||
}
|
||||
const CodecID = {
|
||||
1: "JPEG (currently unused)",
|
||||
2: "Sorenson H.263",
|
||||
3: "Screen video",
|
||||
4: "On2 VP6",
|
||||
5: "On2 VP6 with alpha channel",
|
||||
6: "Screen video version 2",
|
||||
7: "AVC",
|
||||
12: "H265"
|
||||
}
|
||||
export default {
|
||||
name: "Console",
|
||||
components: {
|
||||
Jessibuca, StartTime
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showPreview: false,
|
||||
typeMap: {
|
||||
TS: "🎬", HLS: "🍎", "": "⏳", Match365: "🏆", RTMP: "📸"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
Rooms: state => state.summary.Rooms || [],
|
||||
Memory: state => state.summary.Memory,
|
||||
CPUUsage: state => state.summary.CPUUsage,
|
||||
HardDisk: state => state.summary.HardDisk,
|
||||
cpuStatus: state => {
|
||||
if (state.summary.CPUUsage > 99)
|
||||
return "error"
|
||||
return state.summary.CPUUsage > 50 ? "warning" : "success"
|
||||
},
|
||||
memoryStatus(state) {
|
||||
if (state.summary.CPUUsage > 99)
|
||||
return "error"
|
||||
return state.summary.CPUUsage > 50 ? "warning" : "success"
|
||||
},
|
||||
hardDiskStatus(state) {
|
||||
if (state.summary.CPUUsage > 99)
|
||||
return "error"
|
||||
return state.summary.CPUUsage > 50 ? "warning" : "success"
|
||||
},
|
||||
totalInNetSpeed(state) {
|
||||
return this.networkFormat(state.summary.NetWork.reduce((aac, c) => aac + c.ReceiveSpeed, 0)) + "/S"
|
||||
},
|
||||
totalOutNetSpeed(state) {
|
||||
return this.networkFormat(state.summary.NetWork.reduce((aac, c) => aac + c.SentSpeed, 0)) + "/S"
|
||||
}
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
...mapActions([
|
||||
'fetchSummary',
|
||||
'stopFetchSummary'
|
||||
]),
|
||||
preview(item) {
|
||||
this.$refs.jessibuca.play("ws://" + location.hostname + ":8080/" + item.StreamPath)
|
||||
this.showPreview = true
|
||||
}, onShowDetail() {
|
||||
// this.showDetail = true
|
||||
// this.currentSub = item
|
||||
},
|
||||
networkFormat(value, unit = "") {
|
||||
if (value > 1024 && uintInc[unit]) {
|
||||
return this.networkFormat(value / 1024, uintInc[unit])
|
||||
}
|
||||
return value.toFixed(2).replace(".00", "") + unit + "B"
|
||||
},
|
||||
SoundFormat(soundFormat) {
|
||||
return SoundFormat[soundFormat]
|
||||
},
|
||||
CodecID(codec) {
|
||||
return CodecID[codec]
|
||||
},
|
||||
SoundRate(rate) {
|
||||
return rate > 1000 ? (rate / 1000) + "kHz" : rate + "Hz"
|
||||
},
|
||||
record(item) {
|
||||
window.ajax.get("//" + location.host + "/api/record/flv",{streamPath:item.StreamPath})
|
||||
},
|
||||
stopRecord(item){
|
||||
window.ajax.get("//" + location.host + "/api/record/flv/stop",{streamPath:item.StreamPath})
|
||||
},
|
||||
isRecording(item) {
|
||||
return item.SubscriberInfo && item.SubscriberInfo.find(x => x.Type == "FlvRecord")
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchSummary()
|
||||
},
|
||||
destroyed() {
|
||||
this.stopFetchSummary()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@keyframes recording {
|
||||
0% {
|
||||
opacity: 0.2;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
|
||||
.recording {
|
||||
animation: recording 1s infinite;
|
||||
}
|
||||
|
||||
.layout {
|
||||
padding-bottom: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.room {
|
||||
width: 250px;
|
||||
margin: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.empty {
|
||||
color: #eb5e46;
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.status {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
left: 5px;
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
.status > div {
|
||||
margin: 0 5px;
|
||||
}
|
||||
</style>
|
@@ -1,53 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<img src="../assets/logo.png">
|
||||
<div>
|
||||
<p>
|
||||
Monibuca 是一个开源的Go语言实现的流媒体服务器开发框架
|
||||
</p>
|
||||
<Button type="success" to="/docs" target="_blank">🚀START</Button>
|
||||
<span style="margin: 0 10px"></span>
|
||||
<Button type="default" target="_blank" to="https://github.com/langhuihui/monibuca">
|
||||
<svg style="vertical-align: text-top" width="16" height="16" aria-labelledby="simpleicons-github-dark-icon" lang="" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-dark-icon" lang="en">GitHub Dark icon</title><path fill="#7F8C8D" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg>
|
||||
GITHUB</Button>
|
||||
</div>
|
||||
<Row style="margin: 30px;">
|
||||
<Col span="8">
|
||||
<Card :bordered="false" style="margin: 30px">
|
||||
<div slot="title" class="feature-title">⚡高性能</div>
|
||||
<div>针对流媒体服务器独特的性质进行的优化,充分利用Golang的goroutine的性质对大量的连接的读写进行合理的分配计算资源,以及尽可能的减少内存Copy操作。使用对象池减少Golang的GC时间。</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<Card :bordered="false" style="margin: 30px">
|
||||
<div slot="title" class="feature-title">🔧可扩展</div>
|
||||
<div>流媒体服务器的个性化定制变的更简单,基于Golang语言,开发效率更高,独创的插件机制,可以方便用户定制个性化的功能组合,更高效率的利用服务器资源。</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<Card :bordered="false" style="margin: 30px">
|
||||
<div slot="title" class="feature-title">📈可视化</div>
|
||||
<div>功能强大的仪表盘可以直观的看到服务器运行的状态、消耗的资源、以及其他统计信息。用户可以利用控制台对服务器进行配置和控制。点击右上角菜单栏里面的控制台,可以看到演示。</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.feature-title{
|
||||
color: #eb5e46;
|
||||
font-weight: bold;
|
||||
font-size: larger;
|
||||
}
|
||||
p {
|
||||
margin: 30px;
|
||||
font-size: 20px;
|
||||
}
|
||||
img{
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
@@ -1,10 +0,0 @@
|
||||
module.exports = {
|
||||
chainWebpack: config => {
|
||||
config.module
|
||||
.rule('vue')
|
||||
.use('iview-loader')
|
||||
.loader('iview-loader')
|
||||
.tap(()=> ({prefix: false}))
|
||||
.end()
|
||||
}
|
||||
}
|
46
dockerfile
Normal file
@@ -0,0 +1,46 @@
|
||||
FROM golang:1.17.0-alpine3.14 as builder
|
||||
|
||||
LABEL maintainer="yangshuhai@pdnews.cn"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 先装好基础依赖,减少在代码变化时的重复构建时间
|
||||
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.14/main" > /etc/apk/repositories
|
||||
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.14/community" >> /etc/apk/repositories
|
||||
RUN apk add --no-cache --update autoconf automake make gcc g++
|
||||
RUN go env -w GO111MODULE=on
|
||||
RUN go env -w GOPROXY=https://goproxy.cn,direct
|
||||
RUN go get -d github.com/Monibuca/engine/v3@v3.4.7
|
||||
RUN go get -d github.com/Monibuca/plugin-gateway/v3@v3.0.10
|
||||
RUN go get -d github.com/Monibuca/plugin-gb28181/v3@v3.0.2
|
||||
RUN go get -d github.com/Monibuca/plugin-hdl/v3@v3.0.5
|
||||
RUN go get -d github.com/Monibuca/plugin-hls/v3@v3.0.6
|
||||
RUN go get -d github.com/Monibuca/plugin-jessica/v3@v3.0.0
|
||||
RUN go get -d github.com/Monibuca/plugin-logrotate/v3@v3.0.0
|
||||
RUN go get -d github.com/Monibuca/plugin-record/v3@v3.0.0
|
||||
RUN go get -d github.com/Monibuca/plugin-rtmp/v3@v3.0.1
|
||||
RUN go get -d github.com/Monibuca/plugin-rtsp/v3@v3.0.7
|
||||
RUN go get -d github.com/Monibuca/plugin-summary@v1.0.0
|
||||
RUN go get -d github.com/Monibuca/plugin-ts/v3@v3.0.1
|
||||
RUN go get -d github.com/Monibuca/plugin-webrtc/v3@v3.0.3
|
||||
|
||||
# 再复制代码进行编译,可节省大量构建时间
|
||||
COPY . .
|
||||
RUN go mod tidy
|
||||
RUN GOOS=linux go build -o m7s
|
||||
|
||||
# 构建完成则将成品复制到新的镜像中,减小镜像大小,可以考虑添加 upx 进一步减少空间
|
||||
FROM alpine:3.14
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/m7s /app/m7s
|
||||
COPY config.toml /app/config.toml
|
||||
RUN /app/m7s --help
|
||||
|
||||
EXPOSE 554
|
||||
EXPOSE 1935
|
||||
EXPOSE 5060
|
||||
EXPOSE 8081
|
||||
EXPOSE 8082
|
||||
|
||||
CMD ["/app/m7s", "-c", "/app/config.toml"]
|
47
go.mod
@@ -1,17 +1,38 @@
|
||||
module github.com/langhuihui/monibuca
|
||||
module github.com/langhuihui/monibuca/v3
|
||||
|
||||
go 1.13
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
|
||||
github.com/funny/slab v0.0.0-20180511031532-b1fad5e5d478
|
||||
github.com/funny/utest v0.0.0-20161029064919-43870a374500 // indirect
|
||||
github.com/go-ole/go-ole v1.2.4 // indirect
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee // indirect
|
||||
github.com/gobwas/pool v0.2.0 // indirect
|
||||
github.com/gobwas/ws v1.0.2
|
||||
github.com/quangngotan95/go-m3u8 v0.1.0
|
||||
github.com/shirou/gopsutil v2.19.12+incompatible
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 // indirect
|
||||
github.com/Monibuca/engine/v3 v3.5.1
|
||||
github.com/Monibuca/plugin-gateway/v3 v3.0.14
|
||||
github.com/Monibuca/plugin-gb28181/v3 v3.0.8
|
||||
github.com/Monibuca/plugin-hdl/v3 v3.0.7
|
||||
github.com/Monibuca/plugin-hls/v3 v3.0.6
|
||||
github.com/Monibuca/plugin-jessica/v3 v3.0.0
|
||||
github.com/Monibuca/plugin-logrotate/v3 v3.0.0
|
||||
github.com/Monibuca/plugin-record/v3 v3.0.0
|
||||
github.com/Monibuca/plugin-rtmp/v3 v3.0.3
|
||||
github.com/Monibuca/plugin-rtsp/v3 v3.0.8
|
||||
github.com/Monibuca/plugin-summary v1.0.0
|
||||
github.com/Monibuca/plugin-ts/v3 v3.0.1
|
||||
github.com/Monibuca/plugin-webrtc/v3 v3.0.3
|
||||
github.com/Monibuca/utils/v3 v3.0.6 // indirect
|
||||
)
|
||||
|
||||
// replace github.com/Monibuca/plugin-ffmpeg => ../plugin-ffmpeg
|
||||
// replace github.com/Monibuca/plugin-webrtc/v3 => ../plugin-webrtc
|
||||
// replace github.com/Monibuca/plugin-gateway/v3 => ../plugin-gateway
|
||||
|
||||
// replace github.com/Monibuca/plugin-rtsp/v3 => ../plugin-rtsp
|
||||
|
||||
// replace github.com/Monibuca/plugin-gb28181/v3 => ../plugin-gb28181
|
||||
|
||||
// replace github.com/Monibuca/plugin-rtmp/v3 => ../plugin-rtmp
|
||||
|
||||
// replace github.com/Monibuca/plugin-hls/v3 => ../plugin-hls
|
||||
|
||||
// replace github.com/Monibuca/plugin-hdl/v3 => ../plugin-hdl
|
||||
|
||||
// replace github.com/Monibuca/engine/v3 => ../engine
|
||||
|
||||
// replace github.com/Monibuca/plugin-summary => ../plugin-summary
|
||||
|
288
go.sum
@@ -1,22 +1,280 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
|
||||
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/Monibuca/engine/v3 v3.1.0/go.mod h1:yz6cssED2VlYu+g/LrxseBB9pcvsLM/o2QXa4gVY650=
|
||||
github.com/Monibuca/engine/v3 v3.4.1/go.mod h1:rgAUey5ziRhlh6WugWyA5fYKyGOvcwhtTMDk4sukE7E=
|
||||
github.com/Monibuca/engine/v3 v3.4.5/go.mod h1:Dik9pFxU9TFI5vj8Sv5QXZM+ooCs2fm9P7Uhe4yYNkQ=
|
||||
github.com/Monibuca/engine/v3 v3.5.0/go.mod h1:yNiVKeHxgv+Ez+f2RHXMkXoa5Oxv+G7Ch+MJdHi7ing=
|
||||
github.com/Monibuca/engine/v3 v3.5.1 h1:3AX+FwxerMw3JuyGXIOd/1dYCjA3IzWLKH/zq/GWe20=
|
||||
github.com/Monibuca/engine/v3 v3.5.1/go.mod h1:yNiVKeHxgv+Ez+f2RHXMkXoa5Oxv+G7Ch+MJdHi7ing=
|
||||
github.com/Monibuca/plugin-gateway/v3 v3.0.14 h1:gCQyOmdhOSNi8SMPcm11eT2P/Qi1tPzOaAX450F/gK4=
|
||||
github.com/Monibuca/plugin-gateway/v3 v3.0.14/go.mod h1:Pw5seYubBswGoF4knryLbLp6qrkYPwg3a7ZupgOir/4=
|
||||
github.com/Monibuca/plugin-gb28181/v3 v3.0.8 h1:UMLoxZfIqsyV/vBldx0lt0LU5i2jvlMB8Yboms9vvKA=
|
||||
github.com/Monibuca/plugin-gb28181/v3 v3.0.8/go.mod h1:EIu6vD1irPweLcA+1dC4k05wVe6ygYn6ErMfEx+UYPo=
|
||||
github.com/Monibuca/plugin-hdl/v3 v3.0.7 h1:caNQwYzOVYgAxGksTEYVey9LW/7v1VlvgwSYqANHlZ0=
|
||||
github.com/Monibuca/plugin-hdl/v3 v3.0.7/go.mod h1:ImBolaupuPvXGoWD5hOUUMvSPPuzrg2lzVWqhcXmdVA=
|
||||
github.com/Monibuca/plugin-hls/v3 v3.0.6 h1:WfM9BeTnezQJK6WmC40A3yyxXXGFqJNMePvcjKtYa+M=
|
||||
github.com/Monibuca/plugin-hls/v3 v3.0.6/go.mod h1:HRfFcEfpBZYrbtj4j46wLhYuAcZdTukzpw87CLf8FcE=
|
||||
github.com/Monibuca/plugin-jessica/v3 v3.0.0 h1:ArSiHOHfcekBfUOJMFZ0IJSbP/B1TnvcC5gegTpcbDw=
|
||||
github.com/Monibuca/plugin-jessica/v3 v3.0.0/go.mod h1:pf2lC2r3ZC1DYffW12zDPJH1sX59suI9JNXXuokZdbE=
|
||||
github.com/Monibuca/plugin-logrotate/v3 v3.0.0 h1:lWLgfKx2tVmXomzmZNACDzl/8HCHAkxyAmxT+ReLa9g=
|
||||
github.com/Monibuca/plugin-logrotate/v3 v3.0.0/go.mod h1:OltyTXYmIGyUaZap+/qyEm87HVmn14PzEUCtAmNAUUg=
|
||||
github.com/Monibuca/plugin-record/v3 v3.0.0 h1:449s+La2O5in0jaIdA94iK3QIS1s+G73VQXeLUiciN0=
|
||||
github.com/Monibuca/plugin-record/v3 v3.0.0/go.mod h1:71pviyOflKsNq+ijPKOgcsKqZkvZ91PzJxLJWPDzYe0=
|
||||
github.com/Monibuca/plugin-rtmp/v3 v3.0.3 h1:pXVmMwZ8yb2eoiOm3PGSCr7C9D6MtfTG4ghIH3oJte0=
|
||||
github.com/Monibuca/plugin-rtmp/v3 v3.0.3/go.mod h1:subd/7X5wcPbt5PDc0tbJ9RqNkvnrLJGj05RsYw25A8=
|
||||
github.com/Monibuca/plugin-rtsp/v3 v3.0.8 h1:wKGcTxwyZdG63AR5ZW9M5vYfUvMHY/iwmsq56XibEfQ=
|
||||
github.com/Monibuca/plugin-rtsp/v3 v3.0.8/go.mod h1:byXGE5BxFv0RpcoOjcQRt7B7mZvrgNuVpRn0kJtFIkU=
|
||||
github.com/Monibuca/plugin-summary v1.0.0 h1:tWL7KWw5mcep2jAhG3Gzd1DCiLSyCl3u3nmJtYkqGFA=
|
||||
github.com/Monibuca/plugin-summary v1.0.0/go.mod h1:rpSCVcPrecGlgT+aoCYsA6MawsE6ELT2mMGYYlSfTWo=
|
||||
github.com/Monibuca/plugin-ts/v3 v3.0.0/go.mod h1:S+sUqUbZTiRws/GHoxcVVQdhOcuUQUxoAGDeQOAgKw0=
|
||||
github.com/Monibuca/plugin-ts/v3 v3.0.1 h1:WPjDsv7s1aqDcpBzPJrC9CvaHZvnDf92qEQaBx6oR3c=
|
||||
github.com/Monibuca/plugin-ts/v3 v3.0.1/go.mod h1:Xndravs2PFGXHr4ZtAZ+azPBjDBBTB8ZanP8zrvu11o=
|
||||
github.com/Monibuca/plugin-webrtc/v3 v3.0.3 h1:MWIQEZwIlxlruEU5rxiH7KhhKyCp3fZf0qrxF2gFd7Y=
|
||||
github.com/Monibuca/plugin-webrtc/v3 v3.0.3/go.mod h1:eH8O1nvkxpHJVmasyXK1r/oOsAuXdwQ8TvkyVLR5Crg=
|
||||
github.com/Monibuca/utils/v3 v3.0.0/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
|
||||
github.com/Monibuca/utils/v3 v3.0.5/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
|
||||
github.com/Monibuca/utils/v3 v3.0.6 h1:Ya1KjxmirzHnaLneOgbopzMm9NhJtZxD4XqePefOYZw=
|
||||
github.com/Monibuca/utils/v3 v3.0.6/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
|
||||
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
|
||||
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
|
||||
github.com/agiledragon/gomonkey/v2 v2.2.0 h1:QJWqpdEhGV/JJy70sZ/LDnhbSlMrqHAWHcNOjz1kyuI=
|
||||
github.com/agiledragon/gomonkey/v2 v2.2.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
|
||||
github.com/aler9/gortsplib v0.0.0-20211212220644-6f374e396529 h1:j2tfs+eUubyZnuwmYWzK+IS681IixfUyD8bivz4sqAw=
|
||||
github.com/aler9/gortsplib v0.0.0-20211212220644-6f374e396529/go.mod h1:fyQrQyHo8QvdR/h357tkv1g36VesZlzEPsdAu2VrHHc=
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM=
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
|
||||
github.com/asticode/go-astikit v0.20.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
|
||||
github.com/asticode/go-astits v1.10.0/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ=
|
||||
github.com/cnotch/apirouter v0.0.0-20200731232942-89e243a791f3/go.mod h1:5deJPLON/x/s2dLOQfuKS0lenhOIT4xX0pvtN/OEIuY=
|
||||
github.com/cnotch/ipchub v1.1.0 h1:hH0lh2mU3AZXPiqMwA0pdtqrwo7PFIMRGush9OobMUs=
|
||||
github.com/cnotch/ipchub v1.1.0/go.mod h1:2PbeBs2q2VxxTVCn1eYCDwpAWuVXbq1+N0FU7GimOH4=
|
||||
github.com/cnotch/loader v0.0.0-20200405015128-d9d964d09439/go.mod h1:oWpDagHB6p+Kqqq7RoRZKyC4XAXft50hR8pbTxdbYYs=
|
||||
github.com/cnotch/queue v0.0.0-20200326024423-6e88bdbf2ad4/go.mod h1:zOssjAlNusOxvtaqT+EMA+Iyi8rrtKr4/XfzN1Fgoeg=
|
||||
github.com/cnotch/queue v0.0.0-20201224060551-4191569ce8f6/go.mod h1:zOssjAlNusOxvtaqT+EMA+Iyi8rrtKr4/XfzN1Fgoeg=
|
||||
github.com/cnotch/scheduler v0.0.0-20200522024700-1d2da93eefc5/go.mod h1:F4GE3SZkJZ8an1Y0ZCqvSM3jeozNuKzoC67erG1PhIo=
|
||||
github.com/cnotch/xlog v0.0.0-20201208005456-cfda439cd3a0/go.mod h1:RW9oHsR79ffl3sR3yMGgxYupMn2btzdtJUwoxFPUE5E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emitter-io/address v1.0.0/go.mod h1:GfZb5+S/o8694B1GMGK2imUYQyn2skszMvGNA5D84Ug=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/funny/slab v0.0.0-20180511031532-b1fad5e5d478 h1:Db9StoJ6RZN3YttC0Pm0I4Y5izITRYch3RMbT59BYN0=
|
||||
github.com/funny/slab v0.0.0-20180511031532-b1fad5e5d478/go.mod h1:0j1+svBH8ABEIPdUP0AIg4qedsybnXGJBakCEw8cfoo=
|
||||
github.com/funny/utest v0.0.0-20161029064919-43870a374500 h1:Z0r1CZnoIWFB/Uiwh1BU5FYmuFe6L5NPi6XWQEmsTRg=
|
||||
github.com/funny/utest v0.0.0-20161029064919-43870a374500/go.mod h1:mUn39tBov9jKnTWV1RlOYoNzxdBFHiSzXWdY1FoNGGg=
|
||||
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
||||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY=
|
||||
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
|
||||
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
|
||||
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
|
||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA=
|
||||
github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/icza/bitio v1.0.0 h1:squ/m1SHyFeCA6+6Gyol1AxV9nmPPlJFT8c2vKdj3U8=
|
||||
github.com/icza/bitio v1.0.0/go.mod h1:0jGnlLAx8MKMr9VGnn/4YrvZiprkvBelsVIbA9Jjr9A=
|
||||
github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6 h1:8UsGZ2rr2ksmEru6lToqnXgA8Mz1DP11X4zSJ159C3k=
|
||||
github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6/go.mod h1:xQig96I1VNBDIWGCdTt54nHt6EeI639SmHycLYL7FkA=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/kelindar/process v0.0.0-20170730150328-69a29e249ec3/go.mod h1:+lTCLnZFXOkqwD8sLPl6u4erAc0cP8wFegQHfipz7KE=
|
||||
github.com/kelindar/rate v1.0.0/go.mod h1:AjT4G+hTItNwt30lucEGZIz8y7Uk5zPho6vurIZ+1Es=
|
||||
github.com/kelindar/tcp v1.0.0/go.mod h1:JB5hj1cshLU60XrLij2BBxW3JQ4hOye8vqbyvuKb52k=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
|
||||
github.com/pion/datachannel v1.4.21 h1:3ZvhNyfmxsAqltQrApLPQMhSFNA+aT87RqyCq4OXmf0=
|
||||
github.com/pion/datachannel v1.4.21/go.mod h1:oiNyP4gHx2DIwRzX/MFyH0Rz/Gz05OgBlayAI2hAWjg=
|
||||
github.com/pion/dtls/v2 v2.0.9/go.mod h1:O0Wr7si/Zj5/EBFlDzDd6UtVxx25CE1r7XM7BQKYQho=
|
||||
github.com/pion/dtls/v2 v2.0.10 h1:wgys7gPR1NMbWjmjJ3CW7lkUGaun8djgH8nahpNLnxI=
|
||||
github.com/pion/dtls/v2 v2.0.10/go.mod h1:00OxfeCRWHShcqT9jx8pKKmBWuTt0NCZoVPCaC4VKvU=
|
||||
github.com/pion/ice/v2 v2.1.13 h1:/YNYcIw56LT/whwuzkTnrprcRnapj2ZNqUsR0W8elmo=
|
||||
github.com/pion/ice/v2 v2.1.13/go.mod h1:ovgYHUmwYLlRvcCLI67PnQ5YGe+upXZbGgllBDG/ktU=
|
||||
github.com/pion/interceptor v0.1.0 h1:SlXKaDlEvSl7cr4j8fJykzVz4UdH+7UDtcvx+u01wLU=
|
||||
github.com/pion/interceptor v0.1.0/go.mod h1:j5NIl3tJJPB3u8+Z2Xz8MZs/VV6rc+If9mXEKNuFmEM=
|
||||
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
||||
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
|
||||
github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
|
||||
github.com/pion/mdns v0.0.5/go.mod h1:UgssrvdD3mxpi8tMxAXbsppL3vJ4Jipw1mTCW+al01g=
|
||||
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
|
||||
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
|
||||
github.com/pion/rtcp v1.2.4/go.mod h1:52rMNPWFsjr39z9B9MhnkqhPLoeHTv1aN63o/42bWE0=
|
||||
github.com/pion/rtcp v1.2.6/go.mod h1:52rMNPWFsjr39z9B9MhnkqhPLoeHTv1aN63o/42bWE0=
|
||||
github.com/pion/rtcp v1.2.8 h1:Cys8X6r0xxU65ESTmXkqr8eU1Q1Wx+lNkoZCUH4zD7E=
|
||||
github.com/pion/rtcp v1.2.8/go.mod h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo=
|
||||
github.com/pion/rtp v1.6.1/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/rtp v1.6.2/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/rtp v1.6.5/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/rtp v1.7.0/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/rtp v1.7.2/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/rtp v1.7.4 h1:4dMbjb1SuynU5OpA3kz1zHK+u+eOCQjW3MAeVHf1ODA=
|
||||
github.com/pion/rtp v1.7.4/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/sctp v1.7.10/go.mod h1:EhpTUQu1/lcK3xI+eriS6/96fWetHGCvBi9MSsnaBN0=
|
||||
github.com/pion/sctp v1.7.12 h1:GsatLufywVruXbZZT1CKg+Jr8ZTkwiPnmUC/oO9+uuY=
|
||||
github.com/pion/sctp v1.7.12/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
|
||||
github.com/pion/sdp/v3 v3.0.2/go.mod h1:bNiSknmJE0HYBprTHXKPQ3+JjacTv5uap92ueJZKsRk=
|
||||
github.com/pion/sdp/v3 v3.0.4 h1:2Kf+dgrzJflNCSw3TV5v2VLeI0s/qkzy2r5jlR0wzf8=
|
||||
github.com/pion/sdp/v3 v3.0.4/go.mod h1:bNiSknmJE0HYBprTHXKPQ3+JjacTv5uap92ueJZKsRk=
|
||||
github.com/pion/srtp/v2 v2.0.5 h1:ks3wcTvIUE/GHndO3FAvROQ9opy0uLELpwHJaQ1yqhQ=
|
||||
github.com/pion/srtp/v2 v2.0.5/go.mod h1:8k6AJlal740mrZ6WYxc4Dg6qDqqhxoRG2GSjlUhDF0A=
|
||||
github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg=
|
||||
github.com/pion/stun v0.3.5/go.mod h1:gDMim+47EeEtfWogA37n6qXZS88L5V6LqFcf+DZA2UA=
|
||||
github.com/pion/transport v0.10.1/go.mod h1:PBis1stIILMiis0PewDw91WJeLJkyIMcEk+DwKOzf4A=
|
||||
github.com/pion/transport v0.12.2/go.mod h1:N3+vZQD9HlDP5GWkZ85LohxNsDcNgofQmyL6ojX5d8Q=
|
||||
github.com/pion/transport v0.12.3 h1:vdBfvfU/0Wq8kd2yhUMSDB/x+O4Z9MYVl2fJ5BT4JZw=
|
||||
github.com/pion/transport v0.12.3/go.mod h1:OViWW9SP2peE/HbwBvARicmAVnesphkNkCVZIWJ6q9A=
|
||||
github.com/pion/turn/v2 v2.0.5 h1:iwMHqDfPEDEOFzwWKT56eFmh6DYC6o/+xnLAEzgISbA=
|
||||
github.com/pion/turn/v2 v2.0.5/go.mod h1:APg43CFyt/14Uy7heYUOGWdkem/Wu4PhCO/bjyrTqMw=
|
||||
github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o=
|
||||
github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
|
||||
github.com/pion/webrtc/v3 v3.1.6 h1:r6WQRayW2SyKTYeRl4vBUQ43XXp7RSwBJ9+tNQWI5zQ=
|
||||
github.com/pion/webrtc/v3 v3.1.6/go.mod h1:tkwdWNYdZhc200hH/wPx6AtNo/rcTAM6MICA6dg1je8=
|
||||
github.com/pixelbender/go-sdp v1.1.0/go.mod h1:6IBlz9+BrUHoFTea7gcp4S54khtOhjCW/nVDLhmZBAs=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/q191201771/naza v0.19.1 h1:4KLcxT2CHztO+7miPRtBG3FFgadSQYQw1gPPPKN7rnY=
|
||||
github.com/q191201771/naza v0.19.1/go.mod h1:5LeGupZZFtYP1g/S203n9vXoUNVdlRnPIfM6rExjqt0=
|
||||
github.com/quangngotan95/go-m3u8 v0.1.0 h1:8oseBjJn5IKHQKdRZwSNskkua3NLrRtlvXXtoVgBzMk=
|
||||
github.com/quangngotan95/go-m3u8 v0.1.0/go.mod h1:smzfWHlYpBATVNu1GapKLYiCtEo5JxridIgvvudZ+Wc=
|
||||
github.com/shirou/gopsutil v2.19.12+incompatible h1:WRstheAymn1WOPesh+24+bZKFkqrdCR8JOc77v4xV3Q=
|
||||
github.com/shirou/gopsutil v2.19.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
|
||||
github.com/shirou/gopsutil v3.21.6+incompatible h1:mmZtAlWSd8U2HeRTjswbnDLPxqsEoK01NK+GZ1P+nEM=
|
||||
github.com/shirou/gopsutil v3.21.6+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo=
|
||||
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
|
||||
github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ=
|
||||
github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/zhangpeihao/goamf v0.0.0-20140409082417-3ff2c19514a8 h1:r1JUI0wuHlgRb8jNd3zPBBkjUdrjpVKr8SdJWc8ntg8=
|
||||
github.com/zhangpeihao/goamf v0.0.0-20140409082417-3ff2c19514a8/go.mod h1:RZd/IqzNpFANwOB9rVmsnAYpo/6KesK4PqrN1a5cRgg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik=
|
||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
38
goreleaser.yml
Executable file
@@ -0,0 +1,38 @@
|
||||
project_name: m7s
|
||||
archives:
|
||||
-
|
||||
files:
|
||||
- config.toml
|
||||
builds:
|
||||
- env: [CGO_ENABLED=0]
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
#dockers:
|
||||
# - image_templates: ["ghcr.io/goreleaser/example:{{ .Version }}"]
|
||||
# dockerfile: Dockerfile
|
||||
# build_flag_templates:
|
||||
# - --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||
# - --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||
# - --label=org.opencontainers.image.url=https://github.com/goreleaser/example
|
||||
# - --label=org.opencontainers.image.source=https://github.com/goreleaser/example
|
||||
# - --label=org.opencontainers.image.version={{ .Version }}
|
||||
# - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||
# - --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||
# - --label=org.opencontainers.image.licenses=MIT
|
||||
#nfpms:
|
||||
# - maintainer: Carlos A Becker <root@carlosbecker.dev>
|
||||
# description: Sample project.
|
||||
# homepage: https://github.com/caarlos0/tasktimer
|
||||
# license: MIT
|
||||
# formats:
|
||||
# - deb
|
||||
# - rpm
|
||||
# - apk
|
46
main.go
@@ -1,14 +1,48 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
. "github.com/langhuihui/monibuca/monica"
|
||||
_ "github.com/langhuihui/monibuca/plugins"
|
||||
"log"
|
||||
"context"
|
||||
"flag"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
. "github.com/Monibuca/engine/v3"
|
||||
// _ "github.com/Monibuca/plugin-ffmpeg"
|
||||
// _ "github.com/Monibuca/plugin-cluster"
|
||||
_ "github.com/Monibuca/plugin-gateway/v3"
|
||||
|
||||
_ "github.com/Monibuca/plugin-gb28181/v3"
|
||||
_ "github.com/Monibuca/plugin-hdl/v3"
|
||||
_ "github.com/Monibuca/plugin-hls/v3"
|
||||
_ "github.com/Monibuca/plugin-jessica/v3"
|
||||
_ "github.com/Monibuca/plugin-logrotate/v3"
|
||||
_ "github.com/Monibuca/plugin-record/v3"
|
||||
_ "github.com/Monibuca/plugin-rtmp/v3"
|
||||
_ "github.com/Monibuca/plugin-rtsp/v3"
|
||||
_ "github.com/Monibuca/plugin-summary"
|
||||
_ "github.com/Monibuca/plugin-ts/v3"
|
||||
_ "github.com/Monibuca/plugin-webrtc/v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.SetOutput(os.Stdout)
|
||||
Run("config.toml")
|
||||
select {}
|
||||
addr := flag.String("c", "config.toml", "config file")
|
||||
flag.Parse()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
go waiter(cancel)
|
||||
if _, err := os.Stat(*addr); err == nil {
|
||||
Run(ctx, *addr)
|
||||
} else {
|
||||
Run(ctx, filepath.Join(filepath.Dir(os.Args[0]), *addr))
|
||||
}
|
||||
}
|
||||
|
||||
func waiter(cancel context.CancelFunc) {
|
||||
sigc := make(chan os.Signal, 1)
|
||||
signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM)
|
||||
defer signal.Stop(sigc)
|
||||
<-sigc
|
||||
cancel()
|
||||
}
|
||||
|
BIN
monibuca_windows_amd64.syso
Normal file
@@ -1,307 +0,0 @@
|
||||
package avformat
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/langhuihui/monibuca/monica/util"
|
||||
)
|
||||
|
||||
const (
|
||||
ADTS_HEADER_SIZE = 7
|
||||
)
|
||||
|
||||
// ISO/IEC 14496-15 11(16)/page
|
||||
//
|
||||
// Advanced Video Coding
|
||||
//
|
||||
|
||||
type AVCDecoderConfigurationRecord struct {
|
||||
ConfigurationVersion byte // 8 bits Version
|
||||
AVCProfileIndication byte // 8 bits
|
||||
ProfileCompatibility byte // 8 bits
|
||||
AVCLevelIndication byte // 8 bits
|
||||
Reserved1 byte // 6 bits
|
||||
LengthSizeMinusOne byte // 2 bits 非常重要,每个NALU包前面都(lengthSizeMinusOne & 3)+1个字节的NAL包长度描述
|
||||
Reserved2 byte // 3 bits
|
||||
NumOfSequenceParameterSets byte // 5 bits SPS 的个数,计算方法是 numOfSequenceParameterSets & 0x1F
|
||||
NumOfPictureParameterSets byte // 8 bits PPS 的个数
|
||||
|
||||
SequenceParameterSetLength uint16 // 16 byte SPS Length
|
||||
SequenceParameterSetNALUnit []byte // n byte SPS
|
||||
PictureParameterSetLength uint16 // 16 byte PPS Length
|
||||
PictureParameterSetNALUnit []byte // n byte PPS
|
||||
}
|
||||
|
||||
//func (p *AVCDecoderConfigurationRecord) Marshal(b []byte) (n int) {
|
||||
// b[0] = 1
|
||||
// b[1] = p.AVCProfileIndication
|
||||
// b[2] = p.ProfileCompatibility
|
||||
// b[3] = p.AVCLevelIndication
|
||||
// b[4] = p.LengthSizeMinusOne | 0xfc
|
||||
// b[5] = uint8(len(p.SPS)) | 0xe0
|
||||
// n += 6
|
||||
//
|
||||
// for _, sps := range p.SPS {
|
||||
// pio.PutU16BE(b[n:], uint16(len(sps)))
|
||||
// n += 2
|
||||
// copy(b[n:], sps)
|
||||
// n += len(sps)
|
||||
// }
|
||||
//
|
||||
// b[n] = uint8(len(p.PPS))
|
||||
// n++
|
||||
//
|
||||
// for _, pps := range p.PPS {
|
||||
// pio.PutU16BE(b[n:], uint16(len(pps)))
|
||||
// n += 2
|
||||
// copy(b[n:], pps)
|
||||
// n += len(pps)
|
||||
// }
|
||||
//
|
||||
// return
|
||||
//}
|
||||
var ErrDecconfInvalid = errors.New("decode error")
|
||||
|
||||
func (p *AVCDecoderConfigurationRecord) Unmarshal(b []byte) (n int, err error) {
|
||||
if len(b) < 7 {
|
||||
err = errors.New("not enough len")
|
||||
return
|
||||
}
|
||||
|
||||
p.AVCProfileIndication = b[1]
|
||||
p.ProfileCompatibility = b[2]
|
||||
p.AVCLevelIndication = b[3]
|
||||
p.LengthSizeMinusOne = b[4] & 0x03
|
||||
spscount := int(b[5] & 0x1f)
|
||||
n += 6
|
||||
var sps, pps [][]byte
|
||||
for i := 0; i < spscount; i++ {
|
||||
if len(b) < n+2 {
|
||||
err = ErrDecconfInvalid
|
||||
return
|
||||
}
|
||||
spslen := int(util.BigEndian.Uint16(b[n:]))
|
||||
n += 2
|
||||
|
||||
if len(b) < n+spslen {
|
||||
err = ErrDecconfInvalid
|
||||
return
|
||||
}
|
||||
sps = append(sps, b[n:n+spslen])
|
||||
n += spslen
|
||||
}
|
||||
p.SequenceParameterSetLength = uint16(len(sps[0]))
|
||||
p.SequenceParameterSetNALUnit = sps[0]
|
||||
if len(b) < n+1 {
|
||||
err = ErrDecconfInvalid
|
||||
return
|
||||
}
|
||||
ppscount := int(b[n])
|
||||
n++
|
||||
|
||||
for i := 0; i < ppscount; i++ {
|
||||
if len(b) < n+2 {
|
||||
err = ErrDecconfInvalid
|
||||
return
|
||||
}
|
||||
ppslen := int(util.BigEndian.Uint16(b[n:]))
|
||||
n += 2
|
||||
|
||||
if len(b) < n+ppslen {
|
||||
err = ErrDecconfInvalid
|
||||
return
|
||||
}
|
||||
pps = append(pps, b[n:n+ppslen])
|
||||
n += ppslen
|
||||
}
|
||||
p.PictureParameterSetLength = uint16(len(pps[0]))
|
||||
p.PictureParameterSetNALUnit = pps[0]
|
||||
return
|
||||
}
|
||||
|
||||
// ISO/IEC 14496-3 38(52)/page
|
||||
//
|
||||
// Audio
|
||||
//
|
||||
|
||||
type AudioSpecificConfig struct {
|
||||
AudioObjectType byte // 5 bits
|
||||
SamplingFrequencyIndex byte // 4 bits
|
||||
ChannelConfiguration byte // 4 bits
|
||||
GASpecificConfig
|
||||
}
|
||||
|
||||
type GASpecificConfig struct {
|
||||
FrameLengthFlag byte // 1 bit
|
||||
DependsOnCoreCoder byte // 1 bit
|
||||
ExtensionFlag byte // 1 bit
|
||||
}
|
||||
|
||||
//
|
||||
// AudioObjectTypes -> ISO/IEC 14496-3 43(57)/page
|
||||
//
|
||||
// 1 AAC MAIN ISO/IEC 14496-3 subpart 4
|
||||
// 2 AAC LC ISO/IEC 14496-3 subpart 4
|
||||
// 3 AAC SSR ISO/IEC 14496-3 subpart 4
|
||||
// 4 AAC LTP ISO/IEC 14496-3 subpart 4
|
||||
//
|
||||
//
|
||||
|
||||
// ISO/IEC 13838-7 20(25)/page
|
||||
//
|
||||
// Advanced Audio Coding
|
||||
//
|
||||
// AudioDataTransportStream
|
||||
type ADTS struct {
|
||||
ADTSFixedHeader
|
||||
ADTSVariableHeader
|
||||
}
|
||||
|
||||
// 28 bits
|
||||
type ADTSFixedHeader struct {
|
||||
SyncWord uint16 // 12 bits The bit string ‘1111 1111 1111’. See ISO/IEC 11172-3,subclause 2.4.2.3 (Table 8)
|
||||
ID byte // 1 bit MPEG identifier, set to ‘1’. See ISO/IEC 11172-3,subclause 2.4.2.3 (Table 8)
|
||||
Layer byte // 2 bits Indicates which layer is used. Set to ‘00’. See ISO/IEC 11172-3,subclause 2.4.2.3 (Table 8)
|
||||
ProtectionAbsent byte // 1 bit Indicates whether error_check() data is present or not. Same assyntax element ‘protection_bit’ in ISO/IEC 11172-3,subclause 2.4.1 and 2.4.2 (Table 8)
|
||||
Profile byte // 2 bits profile used. See clause 2 (Table 8)
|
||||
SamplingFrequencyIndex byte // 4 bits indicates the sampling frequency used according to the followingtable (Table 8)
|
||||
PrivateBit byte // 1 bit see ISO/IEC 11172-3, subclause 2.4.2.3 (Table 8)
|
||||
ChannelConfiguration byte // 3 bits indicates the channel configuration used. Ifchannel_configuration is greater than 0, the channelconfiguration is given in Table 42, see subclause 8.5.3.1. Ifchannel_configuration equals 0, the channel configuration is notspecified in the header and must be given by aprogram_config_element() following as first syntactic element inthe first raw_data_block() after the header (seesubclause 8.5.3.2), or by the implicit configuration (seesubclause 8.5.3.3) or must be known in the application (Table 8)
|
||||
OriginalCopy byte // 1 bit see ISO/IEC 11172-3, definition of data element copyright
|
||||
Home byte // 1 bit see ISO/IEC 11172-3, definition of data element original/copy
|
||||
}
|
||||
|
||||
// SyncWord, 同步头 总是0xFFF, all bits must be 1,代表着一个ADTS帧的开始
|
||||
// ID, MPEG Version: 0 for MPEG-4, 1 for MPEG-2
|
||||
// Layer, always: '00'
|
||||
// ProtectionAbsent, 表示是否误码校验
|
||||
// Profile, 表示使用哪个级别的AAC,有些芯片只支持AAC LC 。在MPEG-2 AAC中定义了3种.
|
||||
// SamplingFrequencyIndex, 表示使用的采样率下标,通过这个下标在 Sampling Frequencies[ ]数组中查找得知采样率的值
|
||||
// PrivateBit,
|
||||
// ChannelConfiguration, 表示声道数
|
||||
// OriginalCopy,
|
||||
// Home,
|
||||
|
||||
// Profile:
|
||||
//
|
||||
// 0: Main profile
|
||||
// 1: Low Complexity profile(LC)
|
||||
// 2: Scalable Sampling Rate profile(SSR)
|
||||
// 3: Reserved
|
||||
//
|
||||
var SamplingFrequencies = [...]int{96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350}
|
||||
|
||||
// Sampling Frequencies[]:
|
||||
//
|
||||
// 0: 96000 Hz
|
||||
// 1: 88200 Hz
|
||||
// 2: 64000 Hz
|
||||
// 3: 48000 Hz
|
||||
// 4: 44100 Hz
|
||||
// 5: 32000 Hz
|
||||
// 6: 24000 Hz
|
||||
// 7: 22050 Hz
|
||||
// 8: 16000 Hz
|
||||
// 9: 12000 Hz
|
||||
// 10: 11025 Hz
|
||||
// 11: 8000 Hz
|
||||
// 12: 7350 Hz
|
||||
// 13: Reserved
|
||||
// 14: Reserved
|
||||
// 15: frequency is written explictly
|
||||
//
|
||||
|
||||
// ChannelConfiguration:
|
||||
//
|
||||
// 0: Defined in AOT Specifc Config
|
||||
// 1: 1 channel: front-center
|
||||
// 2: 2 channels: front-left, front-right
|
||||
// 3: 3 channels: front-center, front-left, front-right
|
||||
// 4: 4 channels: front-center, front-left, front-right, back-center
|
||||
// 5: 5 channels: front-center, front-left, front-right, back-left, back-right
|
||||
// 6: 6 channels: front-center, front-left, front-right, back-left, back-right, LFE-channel
|
||||
// 7: 8 channels: front-center, front-left, front-right, side-left, side-right, back-left, back-right, LFE-channel
|
||||
// 8-15: Reserved
|
||||
//
|
||||
|
||||
// 28 bits
|
||||
type ADTSVariableHeader struct {
|
||||
CopyrightIdentificationBit byte // 1 bit One bit of the 72-bit copyright identification field (seecopyright_id above). The bits of this field are transmitted frame by frame; the first bit is indicated by the copyright_identification_start bit set to ‘1’. The field consists of an 8-bit copyright_identifier, followed by a 64-bit copyright_number.The copyright identifier is given by a Registration Authority as designated by SC29. The copyright_number is a value which identifies uniquely the copyrighted material. See ISO/IEC 13818-3, subclause 2.5.2.13 (Table 9)
|
||||
CopyrightIdentificationStart byte // 1 bit One bit to indicate that the copyright_identification_bit in this audio frame is the first bit of the 72-bit copyright identification. If no copyright identification is transmitted, this bit should be kept '0'.'0' no start of copyright identification in this audio frame '1' start of copyright identification in this audio frame See ISO/IEC 13818-3, subclause 2.5.2.13 (Table 9)
|
||||
AACFrameLength uint16 // 13 bits Length of the frame including headers and error_check in bytes(Table 9)
|
||||
ADTSBufferFullness uint16 // 11 bits state of the bit reservoir in the course of encoding the ADTS frame, up to and including the first raw_data_block() and the optionally following adts_raw_data_block_error_check(). It is transmitted as the number of available bits in the bit reservoir divided by NCC divided by 32 and truncated to an integer value (Table 9). A value of hexadecimal 7FF signals that the bitstream is a variable rate bitstream. In this case, buffer fullness is not applicable
|
||||
NumberOfRawDataBlockInFrame byte // 2 bits Number of raw_data_block()’s that are multiplexed in the adts_frame() is equal to number_of_raw_data_blocks_in_frame + 1. The minimum value is 0 indicating 1 raw_data_block()(Table 9)
|
||||
}
|
||||
|
||||
// CopyrightIdentificationBit,
|
||||
// CopyrightIdentificationStart,
|
||||
// AACFrameLength, 一个ADTS帧的长度包括ADTS头和raw data block.
|
||||
// ADTSBufferFullness, 0x7FF 说明是码率可变的码流.
|
||||
// NumberOfRawDataBlockInFrame, 表示ADTS帧中有number_of_raw_data_blocks_in_frame + 1个AAC原始帧
|
||||
|
||||
// 所以说number_of_raw_data_blocks_in_frame == 0 表示说ADTS帧中有一个AAC数据块并不是说没有。(一个AAC原始帧包含一段时间内1024个采样及相关数据)
|
||||
func ADTSToAudioSpecificConfig(data []byte) []byte {
|
||||
profile := ((data[2] & 0xc0) >> 6) + 1
|
||||
sampleRate := (data[2] & 0x3c) >> 2
|
||||
channel := ((data[2] & 0x1) << 2) | ((data[3] & 0xc0) >> 6)
|
||||
config1 := (profile << 3) | ((sampleRate & 0xe) >> 1)
|
||||
config2 := ((sampleRate & 0x1) << 7) | (channel << 3)
|
||||
return []byte{0xAF, 0x00, config1, config2}
|
||||
}
|
||||
func AudioSpecificConfigToADTS(asc AudioSpecificConfig, rawDataLength int) (adts ADTS, adtsByte []byte, err error) {
|
||||
if asc.ChannelConfiguration > 8 || asc.FrameLengthFlag > 13 {
|
||||
err = errors.New("Reserved field.")
|
||||
return
|
||||
}
|
||||
|
||||
// ADTSFixedHeader
|
||||
adts.SyncWord = 0xfff
|
||||
adts.ID = 0
|
||||
adts.Layer = 0
|
||||
adts.ProtectionAbsent = 1
|
||||
|
||||
// SyncWord(12) + ID(1) + Layer(2) + ProtectionAbsent(1)
|
||||
adtsByte = append(adtsByte, 0xff)
|
||||
adtsByte = append(adtsByte, 0xf1)
|
||||
|
||||
if asc.AudioObjectType >= 3 || asc.AudioObjectType == 0 {
|
||||
adts.Profile = 1
|
||||
} else {
|
||||
adts.Profile = asc.AudioObjectType - 1
|
||||
}
|
||||
|
||||
adts.SamplingFrequencyIndex = asc.SamplingFrequencyIndex
|
||||
adts.PrivateBit = 0
|
||||
adts.ChannelConfiguration = asc.ChannelConfiguration
|
||||
adts.OriginalCopy = 0
|
||||
adts.Home = 0
|
||||
|
||||
// Profile(2) + SamplingFrequencyIndex(4) + PrivateBit(1) + ChannelConfiguration(3)(取高1位)
|
||||
byte3 := uint8(adts.Profile<<6) + uint8(adts.SamplingFrequencyIndex<<2) + uint8(adts.PrivateBit<<1) + uint8((adts.ChannelConfiguration&0x7)>>2)
|
||||
adtsByte = append(adtsByte, byte3)
|
||||
|
||||
// ADTSVariableHeader
|
||||
adts.CopyrightIdentificationBit = 0
|
||||
adts.CopyrightIdentificationStart = 0
|
||||
adts.AACFrameLength = 7 + uint16(rawDataLength)
|
||||
adts.ADTSBufferFullness = 0x7ff
|
||||
adts.NumberOfRawDataBlockInFrame = 0
|
||||
|
||||
// ChannelConfiguration(3)(取低2位) + OriginalCopy(1) + Home(1) + CopyrightIdentificationBit(1) + CopyrightIdentificationStart(1) + AACFrameLength(13)(取高2位)
|
||||
byte4 := uint8((adts.ChannelConfiguration&0x3)<<6) + uint8((adts.AACFrameLength&0x1fff)>>11)
|
||||
adtsByte = append(adtsByte, byte4)
|
||||
|
||||
// AACFrameLength(13)
|
||||
// xx xxxxxxxx xxx
|
||||
// 取中间的部分
|
||||
byte5 := uint8(((adts.AACFrameLength & 0x1fff) >> 3) & 0x0ff)
|
||||
adtsByte = append(adtsByte, byte5)
|
||||
|
||||
// AACFrameLength(13)(取低3位) + ADTSBufferFullness(11)(取高5位)
|
||||
byte6 := uint8((adts.AACFrameLength&0x0007)<<5) + 0x1f
|
||||
adtsByte = append(adtsByte, byte6)
|
||||
|
||||
// ADTSBufferFullness(11)(取低6位) + NumberOfRawDataBlockInFrame(2)
|
||||
adtsByte = append(adtsByte, 0xfc)
|
||||
|
||||
return
|
||||
}
|
@@ -1,114 +0,0 @@
|
||||
package avformat
|
||||
|
||||
import (
|
||||
"github.com/langhuihui/monibuca/monica/pool"
|
||||
"github.com/langhuihui/monibuca/monica/util"
|
||||
"io"
|
||||
)
|
||||
|
||||
const (
|
||||
// FLV Tag Type
|
||||
FLV_TAG_TYPE_AUDIO = 0x08
|
||||
FLV_TAG_TYPE_VIDEO = 0x09
|
||||
FLV_TAG_TYPE_SCRIPT = 0x12
|
||||
)
|
||||
|
||||
var (
|
||||
// 音频格式. 4 bit
|
||||
SoundFormat = map[byte]string{
|
||||
0: "Linear PCM, platform endian",
|
||||
1: "ADPCM",
|
||||
2: "MP3",
|
||||
3: "Linear PCM, little endian",
|
||||
4: "Nellymoser 16kHz mono",
|
||||
5: "Nellymoser 8kHz mono",
|
||||
6: "Nellymoser",
|
||||
7: "G.711 A-law logarithmic PCM",
|
||||
8: "G.711 mu-law logarithmic PCM",
|
||||
9: "reserved",
|
||||
10: "AAC",
|
||||
11: "Speex",
|
||||
14: "MP3 8Khz",
|
||||
15: "Device-specific sound"}
|
||||
|
||||
// 采样频率. 2 bit
|
||||
SoundRate = map[byte]int{
|
||||
0: 5500,
|
||||
1: 11000,
|
||||
2: 22000,
|
||||
3: 44000}
|
||||
|
||||
// 量化精度. 1 bit
|
||||
SoundSize = map[byte]string{
|
||||
0: "8Bit",
|
||||
1: "16Bit"}
|
||||
|
||||
// 音频类型. 1bit
|
||||
SoundType = map[byte]string{
|
||||
0: "Mono",
|
||||
1: "Stereo"}
|
||||
|
||||
// 视频帧类型. 4bit
|
||||
FrameType = map[byte]string{
|
||||
1: "keyframe (for AVC, a seekable frame)",
|
||||
2: "inter frame (for AVC, a non-seekable frame)",
|
||||
3: "disposable inter frame (H.263 only)",
|
||||
4: "generated keyframe (reserved for server use only)",
|
||||
5: "video info/command frame"}
|
||||
|
||||
// 视频编码类型. 4bit
|
||||
CodecID = map[byte]string{
|
||||
1: "JPEG (currently unused)",
|
||||
2: "Sorenson H.263",
|
||||
3: "Screen video",
|
||||
4: "On2 VP6",
|
||||
5: "On2 VP6 with alpha channel",
|
||||
6: "Screen video version 2",
|
||||
7: "AVC",
|
||||
12: "H265"}
|
||||
)
|
||||
|
||||
var FLVHeader = []byte{0x46, 0x4c, 0x56, 0x01, 0x05, 0, 0, 0, 9, 0, 0, 0, 0}
|
||||
|
||||
func WriteFLVTag(w io.Writer, tag *pool.SendPacket) (err error) {
|
||||
head := pool.GetSlice(11)
|
||||
defer pool.RecycleSlice(head)
|
||||
tail := pool.GetSlice(4)
|
||||
defer pool.RecycleSlice(tail)
|
||||
head[0] = tag.Packet.Type
|
||||
dataSize := uint32(len(tag.Packet.Payload))
|
||||
util.BigEndian.PutUint32(tail, dataSize+11)
|
||||
util.BigEndian.PutUint24(head[1:], dataSize)
|
||||
util.BigEndian.PutUint24(head[4:], tag.Timestamp)
|
||||
util.BigEndian.PutUint32(head[7:], 0)
|
||||
if _, err = w.Write(head); err != nil {
|
||||
return
|
||||
}
|
||||
// Tag Data
|
||||
if _, err = w.Write(tag.Packet.Payload); err != nil {
|
||||
return
|
||||
}
|
||||
if _, err = w.Write(tail); err != nil { // PreviousTagSizeN(4)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
func ReadFLVTag(r io.Reader) (tag *pool.AVPacket, err error) {
|
||||
head := pool.GetSlice(11)
|
||||
defer pool.RecycleSlice(head)
|
||||
if _, err = r.Read(head); err != nil {
|
||||
return
|
||||
}
|
||||
av := pool.NewAVPacket(head[0])
|
||||
dataSize := util.BigEndian.Uint24(head[1:])
|
||||
av.Timestamp = util.BigEndian.Uint24(head[4:])
|
||||
body := pool.GetSlice(int(dataSize))
|
||||
defer pool.RecycleSlice(body)
|
||||
if _, err = r.Read(body); err == nil {
|
||||
av.Payload = body
|
||||
t := pool.GetSlice(4)
|
||||
_, err = r.Read(t)
|
||||
pool.RecycleSlice(t)
|
||||
}
|
||||
return
|
||||
}
|
@@ -1,144 +0,0 @@
|
||||
package avformat
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Start Code + NAL Unit -> NALU Header + NALU Body
|
||||
// RTP Packet -> NALU Header + NALU Body
|
||||
|
||||
// NALU Body -> Slice Header + Slice data
|
||||
// Slice data -> flags + Macroblock layer1 + Macroblock layer2 + ...
|
||||
// Macroblock layer1 -> mb_type + PCM Data
|
||||
// Macroblock layer2 -> mb_type + Sub_mb_pred or mb_pred + Residual Data
|
||||
// Residual Data ->
|
||||
|
||||
const (
|
||||
// NALU Type
|
||||
NALU_Unspecified = 0
|
||||
NALU_Non_IDR_Picture = 1
|
||||
NALU_Data_Partition_A = 2
|
||||
NALU_Data_Partition_B = 3
|
||||
NALU_Data_Partition_C = 4
|
||||
NALU_IDR_Picture = 5
|
||||
NALU_SEI = 6
|
||||
NALU_SPS = 7
|
||||
NALU_PPS = 8
|
||||
NALU_Access_Unit_Delimiter = 9
|
||||
NALU_Sequence_End = 10
|
||||
NALU_Stream_End = 11
|
||||
NALU_Filler_Data = 12
|
||||
NALU_SPS_Extension = 13
|
||||
NALU_Prefix = 14
|
||||
NALU_SPS_Subset = 15
|
||||
NALU_DPS = 16
|
||||
NALU_Reserved1 = 17
|
||||
NALU_Reserved2 = 18
|
||||
NALU_Not_Auxiliary_Coded = 19
|
||||
NALU_Coded_Slice_Extension = 20
|
||||
NALU_Reserved3 = 21
|
||||
NALU_Reserved4 = 22
|
||||
NALU_Reserved5 = 23
|
||||
NALU_NotReserved = 24
|
||||
// 24 - 31 NALU_NotReserved
|
||||
)
|
||||
|
||||
var (
|
||||
NALU_AUD_BYTE = []byte{0x00, 0x00, 0x00, 0x01, 0x09, 0xF0}
|
||||
NALU_Delimiter1 = []byte{0x00, 0x00, 0x01}
|
||||
NALU_Delimiter2 = []byte{0x00, 0x00, 0x00, 0x01}
|
||||
RTMP_AVC_HEAD = []byte{0x17, 0x00, 0x00, 0x00, 0x00, 0x01, 0x42, 0x00, 0x1E, 0xFF}
|
||||
RTMP_KEYFRAME_HEAD = []byte{0x17, 0x01, 0x00, 0x00, 0x00}
|
||||
RTMP_NORMALFRAME_HEAD = []byte{0x27, 0x01, 0x00, 0x00, 0x00}
|
||||
)
|
||||
var NALU_SEI_BYTE []byte
|
||||
|
||||
// H.264/AVC视频编码标准中,整个系统框架被分为了两个层面:视频编码层面(VCL)和网络抽象层面(NAL)
|
||||
// NAL - Network Abstract Layer
|
||||
// raw byte sequence payload (RBSP) 原始字节序列载荷
|
||||
|
||||
type H264 struct {
|
||||
}
|
||||
|
||||
type NALUnit struct {
|
||||
NALUHeader
|
||||
RBSP
|
||||
}
|
||||
|
||||
type NALUHeader struct {
|
||||
forbidden_zero_bit byte // 1 bit 0
|
||||
nal_ref_idc byte // 2 bits nal_unit_type等于6,9,10,11或12的NAL单元其nal_ref_idc都应等于 0
|
||||
nal_uint_type byte // 5 bits 包含在 NAL 单元中的 RBSP 数据结构的类型
|
||||
}
|
||||
|
||||
type RBSP interface {
|
||||
}
|
||||
|
||||
/*
|
||||
0 Unspecified non-VCL
|
||||
1 Coded slice of a non-IDR picture VCL
|
||||
2 Coded slice data partition A VCL
|
||||
3 Coded slice data partition B VCL
|
||||
4 Coded slice data partition C VCL
|
||||
5 Coded slice of an IDR picture VCL
|
||||
6 Supplemental enhancement information (SEI) non-VCL
|
||||
7 Sequence parameter set non-VCL
|
||||
8 Picture parameter set non-VCL
|
||||
9 Access unit delimiter non-VCL
|
||||
10 End of sequence non-VCL
|
||||
11 End of stream non-VCL
|
||||
12 Filler data non-VCL
|
||||
13 Sequence parameter set extension non-VCL
|
||||
14 Prefix NAL unit non-VCL
|
||||
15 Subset sequence parameter set non-VCL
|
||||
16 Depth parameter set non-VCL
|
||||
17..18 Reserved non-VCL
|
||||
19 Coded slice of an auxiliary coded picture without partitioning non-VCL
|
||||
20 Coded slice extension non-VCL
|
||||
21 Coded slice extension for depth view components non-VCL
|
||||
22..23 Reserved non-VCL
|
||||
24..31 Unspecified non-VCL
|
||||
|
||||
0:未规定
|
||||
1:非IDR图像中不采用数据划分的片段
|
||||
2:非IDR图像中A类数据划分片段
|
||||
3:非IDR图像中B类数据划分片段
|
||||
4:非IDR图像中C类数据划分片段
|
||||
5:IDR图像的片段
|
||||
6:补充增强信息(SEI)
|
||||
7:序列参数集(SPS)
|
||||
8:图像参数集(PPS)
|
||||
9:分割符
|
||||
10:序列结束符
|
||||
11:流结束符
|
||||
12:填充数据
|
||||
13:序列参数集扩展
|
||||
14:带前缀的NAL单元
|
||||
15:子序列参数集
|
||||
16 – 18:保留
|
||||
19:不采用数据划分的辅助编码图像片段
|
||||
20:编码片段扩展
|
||||
21 – 23:保留
|
||||
24 – 31:未规定
|
||||
|
||||
nal_unit_type NAL类型 nal_reference_bit
|
||||
0 未使用 0
|
||||
1 非IDR的片 此片属于参考帧,则不等于0,不属于参考帧,则等与0
|
||||
2 片数据A分区 同上
|
||||
3 片数据B分区 同上
|
||||
4 片数据C分区 同上
|
||||
5 IDR图像的片 5
|
||||
6 补充增强信息单元(SEI) 0
|
||||
7 序列参数集 非0
|
||||
8 图像参数集 非0
|
||||
9 分界符 0
|
||||
10 序列结束 0
|
||||
11 码流结束 0
|
||||
12 填充 0
|
||||
13..23 保留 0
|
||||
24..31 不保留 0
|
||||
*/
|
||||
|
||||
func ReadPPS(w io.Writer) {
|
||||
|
||||
}
|
@@ -1,577 +0,0 @@
|
||||
package mpegts
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"github.com/langhuihui/monibuca/monica/util"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
//"sync"
|
||||
)
|
||||
|
||||
// NALU AUD 00 00 00 01 09 F0
|
||||
|
||||
const (
|
||||
TS_PACKET_SIZE = 188
|
||||
TS_DVHS_PACKET_SIZE = 192
|
||||
TS_FEC_PACKET_SIZE = 204
|
||||
|
||||
TS_MAX_PACKET_SIZE = 204
|
||||
|
||||
PID_PAT = 0x0000
|
||||
PID_CAT = 0x0001
|
||||
PID_TSDT = 0x0002
|
||||
PID_RESERVED1 = 0x0003
|
||||
PID_RESERVED2 = 0x000F
|
||||
PID_NIT_ST = 0x0010
|
||||
PID_SDT_BAT_ST = 0x0011
|
||||
PID_EIT_ST = 0x0012
|
||||
PID_RST_ST = 0x0013
|
||||
PID_TDT_TOT_ST = 0x0014
|
||||
PID_NET_SYNC = 0x0015
|
||||
PID_RESERVED3 = 0x0016
|
||||
PID_RESERVED4 = 0x001B
|
||||
PID_SIGNALLING = 0x001C
|
||||
PID_MEASURE = 0x001D
|
||||
PID_DIT = 0x001E
|
||||
PID_SIT = 0x001F
|
||||
// 0x0003 - 0x000F Reserved
|
||||
// 0x0010 - 0x1FFE May be assigned as network_PID, Program_map_PID, elementary_PID, or for other purposes
|
||||
// 0x1FFF Null Packet
|
||||
|
||||
// program_association_section
|
||||
// conditional_access_section
|
||||
// TS_program_map_section
|
||||
// TS_description_section
|
||||
// ISO_IEC_14496_scene_description_section
|
||||
// ISO_IEC_14496_object_descriptor_section
|
||||
// Metadata_section
|
||||
// IPMP_Control_Information_section (defined in ISO/IEC 13818-11)
|
||||
TABLE_PAS = 0x00
|
||||
TABLE_CAS = 0x01
|
||||
TABLE_TSPMS = 0x02
|
||||
TABLE_TSDS = 0x03
|
||||
TABLE_ISO_IEC_14496_SDC = 0x04
|
||||
TABLE_ISO_IEC_14496_ODC = 0x05
|
||||
TABLE_MS = 0x06
|
||||
TABLE_IPMP_CIS = 0x07
|
||||
// 0x06 - 0x37 ITU-T Rec. H.222.0 | ISO/IEC 13818-1 reserved
|
||||
// 0x38 - 0x3F Defined in ISO/IEC 13818-6
|
||||
// 0x40 - 0xFE User private
|
||||
// 0xFF Forbidden
|
||||
|
||||
STREAM_TYPE_H264 = 0x1B
|
||||
STREAM_TYPE_AAC = 0x0F
|
||||
|
||||
// 1110 xxxx
|
||||
// 110x xxxx
|
||||
STREAM_ID_VIDEO = 0xE0 // ITU-T Rec. H.262 | ISO/IEC 13818-2 or ISO/IEC 11172-2 or ISO/IEC14496-2 video stream number xxxx
|
||||
STREAM_ID_AUDIO = 0xC0 // ISO/IEC 13818-3 or ISO/IEC 11172-3 or ISO/IEC 13818-7 or ISO/IEC14496-3 audio stream number x xxxx
|
||||
|
||||
PAT_PKT_TYPE = 0
|
||||
PMT_PKT_TYPE = 1
|
||||
PES_PKT_TYPE = 2
|
||||
)
|
||||
|
||||
//
|
||||
// MPEGTS -> PAT + PMT + PES
|
||||
// ES -> PES -> TS
|
||||
//
|
||||
|
||||
type MpegTsStream struct {
|
||||
firstTsPkt *MpegTsPacket // 每一帧的第一个TS包
|
||||
patPkt *MpegTsPacket // 装载PAT的TS包
|
||||
pmtPkt *MpegTsPacket // 装载PMT的TS包
|
||||
pat *MpegTsPAT // PAT表信息
|
||||
pmt *MpegTsPMT // PMT表信息
|
||||
closed bool //是否已经关闭
|
||||
TsPesPktChan chan *MpegTsPesStream // TS + PES Packet Channel,将封装的每一帧ES数据,通过channel来传输
|
||||
}
|
||||
|
||||
func NewMpegTsStream(bufferLength int) (ts *MpegTsStream) {
|
||||
ts = new(MpegTsStream)
|
||||
ts.firstTsPkt = new(MpegTsPacket)
|
||||
ts.patPkt = new(MpegTsPacket)
|
||||
ts.pmtPkt = new(MpegTsPacket)
|
||||
ts.pat = new(MpegTsPAT)
|
||||
ts.pmt = new(MpegTsPMT)
|
||||
ts.TsPesPktChan = make(chan *MpegTsPesStream, bufferLength)
|
||||
return
|
||||
}
|
||||
|
||||
// ios13818-1-CN.pdf 33/165
|
||||
//
|
||||
// TS
|
||||
//
|
||||
|
||||
// Packet == Header + Payload == 188 bytes
|
||||
type MpegTsPacket struct {
|
||||
Header MpegTsHeader
|
||||
Payload []byte
|
||||
}
|
||||
|
||||
// 前面32bit的数据即TS分组首部,它指出了这个分组的属性
|
||||
type MpegTsHeader struct {
|
||||
SyncByte byte // 8 bits 同步字节,固定为0x47,表示后面是一个TS分组
|
||||
TransportErrorIndicator byte // 1 bit 传输错误标志位
|
||||
PayloadUnitStartIndicator byte // 1 bit 负载单元开始标志(packet不满188字节时需填充).为1时,表示在4个字节后,有一个调整字节
|
||||
TransportPriority byte // 1 bit 传输优先级
|
||||
Pid uint16 // 13 bits Packet ID号码,唯一的号码对应不同的包.为0表示携带的是PAT表
|
||||
TransportScramblingControl byte // 2 bits 加密标志位(00:未加密;其他表示已加密)
|
||||
AdaptionFieldControl byte // 2 bits 附加区域控制.表示TS分组首部后面是否跟随有调整字段和有效负载.01仅含有效负载(没有adaptation_field),10仅含调整字段(没有Payload),11含有调整字段和有效负载(有adaptation_field,adaptation_field之后是Payload).为00的话解码器不进行处理.空分组没有调整字段
|
||||
ContinuityCounter byte // 4 bits 包递增计数器.范围0-15,具有相同的PID的TS分组传输时每次加1,到15后清0.不过,有些情况下是不计数的.
|
||||
|
||||
MpegTsHeaderAdaptationField
|
||||
}
|
||||
|
||||
// 调整字段,只可能出现在每一帧的开头(当含有pcr的时候),或者结尾(当不满足188个字节的时候)
|
||||
// adaptionFieldControl 00 -> 高字节代表调整字段, 低字节代表负载字段 0x20 0x10
|
||||
// PCR字段编码在MPEG-2 TS包的自适应字段(Adaptation field)的6个Byte中,其中6 bits为预留位,42 bits为有效位()
|
||||
// MpegTsHeaderAdaptationField + stuffing bytes
|
||||
type MpegTsHeaderAdaptationField struct {
|
||||
AdaptationFieldLength byte // 8bits 本区域除了本字节剩下的长度(不包含本字节!!!切记), if adaptationFieldLength > 0, 那么就有下面8个字段. adaptation_field_length 值必须在 0 到 182 的区间内.当 adaptation_field_control 值为'10'时,adaptation_field_length 值必须为 183
|
||||
DiscontinuityIndicator byte // 1bit 置于"1"时,指示当前传输流包的不连续性状态为真.当 discontinuity_indicator 设置为"0"或不存在时,不连续性状态为假.不连续性指示符用于指示两种类型的不连续性,系统时间基不连续性和 continuity_counter 不连续性.
|
||||
RandomAccessIndicator byte // 1bit 指示当前的传输流包以及可能的具有相同 PID 的后续传输流包,在此点包含有助于随机接入的某些信息.特别的,该比特置于"1"时,在具有当前 PID 的传输流包的有效载荷中起始的下一个 PES 包必须包含一个 discontinuity_indicator 字段中规定的基本流接入点.此外,在视频情况中,显示时间标记必须在跟随基本流接入点的第一图像中存在
|
||||
ElementaryStreamPriorityIndicator byte // 1bit 在具有相同 PID 的包之间,它指示此传输流包有效载荷内承载的基本流数据的优先级.1->指示该有效载荷具有比其他传输流包有效载荷更高的优先级
|
||||
PCRFlag byte // 1bit 1->指示 adaptation_field 包含以两部分编码的 PCR 字段.0->指示自适应字段不包含任何 PCR 字段
|
||||
OPCRFlag byte // 1bit 1->指示 adaptation_field 包含以两部分编码的 OPCR字段.0->指示自适应字段不包含任何 OPCR 字段
|
||||
SplicingPointFlag byte // 1bit 1->指示 splice_countdown 字段必须在相关自适应字段中存在,指定拼接点的出现.0->指示自适应字段中 splice_countdown 字段不存在
|
||||
TrasportPrivateDataFlag byte // 1bit 1->指示自适应字段包含一个或多个 private_data 字节.0->指示自适应字段不包含任何 private_data 字节
|
||||
AdaptationFieldExtensionFlag byte // 1bit 1->指示自适应字段扩展的存在.0->指示自适应字段中自适应字段扩展不存在
|
||||
|
||||
// Optional Fields
|
||||
ProgramClockReferenceBase uint64 // 33 bits pcr
|
||||
Reserved1 byte // 6 bits
|
||||
ProgramClockReferenceExtension uint16 // 9 bits
|
||||
OriginalProgramClockReferenceBase uint64 // 33 bits opcr
|
||||
Reserved2 byte // 6 bits
|
||||
OriginalProgramClockReferenceExtension uint16 // 9 bits
|
||||
SpliceCountdown byte // 8 bits
|
||||
TransportPrivateDataLength byte // 8 bits 指定紧随传输private_data_length 字段的 private_data 字节数. private_data 字节数不能使专用数据扩展超出自适应字段的范围
|
||||
PrivateDataByte byte // 8 bits 不通过 ITU-T|ISO/IEC 指定
|
||||
AdaptationFieldExtensionLength byte // 8 bits 指定紧随此字段的扩展的自适应字段数据的字节数,包括要保留的字节(如果存在)
|
||||
LtwFlag byte // 1 bit 1->指示 ltw_offset 字段存在
|
||||
PiecewiseRateFlag byte // 1 bit 1->指示 piecewise_rate 字段存在
|
||||
SeamlessSpliceFlag byte // 1 bit 1->指示 splice_type 以及 DTS_next_AU 字段存在. 0->指示无论是 splice_type 字段还是 DTS_next_AU 字段均不存在
|
||||
|
||||
// Optional Fields
|
||||
LtwValidFlag byte // 1 bit 1->指示 ltw_offset 的值必将生效.0->指示 ltw_offset 字段中该值未定义
|
||||
LtwOffset uint16 // 15 bits 其值仅当 ltw_valid 标志字段具有'1'值时才定义.定义时,法定时间窗补偿以(300/fs)秒为度量单位,其中 fs 为此 PID 所归属的节目的系统时钟频率
|
||||
Reserved3 byte // 2 bits 保留
|
||||
PiecewiseRate uint32 // 22 bits 只要当 ltw_flag 和 ltw_valid_flag 均置于‘1’时,此 22 比特字段的含义才确定
|
||||
SpliceType byte // 4 bits
|
||||
DtsNextAU uint64 // 33 bits (解码时间标记下一个存取单元)
|
||||
|
||||
// stuffing bytes
|
||||
// 此为固定的 8 比特值等于'1111 1111',能够通过编码器插入.它亦能被解码器丢弃
|
||||
}
|
||||
|
||||
// ios13818-1-CN.pdf 77
|
||||
//
|
||||
// Descriptor
|
||||
//
|
||||
|
||||
type MpegTsDescriptor struct {
|
||||
Tag byte // 8 bits 标识每一个描述符
|
||||
Length byte // 8 bits 指定紧随 descriptor_length 字段的描述符的字节数
|
||||
Data []byte
|
||||
}
|
||||
|
||||
func ReadTsPacket(r io.Reader) (packet MpegTsPacket, err error) {
|
||||
lr := &io.LimitedReader{R: r, N: TS_PACKET_SIZE}
|
||||
|
||||
// header
|
||||
packet.Header, err = ReadTsHeader(lr)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// payload
|
||||
packet.Payload = make([]byte, lr.N)
|
||||
_, err = lr.Read(packet.Payload)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ReadTsHeader(r io.Reader) (header MpegTsHeader, err error) {
|
||||
var h uint32
|
||||
|
||||
// MPEGTS Header 4个字节
|
||||
h, err = util.ReadByteToUint32(r, true)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// payloadUnitStartIndicator
|
||||
// 为1时,表示在4个字节后,有一个调整字节.包头后需要除去一个字节才是有效数据(payload_unit_start_indicator="1")
|
||||
// header.payloadUnitStartIndicator = uint8(h & 0x400000)
|
||||
|
||||
// | 1111 1111 | 0000 0000 | 0000 0000 | 0000 0000 |
|
||||
if (h&0xff000000)>>24 != 0x47 {
|
||||
err = errors.New("mpegts header sync error!")
|
||||
return
|
||||
}
|
||||
|
||||
// | 1111 1111 | 0000 0000 | 0000 0000 | 0000 0000 |
|
||||
header.SyncByte = byte((h & 0xff000000) >> 24)
|
||||
|
||||
// | 0000 0000 | 1000 0000 | 0000 0000 | 0000 0000 |
|
||||
header.TransportErrorIndicator = byte((h & 0x800000) >> 23)
|
||||
|
||||
// | 0000 0000 | 0100 0000 | 0000 0000 | 0000 0000 |
|
||||
header.PayloadUnitStartIndicator = byte((h & 0x400000) >> 22)
|
||||
|
||||
// | 0000 0000 | 0010 0000 | 0000 0000 | 0000 0000 |
|
||||
header.TransportPriority = byte((h & 0x200000) >> 21)
|
||||
|
||||
// | 0000 0000 | 0001 1111 | 1111 1111 | 0000 0000 |
|
||||
header.Pid = uint16((h & 0x1fff00) >> 8)
|
||||
|
||||
// | 0000 0000 | 0000 0000 | 0000 0000 | 1100 0000 |
|
||||
header.TransportScramblingControl = byte((h & 0xc0) >> 6)
|
||||
|
||||
// | 0000 0000 | 0000 0000 | 0000 0000 | 0011 0000 |
|
||||
// 0x30 , 0x20 -> adaptation_field, 0x10 -> Payload
|
||||
header.AdaptionFieldControl = byte((h & 0x30) >> 4)
|
||||
|
||||
// | 0000 0000 | 0000 0000 | 0000 0000 | 0000 1111 |
|
||||
header.ContinuityCounter = byte(h & 0xf)
|
||||
|
||||
// | 0010 0000 |
|
||||
// adaptionFieldControl
|
||||
// 表示TS分组首部后面是否跟随有调整字段和有效负载.
|
||||
// 01仅含有效负载(没有adaptation_field)
|
||||
// 10仅含调整字段(没有Payload)
|
||||
// 11含有调整字段和有效负载(有adaptation_field,adaptation_field之后是Payload).
|
||||
// 为00的话解码器不进行处理.空分组没有调整字段
|
||||
// 当值为'11时,adaptation_field_length 值必须在0 到182 的区间内.
|
||||
// 当值为'10'时,adaptation_field_length 值必须为183.
|
||||
// 对于承载PES 包的传输流包,只要存在欠充足的PES 包数据就需要通过填充来完全填满传输流包的有效载荷字节.
|
||||
// 填充通过规定自适应字段长度比自适应字段中数据元的长度总和还要长来实现,以致于自适应字段在完全容纳有效的PES 包数据后,有效载荷字节仍有剩余.自适应字段中额外空间采用填充字节填满.
|
||||
if header.AdaptionFieldControl >= 2 {
|
||||
// adaptationFieldLength
|
||||
header.AdaptationFieldLength, err = util.ReadByteToUint8(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if header.AdaptationFieldLength > 0 {
|
||||
lr := &io.LimitedReader{R: r, N: int64(header.AdaptationFieldLength)}
|
||||
|
||||
// discontinuityIndicator(1)
|
||||
// randomAccessIndicator(1)
|
||||
// elementaryStreamPriorityIndicator
|
||||
// PCRFlag
|
||||
// OPCRFlag
|
||||
// splicingPointFlag
|
||||
// trasportPrivateDataFlag
|
||||
// adaptationFieldExtensionFlag
|
||||
var flags uint8
|
||||
flags, err = util.ReadByteToUint8(lr)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
header.DiscontinuityIndicator = flags & 0x80
|
||||
header.RandomAccessIndicator = flags & 0x40
|
||||
header.ElementaryStreamPriorityIndicator = flags & 0x20
|
||||
header.PCRFlag = flags & 0x10
|
||||
header.OPCRFlag = flags & 0x08
|
||||
header.SplicingPointFlag = flags & 0x04
|
||||
header.TrasportPrivateDataFlag = flags & 0x02
|
||||
header.AdaptationFieldExtensionFlag = flags & 0x01
|
||||
|
||||
// randomAccessIndicator
|
||||
// 在此点包含有助于随机接入的某些信息.
|
||||
// 特别的,该比特置于"1"时,在具有当前 PID 的传输流包的有效载荷中起始的下一个 PES 包必须包含一个 discontinuity_indicator 字段中规定的基本流接入点.
|
||||
// 此外,在视频情况中,显示时间标记必须在跟随基本流接入点的第一图像中存在
|
||||
if header.RandomAccessIndicator != 0 {
|
||||
}
|
||||
|
||||
// PCRFlag
|
||||
// 1->指示 adaptation_field 包含以两部分编码的 PCR 字段.
|
||||
// 0->指示自适应字段不包含任何 PCR 字段
|
||||
if header.PCRFlag != 0 {
|
||||
var pcr uint64
|
||||
pcr, err = util.ReadByteToUint48(lr, true)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// PCR(i) = PCR_base(i)*300 + PCR_ext(i)
|
||||
// afd.programClockReferenceBase * 300 + afd.programClockReferenceExtension
|
||||
header.ProgramClockReferenceBase = pcr >> 15 // 9 bits + 6 bits
|
||||
header.ProgramClockReferenceExtension = uint16(pcr & 0x1ff) // 9 bits -> | 0000 0001 | 1111 1111 |
|
||||
}
|
||||
|
||||
// OPCRFlag
|
||||
if header.OPCRFlag != 0 {
|
||||
var opcr uint64
|
||||
opcr, err = util.ReadByteToUint48(lr, true)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// OPCR(i) = OPCR_base(i)*300 + OPCR_ext(i)
|
||||
// afd.originalProgramClockReferenceBase * 300 + afd.originalProgramClockReferenceExtension
|
||||
header.OriginalProgramClockReferenceBase = opcr >> 15 // 9 bits + 6 bits
|
||||
header.OriginalProgramClockReferenceExtension = uint16(opcr & 0x1ff) // 9 bits -> | 0000 0001 | 1111 1111 |
|
||||
}
|
||||
|
||||
// splicingPointFlag
|
||||
// 1->指示 splice_countdown 字段必须在相关自适应字段中存在,指定拼接点的出现.
|
||||
// 0->指示自适应字段中 splice_countdown 字段不存在
|
||||
if header.SplicingPointFlag != 0 {
|
||||
header.SpliceCountdown, err = util.ReadByteToUint8(lr)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// trasportPrivateDataFlag
|
||||
// 1->指示自适应字段包含一个或多个 private_data 字节.
|
||||
// 0->指示自适应字段不包含任何 private_data 字节
|
||||
if header.TrasportPrivateDataFlag != 0 {
|
||||
header.TransportPrivateDataLength, err = util.ReadByteToUint8(lr)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// privateDataByte
|
||||
b := make([]byte, header.TransportPrivateDataLength)
|
||||
if _, err = lr.Read(b); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// adaptationFieldExtensionFlag
|
||||
if header.AdaptationFieldExtensionFlag != 0 {
|
||||
}
|
||||
|
||||
// 消耗掉剩下的数据,我们不关心
|
||||
if lr.N > 0 {
|
||||
// Discard 是一个 io.Writer,对它进行的任何 Write 调用都将无条件成功
|
||||
// 但是ioutil.Discard不记录copy得到的数值
|
||||
// 用于发送需要读取但不想存储的数据,目的是耗尽读取端的数据
|
||||
if _, err = io.CopyN(ioutil.Discard, lr, int64(lr.N)); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func WriteTsHeader(w io.Writer, header MpegTsHeader) (written int, err error) {
|
||||
if header.SyncByte != 0x47 {
|
||||
err = errors.New("mpegts header sync error!")
|
||||
return
|
||||
}
|
||||
|
||||
h := uint32(header.SyncByte)<<24 + uint32(header.TransportErrorIndicator)<<23 + uint32(header.PayloadUnitStartIndicator)<<22 + uint32(header.TransportPriority)<<21 + uint32(header.Pid)<<8 + uint32(header.TransportScramblingControl)<<6 + uint32(header.AdaptionFieldControl)<<4 + uint32(header.ContinuityCounter)
|
||||
if err = util.WriteUint32ToByte(w, h, true); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
written += 4
|
||||
|
||||
if header.AdaptionFieldControl >= 2 {
|
||||
// adaptationFieldLength(8)
|
||||
if err = util.WriteUint8ToByte(w, header.AdaptationFieldLength); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
written += 1
|
||||
|
||||
if header.AdaptationFieldLength > 0 {
|
||||
|
||||
// discontinuityIndicator(1)
|
||||
// randomAccessIndicator(1)
|
||||
// elementaryStreamPriorityIndicator(1)
|
||||
// PCRFlag(1)
|
||||
// OPCRFlag(1)
|
||||
// splicingPointFlag(1)
|
||||
// trasportPrivateDataFlag(1)
|
||||
// adaptationFieldExtensionFlag(1)
|
||||
threeIndicatorFiveFlags := uint8(header.DiscontinuityIndicator<<7) + uint8(header.RandomAccessIndicator<<6) + uint8(header.ElementaryStreamPriorityIndicator<<5) + uint8(header.PCRFlag<<4) + uint8(header.OPCRFlag<<3) + uint8(header.SplicingPointFlag<<2) + uint8(header.TrasportPrivateDataFlag<<1) + uint8(header.AdaptationFieldExtensionFlag)
|
||||
if err = util.WriteUint8ToByte(w, threeIndicatorFiveFlags); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
written += 1
|
||||
|
||||
// PCR(i) = PCR_base(i)*300 + PCR_ext(i)
|
||||
if header.PCRFlag != 0 {
|
||||
pcr := header.ProgramClockReferenceBase<<15 | 0x3f<<9 | uint64(header.ProgramClockReferenceExtension)
|
||||
if err = util.WriteUint48ToByte(w, pcr, true); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
written += 6
|
||||
}
|
||||
|
||||
// OPCRFlag
|
||||
if header.OPCRFlag != 0 {
|
||||
opcr := header.OriginalProgramClockReferenceBase<<15 | 0x3f<<9 | uint64(header.OriginalProgramClockReferenceExtension)
|
||||
if err = util.WriteUint48ToByte(w, opcr, true); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
written += 6
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
//
|
||||
//func (s *MpegTsStream) TestWrite(fileName string) error {
|
||||
//
|
||||
// if fileName != "" {
|
||||
// file, err := os.Create(fileName)
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// defer file.Close()
|
||||
//
|
||||
// patTsHeader := []byte{0x47, 0x40, 0x00, 0x10}
|
||||
//
|
||||
// if err := WritePATPacket(file, patTsHeader, *s.pat); err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
//
|
||||
// // TODO:这里的pid应该是由PAT给的
|
||||
// pmtTsHeader := []byte{0x47, 0x41, 0x00, 0x10}
|
||||
//
|
||||
// if err := WritePMTPacket(file, pmtTsHeader, *s.pmt); err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// var videoFrame int
|
||||
// var audioFrame int
|
||||
// for {
|
||||
// tsPesPkt, ok := <-s.TsPesPktChan
|
||||
// if !ok {
|
||||
// fmt.Println("frame index, video , audio :", videoFrame, audioFrame)
|
||||
// break
|
||||
// }
|
||||
//
|
||||
// if tsPesPkt.PesPkt.Header.StreamID == STREAM_ID_AUDIO {
|
||||
// audioFrame++
|
||||
// }
|
||||
//
|
||||
// if tsPesPkt.PesPkt.Header.StreamID == STREAM_ID_VIDEO {
|
||||
// println(tsPesPkt.PesPkt.Header.Pts)
|
||||
// videoFrame++
|
||||
// }
|
||||
//
|
||||
// fmt.Sprintf("%s", tsPesPkt)
|
||||
//
|
||||
// // if err := WritePESPacket(file, tsPesPkt.TsPkt.Header, tsPesPkt.PesPkt); err != nil {
|
||||
// // return err
|
||||
// // }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// return nil
|
||||
//}
|
||||
|
||||
func (s *MpegTsStream) readPAT(packet *MpegTsPacket, pr io.Reader) (err error) {
|
||||
// 首先找到PID==0x00的TS包(PAT)
|
||||
if PID_PAT == packet.Header.Pid {
|
||||
if len(packet.Payload) == 188 {
|
||||
pr = &util.Crc32Reader{R: pr, Crc32: 0xffffffff}
|
||||
}
|
||||
// Header + PSI + Paylod
|
||||
pat, err := ReadPAT(pr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.pat = &pat
|
||||
s.patPkt = packet
|
||||
}
|
||||
return
|
||||
}
|
||||
func (s *MpegTsStream) readPMT(packet *MpegTsPacket, pr io.Reader) (err error) {
|
||||
// 在读取PAT中已经将所有频道节目信息(PMT_PID)保存了起来
|
||||
// 接着读取所有TS包里面的PID,找出PID==PMT_PID的TS包,就是PMT表
|
||||
for _, v := range s.pat.Program {
|
||||
if v.ProgramMapPID == packet.Header.Pid {
|
||||
if len(packet.Payload) == 188 {
|
||||
pr = &util.Crc32Reader{R: pr, Crc32: 0xffffffff}
|
||||
}
|
||||
// Header + PSI + Paylod
|
||||
pmt, err := ReadPMT(pr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// send pmt
|
||||
s.pmt = &pmt
|
||||
s.pmtPkt = packet
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
func (s *MpegTsStream) Feed(ts io.Reader) error {
|
||||
var frame int64
|
||||
var tsPktArr []MpegTsPacket
|
||||
for {
|
||||
packet, err := ReadTsPacket(ts)
|
||||
if err == io.EOF {
|
||||
// 文件结尾 把最后面的数据发出去
|
||||
pesPkt, err := TsToPES(tsPktArr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.TsPesPktChan <- &MpegTsPesStream{
|
||||
TsPkt: *s.firstTsPkt,
|
||||
PesPkt: pesPkt,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pr := bytes.NewReader(packet.Payload)
|
||||
err = s.readPAT(&packet, pr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = s.readPMT(&packet, pr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// 在读取PMT中已经将所有的音视频PES的索引信息全部保存了起来
|
||||
// 接着读取所有TS包里面的PID,找出PID==elementaryPID的TS包,就是音视频数据
|
||||
for _, v := range s.pmt.Stream {
|
||||
if v.ElementaryPID == packet.Header.Pid {
|
||||
if packet.Header.PayloadUnitStartIndicator == 1 {
|
||||
if frame != 0 {
|
||||
pesPkt, err := TsToPES(tsPktArr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.TsPesPktChan <- &MpegTsPesStream{
|
||||
TsPkt: *s.firstTsPkt,
|
||||
PesPkt: pesPkt,
|
||||
}
|
||||
|
||||
tsPktArr = nil
|
||||
}
|
||||
s.firstTsPkt = &packet
|
||||
frame++
|
||||
}
|
||||
tsPktArr = append(tsPktArr, packet)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|