langhuihui ebc7e9001a 1 新增LL-HLS支持
该协议为苹果公司推出的低延迟HLS协议,本次更新新增了对该协议播放支持。
同rtsp库一样,采用了第三方库来实现:**github.com/bluenviron/gohlslib**

1.1 使用方法

通过访问形如http://localhost:8080/llhls/live/test/index.m3u8来播放。
其中**live/test**为streamPath,可以替换成实际的值

1.2 插件配置

在llhls下可以配置http配置,用于修改端口号。插件配置方式可以参考文档

1.3 源码说明

llhls相关代码位于**github.com/Monibuca/plugin-hls** 的 **llhls.go** 中。hls和llhls两个插件共用一个代码仓库,因此引入hls时也同时引入了llhls插件。

2 新增HLS.js测试页面

HLS.js测试页面是将hls.js的编译后的代码嵌入到了hls插件仓库中,以方便调试hls流使用。

2.1 访问地址

http://localhost:8080/hls/index.html

该页面也可以用于测试llhls

3 新增对RTMPS协议支持

该协议为RTMP协议的衍生协议,是在TCP基础上增加了TLS安全加固,原理类似HTTPS。
该协议支持是rtmp插件的增强。需要通过配置TLS端口来开启该功能。

3.1 配置

```yaml
rtmp:
  tcp:
    listenaddrtls: :4443
```

3.2 推流测试
```
ffmpeg -i source -f flv rtmps://localhost:4443/live/test
```
如果配置成443端口,则可以省略端口号

3.3 对外推拉流

已经支持,既可以在配置pull或者push中使用rtmps的远程地址

4 其他更新内容

4.1 优化了HLS纯转发模式的资源消耗

> 当只需要将HLS拉流转发时,可以使用纯转发模式
> 纯转发模式由于不需要解析HLS协议中的TS格式,因此对资源消耗比较小。
> 通过配置HLS插件的 **relaymode: 1**开启

4.2 修复了当开启时光回溯功能时的内存泄漏

