Skip to main content

The graph-based video processing framework

Project description

Livesync

The graph-based video processing framework for building real-time video applications. It supports both synchronous and asynchronous processing pipelines and offers a flexible node system for video manipulation.

Installation

We recommend using rye for installation:

rye add livesync-io

Alternatively, you can use pip:

# install from PyPI
pip install livesync-io

Usage

The library is designed around a graph-based architecture where nodes represent different processing steps that can be connected together to form a processing pipeline.

Here's a basic example:

import asyncio
from livesync import Graph
from livesync.nodes import WebcamNode, FrameRateNode


async def main():
    # Create a processing graph
    graph = Graph()

    # Add a webcam input node
    webcam_node = WebcamNode(device_id=0, fps=30)
    graph.add_node(webcam_node)

    # Add a frame rate processing node
    frame_rate_node = FrameRateNode(target_fps=10)
    graph.add_node(frame_rate_node)

    # Connect the nodes
    graph.add_edge(webcam_node, frame_rate_node)

    # Start processing
    await graph.start()

    # Keep the graph running
    try:
        await asyncio.Event().wait()
    except KeyboardInterrupt:
        await graph.stop()


if __name__ == "__main__":
    asyncio.run(main())

Features

Asynchronous Processing

Each node in the graph acts as an independent processing unit with its own queue, enabling asynchronous processing of frames. This architecture is specifically designed for real-time video processing, allowing high-throughput and low-latency operations.

Remote Processing

LiveSync supports distributed processing through gRPC-based remote nodes. You can offload processing to remote servers:

from livesync.nodes.presets.livesync import ProcessorConfig, LivesyncRemoteNode

# Create a remote processing node

remote_node = LivesyncRemoteNode(
    endpoints=["localhost:50051"],
    configs=[ProcessorConfig(name="frame_rate", settings={"target_fps": "5"})],
)

LiveKit Integration

Built-in support for LiveKit enables real-time video streaming and WebRTC capabilities:

from livesync.nodes import LiveKitVideoSinkNode, LiveKitVideoSourceNode

# Stream video to LiveKit
livekit_sink = LiveKitVideoSinkNode(livekit_stream=stream)
graph.add_node(livekit_sink)

Requirements

  • Python 3.10 or higher
  • OpenCV Python
  • LiveKit SDK
  • gRPC tools for remote processing

License

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

Acknowledgments

LiveSync is developed and maintained by OS Designers, Inc. Special thanks to all contributors who have helped shape this framework. For support, feature requests, or bug reports, please open an issue on our GitHub repository.

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

livesync_io-0.2.0.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

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

livesync_io-0.2.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file livesync_io-0.2.0.tar.gz.

File metadata

  • Download URL: livesync_io-0.2.0.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for livesync_io-0.2.0.tar.gz
Algorithm Hash digest
SHA256 196fe532cb8913114a7247f66e3dca0fa1700b4bf4d1f3a984807440003e26da
MD5 b423d15c6e6e3d41ceff311f0d37b793
BLAKE2b-256 713de8c74bc23ca1f293de2a7b382613dbfba742e409d7c73ddf4f225acb032a

See more details on using hashes here.

File details

Details for the file livesync_io-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: livesync_io-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for livesync_io-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 692c1cdc3ddd789334225be495d7ccc17d55a2b984519d6d3118373a6d873a83
MD5 993a843ce183cb691163a7bae6c6d837
BLAKE2b-256 24c4cf2382e52813e0a00327a68d315f6ea3725348a0bb35525d02294483a41e

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