Skip to main content

A pure Python 3 RTMP server.

Project description

RTMPLite3

Latest version released on PyPi

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

This project was migrated from https://code.google.com/p/rtmplite on May 17, 2015
Please see these individual description files for rtmplite

Copyright

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.

See contributors.

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.

Branches

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

RTMP server

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.

Documentation

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.

Getting Started

Dependencies: Python 3.6+

Tested environment:

  • 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

  1. 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
  1. 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.

  1. 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

Known issues

  1. The program cannot exit with Control+C in Windows
  2. Viewer cannot join the stream after the feed started to broadcast
  3. recording and verbose mode will not enable when run with direct command and run as Python module

Contribution

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?

  • For Issue

    • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtmplite3-0.4.0.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

rtmplite3-0.4.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file rtmplite3-0.4.0.tar.gz.

File metadata

  • Download URL: rtmplite3-0.4.0.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for rtmplite3-0.4.0.tar.gz
Algorithm Hash digest
SHA256 52f48300325e61fc7b0777e1175629164198607851dc5d36009b34f2c0997712
MD5 4a788cc8e36465dd05e990964d64df42
BLAKE2b-256 11c7874614199778b4f4e5936e514126a3c13d933064cacce4d20169cc272560

See more details on using hashes here.

File details

Details for the file rtmplite3-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: rtmplite3-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 52.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for rtmplite3-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77a80097a4528cc9a4e2ae8ffd24042a94b6083e9ffe0d72f55a7a094846c781
MD5 e28dddda1bac532d445c26a511161a2a
BLAKE2b-256 750b03102b1e33eb40491415df8590f8dededbd1df1a3ae618a20b01aed70d6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page