Skip to main content

Real-Time Annotation and Stream Processing Interface

Project description

RTASPI - Real-Time Annotation and Stream Processing Interface

RTASPI is a powerful system for detecting, managing, and streaming from local and remote audio/video devices. It enables easy sharing of camera and microphone streams through various protocols (RTSP, RTMP, WebRTC) while providing real-time processing capabilities.

Features

  • Device Management

    • Automatic detection of local video (cameras) and audio (microphones) devices
    • Network device discovery (IP cameras, IP microphones) via ONVIF, UPnP, and mDNS
    • Unified device management interface
  • Streaming Capabilities

    • Stream local devices via RTSP, RTMP, and WebRTC
    • Proxy streams from remote devices
    • Real-time stream transcoding
    • Multi-protocol support
  • Processing Features

    • Real-time video filtering and effects
    • Audio processing and filters
    • Speech recognition capabilities
    • Object detection and tracking
  • Integration & Control

    • RESTful API for remote control
    • Command-line interface (CLI)
    • Web interface for management
    • Module Communication Protocol (MCP) for inter-module communication

Documentation

System Requirements

  • Python 3.8 or newer
  • FFmpeg 4.0 or newer
  • GStreamer 1.14 or newer (for WebRTC)
  • NGINX with RTMP module (for RTMP)

System Dependencies

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg gstreamer1.0-tools gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-ugly nginx libnginx-mod-rtmp v4l-utils

macOS:

brew install ffmpeg gstreamer gst-plugins-base gst-plugins-good \
    gst-plugins-bad gst-plugins-ugly nginx

Windows:

Download and install:

Quick Start

  1. Install RTASPI:
pip install rtaspi
  1. Create a configuration file (rtaspi.config.yaml):
system:
  storage_path: 'storage'
  log_level: 'INFO'

local_devices:
  enable_video: true
  enable_audio: true
  auto_start: false
  1. Start RTASPI:
rtaspi start

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Struktura projektu

.
├── CHANGELOG.md
├── changelog.py
├── config.yaml
├── CONTRIBUTING.md
├── debug_imports.py
├── dist
│   ├── rtaspi-0.1.23-py3-none-any.whl
│   └── rtaspi-0.1.23.tar.gz
├── docs
│   ├── API.md
│   ├── CLI.md
│   ├── CONCEPTS.md
│   ├── CONFIGURATION.md
│   ├── INSTALL.md
│   ├── POST
│   │   ├── DE
│   │   ├── EN
│   │   └── PL
│   │       └── 1.md
│   ├── PROJECTS_LOCAL.md
│   ├── PROJECTS.md
│   ├── README.md
│   └── TREE.md
├── DONE.md
├── examples
├── fedora
│   └── python.sh
├── flatedit.txt
├── git.sh
├── install
│   ├── pyaudio2.py
│   ├── pyaudio2.sh
│   ├── pyaudio3.sh
│   ├── pyaudiodiag.py
│   ├── pyaudio.py
│   ├── pyaudio.sh
│   ├── pyautogui.md
│   ├── pyautogui.py
│   ├── README.md
│   ├── SPACY.md
│   ├── spacy.sh
│   └── windows.ps1
├── LICENSE
├── Makefile
├── MANIFEST.in
├── __pycache__
│   ├── __init__.cpython-311.pyc
│   ├── __init__.cpython-312.pyc
│   └── test_imports.cpython-312-pytest-8.3.5.pyc
├── pyproject.toml
├── pyproject.toml.bak
├── README.md
├── requirements.txt
├── rtaspi.config.yaml
├── rtaspi.devices.yaml
├── rtaspi.pipeline.yaml
├── rtaspi.secrets.yaml
├── rtaspi.streams.yaml
├── scripts
│   ├── configure_hardware.sh
│   ├── install_models.sh
│   ├── optimize_rpi.sh
│   ├── publish.sh
│   ├── setup_service.sh
│   └── upgrade.sh
├── service
│   ├── start.sh
│   └── stop.sh
├── setup.cfg
├── setup.py
├── src
│   ├── rtaspi
│   │   ├── api
│   │   │   ├── devices.py
│   │   │   ├── __init__.py
│   │   │   ├── pipelines.py
│   │   │   ├── server.py
│   │   │   └── streams.py
│   │   ├── cli
│   │   │   ├── commands
│   │   │   ├── completion
│   │   │   ├── __init__.py
│   │   │   └── shell.py
│   │   ├── config
│   │   │   └── __init__.py
│   │   ├── constants
│   │   │   ├── devices.py
│   │   │   ├── filters.py
│   │   │   ├── __init__.py
│   │   │   ├── outputs.py
│   │   │   └── protocols.py
│   │   ├── core
│   │   │   ├── config.py
│   │   │   ├── __init__.py
│   │   │   ├── logging.py
│   │   │   ├── mcp.py
│   │   │   ├── __pycache__
│   │   │   └── utils.py
│   │   ├── device_managers
│   │   │   ├── base.py
│   │   │   ├── __init__.py
│   │   │   ├── local_devices.py
│   │   │   ├── network_devices.py
│   │   │   ├── __pycache__
│   │   │   └── utils
│   │   ├── dsl
│   │   │   ├── executor.py
│   │   │   ├── __init__.py
│   │   │   ├── lexer.py
│   │   │   └── parser.py
│   │   ├── __init__.py
│   │   ├── __init__.py.bak
│   │   ├── __main__.py
│   │   ├── main.py
│   │   ├── processing
│   │   │   ├── audio
│   │   │   ├── __init__.py
│   │   │   ├── pipeline_executor.py
│   │   │   └── video
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-312.pyc
│   │   │   ├── __main__.cpython-312.pyc
│   │   │   ├── main.cpython-312.pyc
│   │   │   └── _version.cpython-312.pyc
│   │   ├── quick
│   │   │   ├── camera.py
│   │   │   ├── __init__.py
│   │   │   ├── microphone.py
│   │   │   └── utils.py
│   │   ├── schemas
│   │   │   ├── device.py
│   │   │   ├── __init__.py
│   │   │   ├── pipeline.py
│   │   │   └── stream.py
│   │   ├── streaming
│   │   │   ├── __init__.py
│   │   │   ├── __pycache__
│   │   │   ├── rtmp.py
│   │   │   ├── rtsp.py
│   │   │   ├── utils.py
│   │   │   └── webrtc.py
│   │   ├── _version.py
│   │   ├── _version.py.bak
│   │   └── web
│   │       ├── acme.py
│   │       ├── api.py
│   │       ├── __init__.py
│   │       ├── interface.py
│   │       └── server.py
│   └── rtaspi.egg-info
│       ├── dependency_links.txt
│       ├── entry_points.txt
│       ├── PKG-INFO
│       ├── requires.txt
│       ├── SOURCES.txt
│       └── top_level.txt
├── test_imports.py
├── tests
│   ├── conftest.py
│   ├── __init__.py
│   ├── test_discovery.py
│   ├── test_local_devices.py
│   ├── test_network_devices.py
│   └── test_streaming.py
├── TODO.md
├── TODO.txt
├── update
│   ├── duplicated.py
│   ├── duplicated.sh
│   ├── pip.sh
│   ├── requirements.py
│   ├── requirements.sh
│   └── versions.py

