Description
Web server that displays an RTSP video stream using ffmpeg as backend.
Sound is not supported.
Use as a Docker container
This section explains how to use this repository with Docker.
-
Build Docker container:
$ git clone https://github.com/luiscarlosgph/rtspwebviewer-ffmpeg.git $ cd rtspwebviewer-ffmpeg/docker $ docker build -t rtspwebviewer-ffmpeg .
-
Launch Docker container:
$ docker run --name rtspwebviewer-ffmpeg --net=host -e RTSP=<rtsp_stream_address> -e PORT=<port> -e WEB_TITLE=<web_title> -e WEB_PWD=<password> rtspwebviewer-ffmpeg:latest &
Options:
RTSP: RTSP stream address.PORT: listening port for the web server that will play the camera video.WEB_TITLE: the name of the website that will be displayed by your web browser.WEB_PWD: the URL-based password to access the web player.
-
Access the web player:
http://127.0.0.1:<port>/<password>.
Use as a standalone program
This sections explains how to use this repository without Docker, as a standalone Python program.
-
Install dependencies:
$ sudo apt update $ sudo apt install ffmpeg
-
Install
rtspwebviewer-ffmpeg:$ git clone https://github.com/luiscarlosgph/rtspwebviewer-ffmpeg.git $ cd rtspwebviewer-ffmpeg $ python3 setup.py install
-
Run
ffmpegto convert the RTSP stream into HLS:$ ffmpeg -fflags nobuffer -rtsp_transport tcp -i <rtsp_stream_address> -c copy -hls_time 2 -hls_wrap 10 <path_to_m3u8_file>
-
Run the web server:
$ python3 -m rtspwebviewer_ffmpeg.run --address <listening_ip_address> --port <port> --title <web_title> --password <password> --m3u8 <path_to_m3u8_file>
Options:
--address: Listening address, use0.0.0.0to listen in all interfaces (required).--port: TCP port to listen on (required).--title: website title (required).--password: password to append to the URL of the web server to access the web player (optional).---m3u8: path to them3u8file generated byffmpegin the previous step (required).
-
Access the web viewer:
http://<address>:<port>/<password>, e.g. for address0.0.0.0, port11931, and no password, access http://127.0.0.1:11931.
Author
Luis C. Garcia-Peraza Herrera (luiscarlos.gph@gmail.com).
License
This repository is shared under an MIT License.
Metadata
Release files for rtspwebviewer-ffmpeg 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rtspwebviewer_ffmpeg-0.0.2.tar.gz | 5.1 kB | Without provenance | Details for rtspwebviewer_ffmpeg-0.0.2.tar.gz |
Release files / rtspwebviewer_ffmpeg-0.0.2.tar.gz
| Download URL | rtspwebviewer_ffmpeg-0.0.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3389ff621acd0dfd300c46516cc2c7a6544112490ff73a0729b291e80ff508c7
|
|
BLAKE2b-256 checksum How to use checksums |
fac66f81d4bbccd3ad67e26b89ce7d1b3336d6d78ce0fbcb6156579f96ed3f03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Security for rtspwebviewer-ffmpeg 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.