A pure Python 3 RTMP server.
This repo is part of self-host video streaming project.
No major new function designated for RTMP server will be introduced. However, bugs will still be fixed and features required by the self-host video streaming project will still be developed. Link to the repo created by original author.
What is rtmplite3?
This is a fork of rtmplite with conversion of Python 2 to Python 3 More details in rtmplite
Copyright (c) 2007-2009, Mamta Singh.
Copyright (c) 2010-2011, Kundan Singh. All rights reserved.
Copyright (c) 2011-2012, Intencity Cloud Technologies. All rights reserved.
Copyright (c) 2011, Cumulus Python. No rights reserved.
Upgrade from the original repo
This repo aims to upgrade the original repo from Python 2 to Python 3, as well as integrate into my self-host video streaming project. Therefore, only rtmp.py and its dependencies will be modified in this repo.
Why am I doing this
I am working on a self-host video streaming project with Python 3 and Flask, hence, I need a Python 3 RTMP server. However, most of the Python RTMP solution do not match what I need (developed using Python 2, no longer maintained etc.), so, I decided to transit a Python 2 solution to Python 3.
This repo has three branches including master, dev and svs (self-host streaming).
- master: release branch; stable
- dev: development branch; maybe buggy or even can't run at all
- svs: customized branch for self-host video streaming project
The main program is rtmp.py. Please see the embedded documentation in that file. Some parts of the documentation are copied here. Other modules such as amf, util and multitask are used from elsewhere and contain their respective copyright notices.
Instead of looking at the documentation from the source code, I migrated (or migrating) the embedded documentation from the source code to Wiki of this repo.
Dependencies: Python 3.6+
- Windows 10 1803 with Python 3.8.3rc1
- Ubuntu 18.04.4 LTS with Python 3.6.9.
First, clone all source files from this repo or install rtmplite3 from pip:
# Download from this repo git clone https://github.com/KnugiHK/rtmplite3.git # Install from pip pip install rtmplite3
There are multiple methods for you to run the RTMP server directly
- If you install the latest version (0.2.5) from pip, you can now start the RTMP server with the following methods:
$ rtmplite3 -d #or $ python -m rtmplite3 -d
- Typically, an application can launch this server as follows if you clone this repo instead of install from pip:
$ python rtmp.py -d
The -d option enables debug trace so you know what is happening in the server.
There is also a -v option which enables verbose mode so you know all data sent and received in Hex. Please note that verbose mode will hugely affect the performance of the RTMP server
To know the command line options use the -h option:
$ python rtmp.py -h
For your convenience, this repo also provide you a single executable. You may want to check out our release page.
- And here is how to use the executable
# in Linux $ chmod +x rtmp-Linux $ ./rtmp-Linux :: in Windows > rtmp-Windows.exe or double click the file
- The program cannot exit with Control+C in Windows
- Viewer cannot join the stream after the feed started to broadcast
- recording and verbose mode will not enable when run with direct command and run as Python module
If you want to help me to improve the quality of this project, you can submit an issue.
If you want to collaborate with us, feel free to Fork this project and open a pull request.
What can you do?
- Report any Logical Error.
- Report any Run-Time Error.
- Request new features
- Ask questions if you do not understand something.
For Pull request
- Add comments to source code.
- Add new features
- Correct any Logical Error.
- Correct any Run-Time Error.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for rtmplite3-0.4.0-py3-none-any.whl