Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pyrtmp

> 编程语言
Open source

PyRTMP: Pure Python RTMP server

100 stars0 likes0 views
WebsiteGitHub

About

PyRTMP: Pure Python RTMP server

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

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