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.1.2.tar.gz (170.4 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.1.2-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: livesync_io-0.1.2.tar.gz
  • Upload date:
  • Size: 170.4 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.1.2.tar.gz
Algorithm Hash digest
SHA256 a59113a254c5128cbcbe70486b91af1fe8b6ac281378ee185d2ac79f1320651d
MD5 b00578451dc9061fcc85218171cafaa2
BLAKE2b-256 424998e2726fa7f3dbfcdae2e199c7ab7aa2ff7feb79e485e7d83a41fe706d6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: livesync_io-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.9 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 258db2074c51b6d87b13c80e83fe3558765ed5adaa7888d30ddf1d7c1d8430c1
MD5 81140d52a43d0b9544852f6e7c8ae2c0
BLAKE2b-256 616bc3a56ac3085f97e11aecdc30e9e3419c72a1df069b0978236c7ebab548f2

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