mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 01:15:52 +08:00
doc: update readme
This commit is contained in:
99
README.md
99
README.md
@@ -15,6 +15,8 @@
|
||||
<p align="center">
|
||||
A highly scalable high-performance streaming server development framework developed purely in Go
|
||||
<br />
|
||||
<a href="./README_CN.md">中文文档</a>
|
||||
·
|
||||
<a href="https://github.com/Monibuca/v5/wiki"><strong>Explore the docs »</strong></a>
|
||||
<br />
|
||||
<br />
|
||||
@@ -43,10 +45,27 @@
|
||||
|
||||
Monibuca is a powerful streaming server framework written entirely in Go. It's designed to be:
|
||||
|
||||
- 🚀 **High Performance** - Built for maximum efficiency and speed
|
||||
- 📦 **Modular** - Plugin-based architecture for easy extensibility
|
||||
- 🔧 **Flexible** - Highly configurable to meet various streaming needs
|
||||
- 💪 **Scalable** - Designed to handle large-scale deployments
|
||||
- 🚀 **High Performance** - Lock-free design, partial manual memory management, multi-core computing
|
||||
- ⚡ **Low Latency** - Zero-wait forwarding, sub-second latency across the entire chain
|
||||
- 📦 **Modular** - Load on demand, unlimited extensibility
|
||||
- 🔧 **Flexible** - Highly configurable to meet various streaming scenarios
|
||||
- 💪 **Scalable** - Supports distributed deployment, easily handles large-scale scenarios
|
||||
- 🔍 **Debug Friendly** - Built-in debug plugin, real-time performance monitoring and analysis
|
||||
- 🎥 **Media Processing** - Supports screenshot, transcoding, SEI data processing
|
||||
- 🔄 **Cluster Capability** - Built-in cascade and room management
|
||||
- 🎮 **Preview Features** - Supports video preview, multi-screen preview, custom screen layouts
|
||||
- 🔐 **Security** - Provides encrypted transmission and stream authentication
|
||||
- 📊 **Performance Monitoring** - Supports stress testing and performance metrics collection
|
||||
- 📝 **Log Management** - Log rotation, auto cleanup, custom extensions
|
||||
- 🎬 **Recording & Playback** - Supports MP4, HLS, FLV formats, speed control, seeking, pause
|
||||
- ⏱️ **Dynamic Time-Shift** - Dynamic cache design, supports live time-shift playback
|
||||
- 🌐 **Remote Call** - Supports gRPC interface for cross-language integration
|
||||
- 🏷️ **Stream Alias** - Supports dynamic stream alias, flexible multi-stream management
|
||||
- 🤖 **AI Capabilities** - Integrated inference engine, ONNX model support, custom pre/post processing
|
||||
- 🪝 **WebHook** - Subscribe to stream lifecycle events for business system integration
|
||||
- 🔒 **Private Protocol** - Supports custom private protocols for special business needs
|
||||
|
||||
- 🔄 **Supported Protocols**: RTMP, RTSP, HTTP-FLV, WS-FLV, HLS, WebRTC, GB28181, ONVIF, SRT
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
@@ -54,41 +73,27 @@ Monibuca is a powerful streaming server framework written entirely in Go. It's d
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Go 1.18 or higher
|
||||
- Go 1.23 or higher
|
||||
- Basic understanding of streaming protocols
|
||||
|
||||
### Installation
|
||||
### Run with Default Configuration
|
||||
|
||||
1. Create a new Go project
|
||||
2. Add Monibuca as a dependency:
|
||||
```sh
|
||||
go get m7s.live/v5
|
||||
```
|
||||
```bash
|
||||
cd example/default
|
||||
go run -tags sqlite main.go
|
||||
```
|
||||
|
||||
### Web UI
|
||||
|
||||
Place the `admin.zip` file (do not unzip) in the same directory as your configuration file.
|
||||
|
||||
Then visit http://localhost:8080 to access the UI.
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
## Usage
|
||||
## Examples
|
||||
|
||||
Here's a basic example to get you started:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"m7s.live/v5"
|
||||
_ "m7s.live/v5/plugin/debug"
|
||||
_ "m7s.live/v5/plugin/flv"
|
||||
_ "m7s.live/v5/plugin/rtmp"
|
||||
)
|
||||
|
||||
func main() {
|
||||
m7s.Run(context.Background(), "config.yaml")
|
||||
}
|
||||
```
|
||||
|
||||
For more examples, check out the [example directory](./example).
|
||||
For more examples, please check out the [example](./example) documentation.
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
@@ -146,14 +151,24 @@ Distributed under the MIT License. See `LICENSE` for more information.
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
<!-- CONTACT -->
|
||||
## Contact
|
||||
|
||||
monibuca - [@m7server](https://x.com/m7server) - service@monibuca.com
|
||||
|
||||
Project Link: [https://github.com/langhuihui/monibuca](https://github.com/langhuihui/monibuca)
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/Monibuca/v5.svg?style=for-the-badge
|
||||
[contributors-url]: https://github.com/Monibuca/v5/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/Monibuca/v5.svg?style=for-the-badge
|
||||
[forks-url]: https://github.com/Monibuca/v5/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/Monibuca/v5.svg?style=for-the-badge
|
||||
[stars-url]: https://github.com/Monibuca/v5/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/Monibuca/v5.svg?style=for-the-badge
|
||||
[issues-url]: https://github.com/Monibuca/v5/issues
|
||||
[license-shield]: https://img.shields.io/github/license/Monibuca/v5.svg?style=for-the-badge
|
||||
[license-url]: https://github.com/Monibuca/v5/blob/master/LICENSE
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[contributors-url]: https://github.com/langhuihui/monibuca/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[forks-url]: https://github.com/langhuihui/monibuca/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[stars-url]: https://github.com/langhuihui/monibuca/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[issues-url]: https://github.com/langhuihui/monibuca/issues
|
||||
[license-shield]: https://img.shields.io/github/license/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[license-url]: https://github.com/langhuihui/monibuca/blob/v5/LICENSE
|
||||
|
219
README_CN.md
219
README_CN.md
@@ -1,114 +1,123 @@
|
||||
# Monibuca v5
|
||||
|
||||
<a id="readme-top"></a>
|
||||
|
||||
[![Contributors][contributors-shield]][contributors-url]
|
||||
[![Forks][forks-shield]][forks-url]
|
||||
[![Stargazers][stars-shield]][stars-url]
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
[![AGPL License][license-shield]][license-url]
|
||||
[](https://pkg.go.dev/m7s.live/v5)
|
||||
|
||||
Monibuca(简称 m7s)是一款纯 Go 开发的开源流媒体服务器开发框架,支持多种流媒体协议。
|
||||
<br />
|
||||
<div align="center">
|
||||
<a href="https://monibuca.com">
|
||||
<img src="https://monibuca.com/svg/logo.svg" alt="Logo" width="200">
|
||||
</a>
|
||||
|
||||
## 特性
|
||||
<h1 align="center">Monibuca v5</h1>
|
||||
<p align="center">
|
||||
强大的纯 Go 开发的流媒体服务器开发框架
|
||||
<br />
|
||||
<a href="https://monibuca.com"><strong>官方网站 »</strong></a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://github.com/langhuihui/monibuca/issues">报告问题</a>
|
||||
·
|
||||
<a href="https://github.com/langhuihui/monibuca/issues">功能建议</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
- 🚀 高性能:采用纯 Go 开发,充分利用 Go 的并发特性
|
||||
- 🔌 插件化架构:核心功能都以插件形式提供,可按需加载
|
||||
- 🛠 可扩展性强:支持自定义插件开发
|
||||
- 📽 多协议支持:
|
||||
- RTMP
|
||||
- HTTP-FLV
|
||||
- HLS
|
||||
- WebRTC
|
||||
- GB28181
|
||||
- SRT
|
||||
- 🎯 低延迟:针对实时性场景优化
|
||||
- 📊 实时监控:支持 Prometheus 监控集成
|
||||
- 🔄 集群支持:支持分布式部署
|
||||
<!-- 目录 -->
|
||||
<details>
|
||||
<summary>目录</summary>
|
||||
<ol>
|
||||
<li><a href="#项目介绍">项目介绍</a></li>
|
||||
<li><a href="#快速开始">快速开始</a></li>
|
||||
<li><a href="#使用示例">使用示例</a></li>
|
||||
<li><a href="#构建选项">构建选项</a></li>
|
||||
<li><a href="#监控系统">监控系统</a></li>
|
||||
<li><a href="#插件开发">插件开发</a></li>
|
||||
<li><a href="#贡献指南">贡献指南</a></li>
|
||||
<li><a href="#许可证">许可证</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
## 项目介绍
|
||||
|
||||
Monibuca(简称 m7s)是一款纯 Go 开发的开源流媒体服务器开发框架。它具有以下特点:
|
||||
|
||||
- 🚀 **高性能** - 无锁设计、部分手动管理内存、多核计算
|
||||
- ⚡ **低延迟** - 0 等待转发、全链路亚秒级延迟
|
||||
- 📦 **插件化** - 按需加载,无限扩展能力
|
||||
- 🔧 **灵活性** - 高度可配置,满足各种流媒体场景需求
|
||||
- 💪 **可扩展** - 支持分布式部署,轻松应对大规模场景
|
||||
- 🔍 **调试友好** - 内置调试插件,支持实时性能监控和分析
|
||||
- 🎥 **媒体处理** - 支持截图、转码、SEI 数据处理
|
||||
- 🔄 **集群能力** - 内置级联和房间管理功能
|
||||
- 🎮 **预览功能** - 支持视频预览、分屏预览、自定义分屏
|
||||
- 🔐 **安全加密** - 提供加密传输和流鉴权能力
|
||||
- 📊 **性能监控** - 支持压力测试和性能指标采集
|
||||
- 📝 **日志管理** - 日志轮转、自动清理、自定义扩展
|
||||
- 🎬 **录制回放** - 支持 MP4、HLS、FLV 格式录制、倍速播放、拖拽快进、暂停能力
|
||||
- ⏱️ **动态时移** - 动态缓存设计,支持直播时移回看
|
||||
- 🌐 **远程调用** - 支持 gRPC 接口,方便跨语言集成
|
||||
- 🏷️ **流别名** - 支持动态设置流别名,灵活管理多路流,实现导播功能
|
||||
- 🤖 **AI 能力** - 集成推理引擎,支持 ONNX 模型,支持自定义的前置处理,后置处理,以及画框
|
||||
- 🪝 **WebHook** - 支持订阅流的生命周期事件,实现业务系统联动
|
||||
- 🔒 **私有协议** - 支持自定义私有协议,满足特殊业务需求
|
||||
|
||||
- 🔄 **多协议支持**:RTMP、RTSP、HTTP-FLV、WS-FLV、HLS、WebRTC、GB28181、ONVIF、SRT
|
||||
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 安装
|
||||
### 环境要求
|
||||
|
||||
1. 确保已安装 Go 1.23 或更高版本
|
||||
2. 创建新项目并初始化:
|
||||
- Go 1.23 或更高版本
|
||||
- 了解基本的流媒体协议
|
||||
|
||||
### 运行默认配置
|
||||
|
||||
```bash
|
||||
mkdir my-m7s-server && cd my-m7s-server
|
||||
go mod init my-m7s-server
|
||||
cd example/default
|
||||
go run -tags sqlite main.go
|
||||
```
|
||||
### UI 界面
|
||||
|
||||
3. 创建主程序:
|
||||
将 admin.zip (不要解压)放在和配置文件相同目录下。
|
||||
|
||||
```go
|
||||
package main
|
||||
然后访问 http://localhost:8080 即可。
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"m7s.live/v5"
|
||||
_ "m7s.live/v5/plugin/cascade"
|
||||
_ "m7s.live/v5/plugin/debug"
|
||||
_ "m7s.live/v5/plugin/flv"
|
||||
_ "m7s.live/v5/plugin/gb28181"
|
||||
_ "m7s.live/v5/plugin/hls"
|
||||
_ "m7s.live/v5/plugin/logrotate"
|
||||
_ "m7s.live/v5/plugin/monitor"
|
||||
_ "m7s.live/v5/plugin/mp4"
|
||||
_ "m7s.live/v5/plugin/preview"
|
||||
_ "m7s.live/v5/plugin/rtmp"
|
||||
_ "m7s.live/v5/plugin/rtsp"
|
||||
_ "m7s.live/v5/plugin/sei"
|
||||
_ "m7s.live/v5/plugin/snap"
|
||||
_ "m7s.live/v5/plugin/srt"
|
||||
_ "m7s.live/v5/plugin/stress"
|
||||
_ "m7s.live/v5/plugin/transcode"
|
||||
_ "m7s.live/v5/plugin/webrtc"
|
||||
)
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
func main() {
|
||||
m7s.Run(context.Background(), "config.yaml")
|
||||
}
|
||||
```
|
||||
## 使用示例
|
||||
|
||||
### 配置说明
|
||||
更多示例请查看 [example](./example/READEME_CN.md) 文档。
|
||||
|
||||
创建 `config.yaml` 配置文件:
|
||||
|
||||
```yaml
|
||||
# 全局配置
|
||||
global:
|
||||
http: :8080
|
||||
|
||||
# 插件配置
|
||||
rtmp:
|
||||
tcp: :1935
|
||||
```
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
## 构建选项
|
||||
|
||||
| 构建标签 | 描述 |
|
||||
| ---------- | ---------------------- |
|
||||
| disable_rm | 禁用内存池 |
|
||||
| sqlite | 启用 SQLite 存储 |
|
||||
| sqliteCGO | 启用 SQLite CGO 版本 |
|
||||
| mysql | 启用 MySQL 存储 |
|
||||
| postgres | 启用 PostgreSQL 存储 |
|
||||
| duckdb | 启用 DuckDB 存储 |
|
||||
| taskpanic | 抛出 panic(用于测试) |
|
||||
可以使用以下构建标签来自定义构建:
|
||||
|
||||
## 项目结构
|
||||
| 构建标签 | 描述 |
|
||||
|----------|------|
|
||||
| disable_rm | 禁用内存池 |
|
||||
| sqlite | 启用 SQLite 存储 |
|
||||
| sqliteCGO | 启用 SQLite CGO 版本 |
|
||||
| mysql | 启用 MySQL 存储 |
|
||||
| postgres | 启用 PostgreSQL 存储 |
|
||||
| duckdb | 启用 DuckDB 存储 |
|
||||
| taskpanic | 抛出 panic(用于测试) |
|
||||
|
||||
```
|
||||
monibuca/
|
||||
├── plugin/ # 官方插件目录
|
||||
├── pkg/ # 核心包
|
||||
├── example/ # 示例代码
|
||||
├── doc/ # 文档
|
||||
└── scripts/ # 实用脚本
|
||||
```
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
## 插件开发
|
||||
## 监控系统
|
||||
|
||||
查看 [plugin/README_CN.md](./plugin/README_CN.md) 了解如何开发自定义插件。
|
||||
|
||||
## Prometheus 监控
|
||||
|
||||
配置 Prometheus:
|
||||
Monibuca 内置支持 Prometheus 监控。在 Prometheus 配置中添加:
|
||||
|
||||
```yaml
|
||||
scrape_configs:
|
||||
@@ -118,20 +127,48 @@ scrape_configs:
|
||||
- targets: ["localhost:8080"]
|
||||
```
|
||||
|
||||
## 示例
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
更多使用示例请查看 [example](./example) 目录。
|
||||
## 插件开发
|
||||
|
||||
Monibuca 支持通过插件扩展功能。查看[插件开发指南](./plugin/README_CN.md)了解详情。
|
||||
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
## 贡献指南
|
||||
|
||||
欢迎提交 Pull Request 或 Issue。
|
||||
我们非常欢迎社区贡献,您的参与将使开源社区变得更加精彩!
|
||||
|
||||
1. Fork 本项目
|
||||
2. 创建您的特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||
3. 提交您的修改 (`git commit -m '添加一些特性'`)
|
||||
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
||||
5. 发起 Pull Request
|
||||
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
## 许可证
|
||||
|
||||
本项目采用 AGPL 许可证,详见 [LICENSE](./LICENSE) 文件。
|
||||
|
||||
## 相关资源
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
- [官方文档](https://docs.m7s.live/)
|
||||
- [API 参考](https://pkg.go.dev/m7s.live/v5)
|
||||
- [示例代码](./example)
|
||||
## 联系方式
|
||||
|
||||
- 微信公众号:不卡科技
|
||||
- QQ群:751639168
|
||||
- QQ频道:p0qq0crz08
|
||||
|
||||
<p align="right">(<a href="#readme-top">返回顶部</a>)</p>
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[contributors-url]: https://github.com/langhuihui/monibuca/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[forks-url]: https://github.com/langhuihui/monibuca/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[stars-url]: https://github.com/langhuihui/monibuca/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[issues-url]: https://github.com/langhuihui/monibuca/issues
|
||||
[license-shield]: https://img.shields.io/github/license/langhuihui/monibuca.svg?style=for-the-badge
|
||||
[license-url]: https://github.com/langhuihui/monibuca/blob/v5/LICENSE
|
||||
|
Reference in New Issue
Block a user