具体原因是,在进行时间戳判断时忽略了当时间戳超过最大值时的情况,导致ringbuffer无限扩大
> 所谓时光回溯功能,是指可以缓存较多的数据,以订阅当前画面更早一些的画面
> 通过配置**publish**配置中的**buffertime**来开启时光回溯
> 订阅流时需要指定订阅模式,即需要在订阅时加参数`?mode=2`
> 如果需要修改参数名称(有时可能会有冲突,可以通过配置submodeargname 来改变

4.3 WebRTC插件测试页面运行URL中带有参数

为了更方便测试WebRTC功能,允许在访问测试页面时,带上参数

4.3.1 推流测试页面

**http://localhost:8080/webrtc/test/publish?streamPath=live/test**
可以推送到**live/test**。不传该参数则推送到**live/webrtc**

测试房间功能是也可以带上token参数

4.3.2 播放测试页面

**http://localhost:8080/webrtc/test/subscribe?streamPath=live/test**
可以订阅**live/test**的流。不传该参数则订阅**live/webrtc**

4.4 Stream中增加NeverTimeout属性

该属性设置成true可以是的流不再判断超时,保持流永远存活,其目的是有些流并不会产生AudioTrack和VideoTrack,比如纯转发流,或者Room的用于广播消息的流,此时可以在发布成功后,对流设置这个属性
2023-06-04 23:00:11 +08:00
2023-02-02 12:46:42 +08:00
2022-04-23 21:39:01 +08:00
2023-06-04 23:00:11 +08:00
2023-06-04 23:00:11 +08:00
2020-05-17 14:01:04 +08:00
2023-05-05 18:32:34 +08:00
2023-05-05 18:32:34 +08:00

中文文档

# Core code base and plug-in code base

https://github.com/Monibuca

Introduction

What is Monibuca (m7s)?

Monibuca (pronounced: analog not card, m7s is its abbreviation, similar to k8s) is an open source streaming server development framework developed in Go. It is based on go1.19+, in addition to no other dependencies built, and provides a set of plug-in secondary development model to help you efficiently develop streaming media servers, you can directly use the official plug-in, or develop your own plug-in to extend any function, so Monibuca is a framework that can support any streaming protocol!

Monibuca consists of three parts: engine, plugins, and instance project.

The engine provides a common streaming data cache and forwarding mechanism, and does not care how the protocol is implemented The plugins offer all the other features and can be extended indefinitely An instance project is a project project that introduces the engine and plugins and starts the engine, and can be written entirely by yourself

Plug-in framework

Monibuca aims to build a general streaming media development ecosystem, so since the v1 version, it has considered the decoupling of services and stream forwarding, so as to design a set of plug-in mechanisms that can be arbitrarily extended. Depending on your needs, you can flexibly introduce different types of plugins:

  • Provide streaming media protocol packaging/unpacking, such as RTMP plug-ins, RTSP plug-ins, etc
  • Provides log persistence processing - logrotate plugin
  • Provide recording function - record plugin
  • Provide rich debugging functions - debug plugin
  • Provide HTTP callback capability - hook plugin If you are an experienced developer, then the best way is to carry out secondary development on the basis of existing plugins, and provide reusable plugins to more people to enrich the ecosystem. If you're a beginner in streaming, the best way to do this is to use existing plugins to cobble together the features you need and ask experienced developers for help.

Key features

Engine aspect

  • Provides a plug-in mechanism to manage plug-in startup, configuration resolution, event distribution, etc. in a unified manner
  • Provide forwarding in H264, H265, AAC, G711 format
  • Provide reusable AVCC format, RTP format, AnnexB format, ADTS format and other pre-encapsulation mechanisms
  • Provides a multi-track mechanism, supports large and small streams, and encrypts stream expansion
  • Provide DataTrack mechanism, which can be used to implement functions such as room text chat
  • Provide timestamp synchronization mechanism and speed limit mechanism
  • Provides an RTP packet reorder mechanism
  • Provide subscriber frame chasing and skipping mechanism (first screen second on)
  • Provides the infrastructure for publish-subscribe push and pull out
  • Provides underlying architecture support for authentication mechanisms
  • Provides a memory reuse mechanism
  • Provides a mechanism for publishers to disconnect and reconnect
  • Provides an on-demand flow pulling mechanism
  • Provides a common mechanism for HTTP service ports
  • Provides an automatic registration mechanism for HTTP API interfaces
  • Provides HTTP interface middleware mechanism
  • Provides structured logs
  • Provides flow information statistics and output
  • Provides an event bus mechanism that broadcasts events to all plug-ins
  • Provides a configuration hot update mechanism

Plug-in aspect

  • Provide RTMP protocol push-pull stream, external push-pull stream (RTMPS supported)
  • Provides RTSP push and pull streams and external push and pull streams
  • Provides HTTP-FLV protocol to pull streams, pull external streams, and read local FLV files
  • Provides streaming of the WebSocket protocol
  • Provides HLS protocol to pull streams and pull outflows
  • Provides push-pull streams for the WebRTC protocol
  • Provides GB28181 protocol push and dump playback analysis capabilities
  • Provide support for the Onif protocol
  • Provides streaming of WebTransport protocol
  • Provides FMP4 protocol for pulling streams
  • Provides edge server functionality to implement cascading streaming
  • Provide video recording function, support FLV, MP4, HLS, RAW formats
  • Provides log persistence by day, hour, minute, second, size, and number of files
  • Provide a screenshot function
  • Provides HTTP callback function
  • Preview features available (integrated with Jessibuca Pro)
  • Room function available (video conferencing possible)
  • Provide the function of docking with Prometheus

Third-party plugins and paid plugins provide additional functionality and are not listed here.

Inspired by:

Remote console

  • Provides multi-instance management
  • Provide flow details display
  • Provides visual editing of configurations
  • Provides visual display of logs
  • Provide visual management of plugins
  • Provides GB device management
  • Provides an interface for dynamically adding remote push-pull flows
  • Provide WebRTC background wall function
  • Provide multiplayer video demonstrations

Origin of the name

The word Monibuca is derived from (Monica), and in order to solve the naming problem, three names are used to represent server, player, and streamer. Since Monica, Jessica, and Rebecca all have words, which is not good for the live broadcast (ca - means block in Chinese), it was changed to Monibuca, Jessibuca(https://jessibuca.com), and Rebebuca(https://rebebuca.com). (bu- means not)

Install

  • The compiled binary executable files (i.e. green software) of each platform are officially provided, so it can run without installing any other software.
  • If you need to compile and start the project yourself, you need to install go1.19 or above.

The official download link of the latest version is provided:

Don't forget to fix the rights chmod +x m7s_xxx_xxx on Linux and Mac.

Run

Executable files run directly

  • Linux, for example, downloaded to /opt/m7s_linux_x86, then $ cd /opt ' and then $ ./m7s_linux_x86`
  • Similar to Linux and Mac, you may need to modify the executable permissions of the file or double-click to run
  • Windows, double-click m7s directly_windows_x86.exe can be started

:::tip 运行多实例 由于实例会监听http端口所以如果需要运行多实例就需要为每个实例指定不同的http端口因此需要启动时指定配置文件例如./m7s_linux_x86 -c config.yaml :::

Self-compiled startup project

  1. git clone https://github.com/langhuihui/monibuca
  2. cd monibuca
  3. go run .

Self-created startup project

You can watch the video tutorial:

Description
🧩 Monibuca is a Modularized, Extensible framework for building Streaming Server
Readme AGPL-3.0 98 MiB
Languages
Go 52.3%
JavaScript 27.3%
C++ 15.6%
C 1.5%
HTML 1.3%
Other 1.9%