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.1.tar.gz (169.1 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.1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: livesync_io-0.1.1.tar.gz
  • Upload date:
  • Size: 169.1 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.1.tar.gz
Algorithm Hash digest
SHA256 e66bb2d71cbefe20caf9c54f9e6b1306428786d81a7af815ce94ecb83363c603
MD5 1babda0774e0488fb63466edccc6cfc0
BLAKE2b-256 c40afc3fed88a12e42a1efbf2240b7df60c651aa9109a12d894688b7dfe642b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: livesync_io-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74864a9634ee14abf3244ee4843d438c498b16bc62fe67856f07212dd879443d
MD5 85a49dd4177968f6b64d7e398468e09d
BLAKE2b-256 b3b1d1a25fc14c8efd498b4ff8c53a3d4b8987b0270845b0ed3656d65a9a8d60

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