├── version
│   ├── project.py
│   ├── README.md
│   ├── setup.py
│   └── src.py
└── version.sh

Uruchomienie

  1. Uruchom główny skrypt:
python main.py
  1. Opcjonalnie, możesz podać ścieżkę do pliku konfiguracyjnego:
python main.py -c /sciezka/do/config.yaml

Protokół komunikacyjny MCP

System używa wewnętrznego protokołu komunikacyjnego MCP (Module Communication Protocol) do wymiany informacji między modułami. Protokół opiera się na wzorcu publikuj/subskrybuj (pub/sub), gdzie moduły mogą publikować wiadomości na określone tematy i subskrybować tematy, aby otrzymywać wiadomości.

Przykładowe tematy MCP:

  • local_devices/devices - Informacje o wykrytych lokalnych urządzeniach
  • local_devices/stream/started - Informacja o uruchomieniu strumienia z lokalnego urządzenia
  • network_devices/devices - Informacje o wykrytych urządzeniach sieciowych
  • command/local_devices/scan - Komenda do skanowania lokalnych urządzeń
  • command/network_devices/add_device - Komenda do dodania zdalnego urządzenia

Używanie API

System udostępnia API do zarządzania urządzeniami i strumieniami. Poniżej znajdują się przykłady użycia API w kodzie Python:

from core.mcp import MCPBroker, MCPClient

# Utwórz klienta MCP
broker = MCPBroker()
client = MCPClient(broker, client_id="my_client")

# Subskrybuj tematy
client.subscribe("local_devices/devices", handler=handle_devices)
client.subscribe("local_devices/stream/started", handler=handle_stream_started)

# Wysyłaj komendy
client.publish("command/local_devices/scan", {})

# Uruchom strumień z urządzenia
client.publish("command/local_devices/start_stream", {
    "device_id": "video:/dev/video0",
    "protocol": "rtsp"
})

# Dodaj zdalne urządzenie
client.publish("command/network_devices/add_device", {
    "name": "Kamera IP",
    "ip": "192.168.1.100",
    "port": 554,
    "username": "admin",
    "password": "admin",
    "type": "video",
    "protocol": "rtsp",
    "paths": ["cam/realmonitor"]
})

Testy

Uruchomienie testów jednostkowych:

pytest -v tests/

Licencja

Ten projekt jest udostępniany na licencji Apache 2. Zobacz plik LICENSE, aby uzyskać więcej informacji.

Autorzy

  • Zespół rtaspi

Współpraca

Zachęcamy do współpracy przy rozwoju projektu. Zapraszamy do zgłaszania problemów (issues) i propozycji zmian (pull requests).


  • Modular Documentation made possible by the FlatEdit project.

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

rtaspi-0.1.24.tar.gz (178.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtaspi-0.1.24-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

Details for the file rtaspi-0.1.24.tar.gz.

File metadata

  • Download URL: rtaspi-0.1.24.tar.gz
  • Upload date:
  • Size: 178.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rtaspi-0.1.24.tar.gz
Algorithm Hash digest
SHA256 3842177df8fff4a30c068a39bf4ae3b569913eca12f063681f57f0cd703e9bcd
MD5 98e808062194119a66bf7959265eee68
BLAKE2b-256 f6d47d47a273e536f758c68ae09566fe744fd64520add8c084f7c1ce5cda03c9

See more details on using hashes here.

File details

Details for the file rtaspi-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: rtaspi-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 111.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rtaspi-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 5199c5147aa107a4c727e8cf70deeb3369fc37b8514e46223e8ebc7883ceb5cf
MD5 54037247df812b4bfffcf4b232856c48
BLAKE2b-256 125c1ea48e7d6e44e5ecbdbe30dfa8fb0d99d9c384a6144406cfdae7130fc0ca

See more details on using hashes here.

Supported by

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