百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pyrtmp

> 编程语言
开源

PyRTMP: 纯 Python RTMP 服务器

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

PyRTMP: 纯 Python RTMP 服务器

PyRTMP: Pure Python RTMP server

Features

  • ✅ Pure Python
  • ✅ Easy to customize
  • ✅ Production Ready
  • ✅ UV loop
  • ✅ PyPy
  • ✅ Support RTMP(s)
  • ✅ Support RTMPT(s)

Announcement

After using this package for years in production server. It runs flawlessly without any problem. So I decided to switch the development status from Beta to Production since version 0.2.0. Also, I share my configuration at Deployment section below.

If you have any problems. Feel free to create issue on GitHub.

What's new

0.3.0

  • Clean up, refactoring, bug fixes
  • Add more testcases.
  • Add support to Python 3.11
  • Add GitHub action workflows
  • Add RTMP to FFMPEG example
  • Add RTMP to FLV example
  • Add RTMPT example

Installation

Install from PyPI:

bash
pip install pyrtmp

Install from source:

bash
pip install pyrtmp@git+https://github.com/Eittipat/pyrtmp.git

Quickstart

Let say we want to create a simple RTMP server that can save all incoming stream to FLV file. We can do it by creating a subclass of Simple RTMP controller and override some methods. Here is the example:

…

Next, we can test our server by executing the following command:

ffmpeg -i my_test_file.flv -c:v copy -c:a copy -f flv rtmp://127.0.0.1:1935/test/sample

Your flv file will be saved in the same directory as your python script.

Deployment

In production environment, You should run multiple instances of RTMP server and use load balancer to distribute incoming stream. I recommend to use Nginx as a load balancer and Supervisord to manage your RTMP server instances. Also, uvloop or pypy can be used to boost your performance.

Here is nginx configuration example:

stream {

    upstream stream_backend {
        127.0.0.1:1936;
        127.0.0.1:1937;
    }

    server {
        listen     1935;
        proxy_pass stream_backend;
    }
}

Benchmark

Coming soon.

Roadmap

  • Support AMF3
  • ReStream / Client Mode
  • Documentation

Issues· 12 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言