π¨π³ δΈζζζ‘£ | πΊπΈ English
MMS: A high-performance, multi-threaded, and multi-coroutine real-time streaming server implemented in C++20
MMS Server is a high-performance, real-time streaming media server built with C++20, designed specifically for live streaming and low-latency communication scenarios. It supports a wide range of mainstream streaming protocols, including:
- RTMP / RTMPS
- HTTP / HTTPS-FLV
- HTTP / HTTPS-HLS
- HTTP / HTTPS-TS
- HTTP / HTTPS-DASH
- RTSP / RTSPS
- WebRTC
Leveraging the power of C++20 coroutines, MMS achieves high efficiency and maintainability, significantly reducing the complexity of asynchronous programming compared to traditional high-performance server architectures. This also enhances scalability and long-term maintainability.
MMS is released under the MIT License and is compatible with popular clients such as FFmpeg, OBS, VLC, and WebRTC. It supports media ingestion, protocol conversion, and distribution in a typical publish (push) and subscribe (play) model. For example, an incoming RTMP stream can be converted to HLS, HTTP-FLV, or WebRTC formats for playback.
Designed primarily for live streaming, MMS supports RTMP, HLS, HTTP-FLV, as well as WebRTC protocols like WHIP and WHEP, making it suitable as a core component of a real-time audio and video delivery system. It can be easily integrated with other open-source tools to build a complete streaming solution.
For system integration and operations, MMS provides a comprehensive HTTP API for status monitoring and supports HTTP callbacks to integrate features like authentication, event notifications, and custom business logic (e.g., DVR control).
MMS is developer-friendly and recommended for development and testing on Ubuntu 22.04 or Rocky Linux 9.5.
π Documentation is available at: http://www.mms-server.tech/en/
- Currently supports Linux platforms only.
- Requires a GCC compiler with full C++20 support (GCC 13 or higher recommended).
- Requires CMake version 3.25.0 or above.
- Requires development tools:
automake,autoconf,libtool. - Requires Go for building BoringSSL.
- Requires NASM/YASM for building libav.
If compiling GCC (e.g., version 13.1+) from source, ensure it is configured with appropriate options. You can verify with g++ -v. A typical configuration command might look like:
../configure --enable-bootstrap --enable-languages=c,c++,lto --prefix=/root/gcc-13.1 \
--with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix \
--enable-checking=release --disable-multilib --with-system-zlib \
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object \
--enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace \
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array \
--enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted \
--enable-gnu-indirect-function --enable-cet --with-tune=generic \
--with-arch_64=x86-64-v2 --with-build-config=bootstrap-lto --enable-link-serialization=1Incorrect configuration may lead to linking errors. For more information, refer to this issue: #2
git clone https://github.com/jbl19860422/mms-server
cd mms-server
mkdir build && cd build
cmake .. && make -j4 install
β οΈ Ensure a stable internet connection during the build process, as third-party libraries (e.g., Boost, FFmpeg) will be downloaded. This may take some time.
After compilation, the executable mms-live-server will be located in the mms-server/bin directory.
Before running, ensure proper configuration. MMS uses YAML format for its configuration files. To simplify deployment, no default domain is provided β you must configure at least one publishing domain; otherwise, streaming attempts will result in 403 Forbidden errors.
Configuration directory structure:
config/
βββ mms.yaml
βββ publish/
β βββ test1.publish.com.yaml
β βββ test2.publish.com.yaml
βββ play/
β βββ test1.play.com.yaml
β βββ test2.play.com.yaml
-
config/β Main configuration directory.mms.yaml: Global server settings (ports for RTMP, HTTP, RTSP, WebRTC, etc.)
-
publish/β Configuration files for publishing domains (e.g.,test1.publish.com.yaml). -
play/β Configuration files for playback domains (e.g.,test1.play.com.yaml).
Each publishing domain can serve multiple playback domains. When a playback request is received, the system checks whether the corresponding stream exists under a valid publishing domain. If found, playback is allowed; otherwise, a 404 Not Found error is returned.
π For detailed configuration examples, please refer to [xxxxx].
mms-live-server -c ./config -d-cspecifies the configuration directory.-denables log output to the console (omit this flag to write logs to files instead).
Please refer to xmake_guide.md for more information.
This project supports one-click deployment using Docker Compose. It is currently based on the Ubuntu 24.04 Docker image and is suitable for macOS and other non-Linux platforms to set up the environment conveniently.
In the docker-compose.yaml file, update the mount path <local mms-server path> and container name <container name> to your local directory and desired container name:
services:
<container name>:
...
container_name: <container name>
...
volumes:
- <local mms-server path>:/mnt/workspace/mms-server
...(Optional) In the Dockerfile, you may change the default Ubuntu username myuser and password password to your custom credentials:
...
# Add a non-root user and grant sudo permissions
RUN useradd -ms /bin/bash myuser && \
echo "myuser:password" | chpasswd && \
usermod -aG sudo myuser
# Install xmake (as root)
RUN add-apt-repository -y ppa:xmake-io/xmake && \
apt update && \
apt install -y xmake
# Switch to the non-root user
USER myuser
WORKDIR /home/myuser
...Run the following commands in the project root directory:
# Start the container in the background (will build on first run)
docker compose up -d
# Enter the container shell
docker exec -it <container name> bash
# Stop the container
docker compose stopOnce inside the container, you can run xmake -j8 to automatically install project dependencies and build the project.
The mms-server includes a built-in static file server, allowing you to host the standalone Vue-based web console directly within the same server environment.
To enable the static file server and map the console path, update your mms.yaml as follows:
http_api:
enabled: true
port: 8080
static_file_server:
enabled: true
path_map:
/console/*: /data/consoleThis configuration maps requests to /console/* to the local directory /data/console.
Navigate to the console directory and initialize any submodules:
cd console
git submodule update --init --recursiveInstall dependencies and compile the Vue application:
npm install
npm run buildThis will generate a console build directory inside the current folder.
Copy the generated console directory to the target path configured in mms.yaml:
cp -rf console /data/Make sure /data/console matches the path_map configuration above.
Once deployed, the console can be accessed at:
http://<your-ip>:8080/console/index.html
Replace <your-ip> and 8080 with the actual IP address and port defined in your http_api configuration.
- mms-server QQ Group: 1053583153
- Personal Contact: 13066836861
- Email: [email protected] or [email protected]