{"id":29091284,"url":"https://github.com/jbl19860422/mms-server","last_synced_at":"2025-07-08T14:08:19.893Z","repository":{"id":293921983,"uuid":"984773948","full_name":"jbl19860422/mms-server","owner":"jbl19860422","description":"MMS is a high-performance, multi-threaded, and multi-coroutine real-time streaming server implemented in C++20. It currently supports rtmp[s]/http[s]-flv/http[s]-hls/http[s]-ts/rtsp[s]/webrtc.","archived":false,"fork":false,"pushed_at":"2025-06-27T07:11:43.000Z","size":94616,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-27T08:25:40.198Z","etag":null,"topics":["cpp20","dash","hls","hls-live-streaming","http-flv","live-streaming","rtmp","rtmps","rtsp","tls","ts","webrtc","websocket","whep","whip"],"latest_commit_sha":null,"homepage":"http://mms-server.tech/en/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbl19860422.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T13:38:07.000Z","updated_at":"2025-06-27T07:11:47.000Z","dependencies_parsed_at":"2025-06-27T08:33:07.191Z","dependency_job_id":null,"html_url":"https://github.com/jbl19860422/mms-server","commit_stats":null,"previous_names":["jbl19860422/mms-server"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jbl19860422/mms-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbl19860422%2Fmms-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbl19860422%2Fmms-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbl19860422%2Fmms-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbl19860422%2Fmms-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbl19860422","download_url":"https://codeload.github.com/jbl19860422/mms-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbl19860422%2Fmms-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262382745,"owners_count":23302298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp20","dash","hls","hls-live-streaming","http-flv","live-streaming","rtmp","rtmps","rtsp","tls","ts","webrtc","websocket","whep","whip"],"created_at":"2025-06-28T06:06:38.943Z","updated_at":"2025-06-28T06:06:42.330Z","avatar_url":"https://github.com/jbl19860422.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[🇨🇳 中文文档](README_zh.md) | [🇺🇸 English](README.md)\n\n# MMS: A high-performance, multi-threaded, and multi-coroutine real-time streaming server implemented in C++20\n\n## Introduction\n\n**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:\n\n* **RTMP / RTMPS**\n* **HTTP / HTTPS-FLV**\n* **HTTP / HTTPS-HLS**\n* **HTTP / HTTPS-TS**\n* **HTTP / HTTPS-DASH**\n* **RTSP / RTSPS**\n* **WebRTC**\n\nLeveraging 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.\n\nMMS 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.\n\nDesigned 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.\n\nFor 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).\n\nMMS is developer-friendly and recommended for development and testing on **Ubuntu 22.04** or **Rocky Linux 9.5**.\n\n\u003e 📘 Documentation is available at: [http://www.mms-server.tech/en/](http://www.mms-server.tech/en/)\n\n---\n\n## Compilation with CMake\n\n### Requirements\n\n* Currently supports **Linux** platforms only.\n* Requires a **GCC compiler** with full **C++20** support (GCC 13 or higher recommended).\n* Requires **CMake** version **3.25.0** or above.\n* Requires development tools: `automake`, `autoconf`, `libtool`.\n* Requires **Go** for building **BoringSSL**.\n* Requires **NASM/YASM** for building **libav**.\n\nIf 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:\n\n```bash\n../configure --enable-bootstrap --enable-languages=c,c++,lto --prefix=/root/gcc-13.1 \\\n--with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix \\\n--enable-checking=release --disable-multilib --with-system-zlib \\\n--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object \\\n--enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace \\\n--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array \\\n--enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted \\\n--enable-gnu-indirect-function --enable-cet --with-tune=generic \\\n--with-arch_64=x86-64-v2 --with-build-config=bootstrap-lto --enable-link-serialization=1\n```\n\nIncorrect configuration may lead to linking errors. For more information, refer to this issue:\n[https://github.com/jbl19860422/mms-server/issues/2](https://github.com/jbl19860422/mms-server/issues/2)\n\n---\n\n### Building from Source\n\n```bash\ngit clone https://github.com/jbl19860422/mms-server\ncd mms-server\nmkdir build \u0026\u0026 cd build\ncmake .. \u0026\u0026 make -j4 install\n```\n\n\u003e ⚠️ 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.\n\n---\n\n### Configuration\n\nAfter compilation, the executable `mms-live-server` will be located in the `mms-server/bin` directory.\n\nBefore 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.\n\nConfiguration directory structure:\n\n```text\nconfig/\n├── mms.yaml\n├── publish/\n│   ├── test1.publish.com.yaml\n│   └── test2.publish.com.yaml\n├── play/\n│   ├── test1.play.com.yaml\n│   └── test2.play.com.yaml\n```\n\n* `config/` — Main configuration directory.\n\n  * `mms.yaml`: Global server settings (ports for RTMP, HTTP, RTSP, WebRTC, etc.)\n* `publish/` — Configuration files for publishing domains (e.g., `test1.publish.com.yaml`).\n* `play/` — Configuration files for playback domains (e.g., `test1.play.com.yaml`).\n\nEach 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.\n\n\u003e 📘 For detailed configuration examples, please refer to \\[xxxxx].\n\n---\n\n### Running the Server\n\n```bash\nmms-live-server -c ./config -d\n```\n\n* `-c` specifies the configuration directory.\n* `-d` enables log output to the console (omit this flag to write logs to files instead).\n\n### Compilation with XMake\n\nPlease refer to [xmake_guide.md](xmake_guide.md) for more information.\n\n---\n\n## Docker Compose Quick Deployment Guide\n\nThis 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.\n\n### 1. Modify Configuration Files\n\nIn the `docker-compose.yaml` file, update the mount path `\u003clocal mms-server path\u003e` and container name `\u003ccontainer name\u003e` to your local directory and desired container name:\n\n```yaml\nservices:\n  \u003ccontainer name\u003e:\n...\n    container_name: \u003ccontainer name\u003e\n...\n    volumes:\n      - \u003clocal mms-server path\u003e:/mnt/workspace/mms-server\n...\n```\n\n(Optional) In the `Dockerfile`, you may change the default Ubuntu username `myuser` and password `password` to your custom credentials:\n\n```dockerfile\n...\n# Add a non-root user and grant sudo permissions\nRUN useradd -ms /bin/bash myuser \u0026\u0026 \\\n    echo \"myuser:password\" | chpasswd \u0026\u0026 \\\n    usermod -aG sudo myuser\n\n# Install xmake (as root)\nRUN add-apt-repository -y ppa:xmake-io/xmake \u0026\u0026 \\\n    apt update \u0026\u0026 \\\n    apt install -y xmake\n\n# Switch to the non-root user\nUSER myuser\nWORKDIR /home/myuser\n...\n```\n\n---\n\n### 2. Build and Run the Container\n\nRun the following commands in the project root directory:\n\n```bash\n# Start the container in the background (will build on first run)\ndocker compose up -d\n# Enter the container shell\ndocker exec -it \u003ccontainer name\u003e bash\n# Stop the container\ndocker compose stop\n```\n\nOnce inside the container, you can run `xmake -j8` to automatically install project dependencies and build the project.\n\n---\n\n### Single Server Console\n\n## 📦 Deploying the Web Console with `mms-server`\n\nThe `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.\n\n### 1. Configure `mms.yaml`\n\nTo enable the static file server and map the console path, update your `mms.yaml` as follows:\n\n```yaml\nhttp_api:\n  enabled: true\n  port: 8080\n  static_file_server:\n    enabled: true\n    path_map:\n      /console/*: /data/console\n```\n\nThis configuration maps requests to `/console/*` to the local directory `/data/console`.\n\n---\n\n### 2. Build and Deploy the Console\n\n#### 🔹 Clone the frontend project\n\nNavigate to the `console` directory and initialize any submodules:\n\n```bash\ncd console\ngit submodule update --init --recursive\n```\n\n#### 🔹 Build the project\n\nInstall dependencies and compile the Vue application:\n\n```bash\nnpm install\nnpm run build\n```\n\nThis will generate a `console` build directory inside the current folder.\n\n#### 🔹 Deploy the build\n\nCopy the generated `console` directory to the target path configured in `mms.yaml`:\n\n```bash\ncp -rf console /data/\n```\n\nMake sure `/data/console` matches the `path_map` configuration above.\n\n---\n\n### 3. Access the Console\n\nOnce deployed, the console can be accessed at:\n\n```text\nhttp://\u003cyour-ip\u003e:8080/console/index.html\n```\n\nReplace `\u003cyour-ip\u003e` and `8080` with the actual IP address and port defined in your `http_api` configuration.\n\n---\n\n## 📦 Contact\n\n1. mms-server QQ Group: 1053583153\n2. Personal Contact: 13066836861\n3. Email: \u003cjbl19860422@gmail.com\u003e or \u003cjbl19860422@163.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbl19860422%2Fmms-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbl19860422%2Fmms-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbl19860422%2Fmms-server/lists"}