Lightweight, zero-dependency proxy and storage RTSP server

Overview

python-rtsp-server

Python-rtsp-server is a lightweight, zero-dependency proxy and storage server for several IP-cameras and multiple clients.

Features:

  • Reliable connection of clients in the local network. One connection to each camera, regardless of the number of clients.
  • Minimum client connection latency.
  • Low CPU load.
  • Proxying streams from IP cameras to an unlimited number of clients in the local network, the ability to limit the number of web clients.
  • Ability to save to hard disk, with fragmentation and daily rotation.
  • Restoring of connection with cameras and recording to disk after a possible disconnection of cameras.

Requirements:

Python 3.7+ is required. Optionally uses system-wide utilities for saving streams to file storage, such as ffmpeg, OpenRTSP or mencoder.

Compatible with Linux. Supports H.264, H.265 and H.265+ codecs.

Tested with Hikvision DS-2CD2023 and Rubetek RV-3414 IP-cameras, using VLC as a client.

Installation:

Copy config-example.py to private configuration file _config.py and edit _config.py.

Start the server:

python3 main.py

Basic usage

UDP mode:

vlc rtsp://localhost:4554/camera-hash

TCP mode:

vlc --rtsp-tcp rtsp://localhost:4554/camera-hash

Start on boot with systemd

Create the service unit /etc/systemd/system/python-rtsp-server.service:

[Unit]
Description="video monitoring"

[Service]
ExecStart=/usr/bin/python3 /path-to-python-rtsp-server/main.py

[Install]
WantedBy=multi-user.target

Enable and start the service:

sudo systemctl enable python-rtsp-server
sudo systemctl start python-rtsp-server

Copyright (c) 2021 vladpen under MIT license. Use it with absolutely no warranty.

You might also like...
Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.
Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.

Text2Video Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images

Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Shorts-Tik-Tok-Creator Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Real-time video and audio streams over the network, with Streamlit.

streamlit-webrtc Example You can try out the sample app using the following commands.

Been busy guys, will be reviewing and integrating pull requests shortly. Thanks to all contributors!               LATEST RELEASE: 6.0.0 - flatpak @ https://flathub.org/apps/details/com.ozmartians.VidCutter - snap @ https://snapcraft.io/vidcutter - see https://github.com/ozmartian/vidcutter/releases for more details...
Stream music with ffmpeg and python

youtube-stream Stream music with ffmpeg and python original Usage set the KEY in stream.sh run server.py run stream.sh (You can use Git bash or WSL in

KonomiTV: Kind and Optimized Next brOadcast watching systeM Infrastructure for TV
KonomiTV: Kind and Optimized Next brOadcast watching systeM Infrastructure for TV

備考・注意事項 現在 α 版で、まだ実験的なプロダクトです。通常利用には耐えないでしょうし、サポートもできません。 安定しているとは到底言いがたい品質ですが、それでも構わない方のみ導入してください。 使い方などの説明も用意できていないため、自力でトラブルに対処できるエンジニアの方以外には現状おすすめ

Youtube as covert-channel - Control systems remotely and execute commands by uploading videos to Youtube
Youtube as covert-channel - Control systems remotely and execute commands by uploading videos to Youtube

covert-tube A program to control systems remotely by uploading videos to Youtube using Python to create the videos and the listener, emulating some ma

A python program which converts images and video into excel spreadsheets.
A python program which converts images and video into excel spreadsheets.

image2excel A program which converts images and video into Excel spreadsheets. Usage examples can be found in examples Videos can take a long time to

Python and OpenCV-based scene cut/transition detection program & library.
Python and OpenCV-based scene cut/transition detection program & library.

Video Scene Cut Detection and Analysis Tool Latest Release: v0.5.6.1 (October 11, 2021) Main Webpage: py.scenedetect.com Documentation: manual.scenede

Comments
  • MPV (ffmpeg) не воспроизводит rtsp поток

    MPV (ffmpeg) не воспроизводит rtsp поток

    VLC воспроизводит, MPV (и, соответственно, ffmpeg) - нет. Пишет CSeq 3 expected, 0 received.

    Дебаг со стороны сервера выглядит так:

    ~~~ Client: read
    SETUP rtsp://127.0.0.1:4554/Серверная/track1 RTSP/1.0
    Transport: RTP/AVP/TCP;unicast;interleaved=0-1
    CSeq: 3
    User-Agent: libmpv
    
    
    ~~~ Client: write
    RTSP/1.0 200 OK
    CSeq: 3
    Transport: RTP/AVP/TCP;unicast;interleaved=0-1
    Session: z37o9h5cf;timeout=60
    
    
    Client: connection closed: 127.0.0.1:40300
    

    Если MPV напрямую к камере подключить, то все ок.

    opened by Dreadeath 0
  • Поток от Axis

    Поток от Axis

    Приветствую. Не могу проиграть VLC поток от сервера. Поток от камеры отдается по вот такому адресу rtsp://login:[email protected]:554/axis-media/media.amp

    В storage пишется, отдельно поток VLC воспроизводит, а вот через сервер вида rtsp://ip:4554/hash выдает ошибку Client: error: can't handle request from 192.168.1.176: Invalid track ID in reply

    С хиквижн работало, с аксисом не хотит :( Куда копать?

    opened by Dreadeath 2
Owner
Vlad
Vlad
A web RTSP play platform based on websocket and tornado, websocket use blob binaryType read as ArrayBuffer

A web RTSP play platform based on websocket and tornado, websocket use blob binaryType read as ArrayBuffer

null 2 Feb 25, 2022
Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC technology

WebRTC Camera Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC technology. Based on: Pion - pure Go implem

Alex X 739 Dec 30, 2022
Video Object Segmentation(VOS) From Zero to HeroVideo Object Segmentation(VOS) From Zero to Hero

Video Object Segmentation(VOS) From Zero to Hero! Goal 1:train a two layers cnn model for vos. Finish! see model.py FFNet for more diteal.(2021.9.30)

null 1 Oct 22, 2021
Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.

Vigilio Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser

Tugcan Olgun 141 Jan 6, 2023
Webcam Indicator is an application to recieve and send messages from your own Webcam Server.

Welcome to Webcam Indicator ?? Webcam Indicator is an application to recieve and send messages from your own Webcam Server. ?? Homepage Prerequisites

Lorenzo Carbonell 2 Apr 4, 2022
Your self hosted Youtube media server

The Tube Archivist Your self hosted Youtube media server Core functionality Subscribe to your favourite Youtube channels Download Videos using yt-dlp

Simon 2.1k Dec 31, 2022
Jio TV Server - Watch TV right from your laptop

Jio-PyServer Jio TV - Python Server Watch TV right from your laptop! Requirements: Python 3.X Internet Access A Jio Account Known Issues: Channel Stre

Elvis Tony 11 Apr 5, 2022
Help for manipulating the plex-media-server transcode on the raspberry pi

raspi-plex-transcode Help for manipulating the plex-media-server transcode on the raspberry pi Ensure hardware decoding works and your firmware is up

null 10 Sep 29, 2022
OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality v

OpenShot Studios, LLC 3.1k Jan 1, 2023
MoviePy is a Python library for video editing, can read and write all the most common audio and video formats

MoviePy is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery for some examples of use.

null 10k Jan 8, 2023