Skip to main content

Python implementation of the gstreamer signalling protocol

Project description

gst-signalling-py: Gstreamer WebRTC signalling in Python

Code style: black linter pytest coverage

This repository provides a Python implementation of the Gstreamer WebRTC signalling protocol.

It provides an API close to the gstreamer API with a producer and a consumer. This allows to simply write producer/consumer examples using gstreamer signalling. It works with single producer and multiple consumers for exchanging data. See the data producer example for more details.

It also provides tools to list and monitor the peers connected to a signalling server.

Note that there is no example of audiovideo streaming. Gstreamer provides rust plugins that directly communicate with a signalling server

Installation

Simply install the package using pip:

pip install -e .

Usage

See the examples for more details.

Protocol

Roles

Gstreamer signalling defines 3 roles (so the WebRTC peers are not symmetrical)

  • producer (produces data, video or audio streams)
  • consumer (access to a producer stream, can access all or a subset of its streams)
  • listener (gets notified by the server of new producers status)

Protocol sequence diagram

sequenceDiagram
  Server-->>Producer: Welcome (PeerId)
	Server-->>Consumer: Welcome (PeerId)
  Producer->>Server: PeerStatusChanged  # declare yourself as producer
	Consumer->>Server: StartSession # with producer PeerId
	Server-->>Producer: StartSession (SessionId)
	Server-->>Consumer: SessionStarted (SessionId)
	Producer->>Server: Peer (offer sdp)
	Server-->>Consumer: Peer (offer sdp)
	Consumer->>Server: Peer (answer sdp)
	Server-->>Producer: Peer (answer sdp)

See this page for more details.

Contribute

Please refer to our template repository for guidlines and coding style.

Development tools can be installed with

pip install -e .[dev]

Unit tests

The gstreamer signalling server is required to run on the localhost. Then run

pytest

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

gst_signalling-1.1.0.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

gst_signalling-1.1.0-py3-none-any.whl (19.6 kB view hashes)

Uploaded Python 3

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