Metadata-Version: 2.3
Name: livesync-io
Version: 0.1.1
Summary: The graph-based video processing framework
Project-URL: Homepage, https://github.com/os-designers/livesync
Project-URL: Repository, https://github.com/os-designers/livesync
Author-email: LiveSync <support@live-sync.io>
License: MIT
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: grpcio<2.0.0,>=1.68.1
Requires-Dist: httpx>=0.25.2
Requires-Dist: livekit-api<0.9.0,>=0.8.1
Requires-Dist: livekit>=0.19.1
Requires-Dist: numpy<3.0.0,>=2.1.0
Requires-Dist: opencv-python>=4.10.0.84
Requires-Dist: protobuf<6.0.dev0,>=5.26.1
Requires-Dist: typing-extensions>=4.12.2
Description-Content-Type: text/markdown

# 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:

```bash
rye add livesync-io
```

Alternatively, you can use pip:

```bash
# 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:

```python
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:

```python
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:

```python
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](https://github.com/OS-Designers/livesync).
