Skip to main content

Rust-powered native backend for the reeln CLI — media processing, overlay rendering, and game state via libav* bindings

Project description

reeln-core

Shared Rust core library for reeln — the sports highlight rendering CLI. Provides native media processing, overlay rendering, game state management, and sport-specific logic consumed by the Python CLI, OBS plugin, and future Tauri desktop app.

License: AGPL-3.0-only | Homepage: https://streamn.dad | Org: StreamnDad

Architecture

reeln-core (Rust workspace)
├── reeln-media      Media processing via libav* (probe, render, concat, xfade, composite, extract)
├── reeln-overlay    2D overlay template engine (tiny-skia + cosmic-text → PNG)
├── reeln-sport      Sport registry & segment naming
├── reeln-state      Game state machine, JSON persistence, directory management
├── reeln-config     XDG configuration, env overrides, validation
├── reeln-plugin     Hook system, capabilities, dynamic plugin loading
├── reeln-python     PyO3 bindings → published as `reeln-native` on PyPI
└── reeln-ffi        C ABI (cdylib + staticlib) for OBS plugin integration

Crate Details

Crate Tests Key Dependencies Purpose
reeln-media 150 ffmpeg-next 8 Probe, render, concat, xfade, composite, frame extract
reeln-overlay 156 tiny-skia, cosmic-text, image Template-to-PNG rasterization
reeln-sport 38 serde Sport aliases, segment naming
reeln-state 35 serde_json, chrono, uuid, glob Game state CRUD, directory ops
reeln-config 61 dirs, serde_json Config loading, merge, env overrides
reeln-plugin 107 libloading Hook emission, plugin discovery
reeln-ffi 37 All reeln-* crates C ABI exports
reeln-python pyo3 0.24 Python extension module
Total 584

Prerequisites

Rust toolchain:

rustup update stable

libav* development libraries (the ffmpeg command-line binary is not required at runtime):

# macOS
brew install ffmpeg pkg-config

# Ubuntu/Debian
sudo apt-get install -y libavcodec-dev libavformat-dev libavfilter-dev \
  libavutil-dev libswscale-dev libswresample-dev pkg-config

# Fedora
sudo dnf install ffmpeg-devel pkg-config

Building

# Build all crates
cargo build --release

# Run all tests (584 tests)
cargo test --all

# Check without building (faster)
cargo check --all

# Lint
cargo clippy --all-targets -- -D warnings

# Format
cargo fmt --all

Python Bindings

The reeln-python crate builds a native Python extension module published as reeln-native on PyPI.

# Development build (installs into active venv)
cd crates/reeln-python
pip install maturin
maturin develop --release

# Build wheel for distribution
maturin build --release

From reeln-cli:

# Install with native backend
pip install "reeln[native]"

# Or development install from source
cd /path/to/reeln-cli
make dev-install-native

Python API (reeln_native)

Function Module Description
probe(path) Media Probe media file → dict with duration, fps, width, height, codec
render(input, output, ...) Media Render video with optional filters
render_with_filters(input, output, filter_complex, ...) Media Render with full filter_complex string
concat(segments, output, ...) Media Concatenate media segments
xfade_concat(files, durations, output, ...) Media Cross-fade concatenation (xfade + acrossfade)
composite_overlay(video, overlay_png, output, ...) Media Composite PNG overlay onto video
extract_frame(input, timestamp, output) Media Extract single frame as PNG
list_sports() Sport List supported sport aliases
segment_dir_name(sport, number) Sport Generate segment directory name
segment_display_name(sport, number) Sport Generate segment display name
game_dir_name(date, home, away, number) State Generate game directory name
detect_next_game_number(base, date, home, away) State Detect next double-header number
find_unfinished_games(base_dir) State Find unfinished game directories
load_game_state(game_dir) State Load game state JSON
save_game_state(game_dir, json) State Save game state JSON
config_dir() Config Default config directory path
data_dir() Config Default data directory path
load_config(path, profile) Config Load configuration as JSON
validate_config(json) Config Validate config, return warnings
load_template(path) Overlay Load overlay template JSON
render_overlay(template, context, output) Overlay Render template to PNG
substitute_variables(text, context) Overlay Substitute {{variables}}
evaluate_visibility(condition, context) Overlay Evaluate visibility condition
list_hooks() Plugin List all hook names
load_native_plugin(path) Plugin Load native plugin from .so/.dylib
discover_plugins(dir) Plugin Discover plugins in directory

C ABI (reeln-ffi)

The reeln-ffi crate produces a C-compatible shared library for integration with C/C++ projects (e.g., OBS Studio plugins).

cargo build -p reeln-ffi --release
# Output: target/release/libreeln_ffi.{so,dylib,dll}

CI/CD

Workflow Trigger What it does
ci.yml Push/PR to main Format, clippy, test on Linux/macOS/Windows
release.yml Tag v* Build wheels for 5 platforms, publish to PyPI (OIDC)

Release targets:

  • x86_64-unknown-linux-gnu
  • aarch64-unknown-linux-gnu
  • x86_64-apple-darwin
  • aarch64-apple-darwin (Apple Silicon)
  • x86_64-pc-windows-msvc

Consumers

Project How it uses reeln-core
reeln-cli pip install "reeln[native]" — Python FFI via reeln_native
reeln plugins Indirectly via reeln-cli at runtime
streamn-scoreboard Subprocess calls to reeln CLI (future: link reeln-ffi)
reeln-tauri (planned) Direct Rust dependency

Versioning

  • Workspace version: 0.2.2 (all crates share this version)
  • reeln-cli declares reeln-native >= 0.1.0, < 1.0 as optional dependency
  • Changelog: CHANGELOG.md
  • Semantic versioning: MAJOR.MINOR.PATCH
  • Releases are tag-triggered (v* pattern)

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

reeln_native-0.2.2.tar.gz (95.5 kB view details)

Uploaded Source

Built Distributions

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

reeln_native-0.2.2-cp313-cp313-manylinux_2_28_x86_64.whl (12.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

reeln_native-0.2.2-cp313-cp313-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

reeln_native-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl (12.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

reeln_native-0.2.2-cp312-cp312-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

reeln_native-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl (12.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

reeln_native-0.2.2-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file reeln_native-0.2.2.tar.gz.

File metadata

  • Download URL: reeln_native-0.2.2.tar.gz
  • Upload date:
  • Size: 95.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reeln_native-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4a15f7eee1cbb9aba2bde627a10cb687e128807f8d01172f683870f937962d79
MD5 9cbba3bc702d2a7866f21955066e185c
BLAKE2b-256 c20b72931df4945a24df2fdda2876971c0291b9b319e01c4df10d3cb550571a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2.tar.gz:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62588b927684ef8a268a2ece1fd5e3142c489e49a616276e7b5ee0e97686d957
MD5 8c4a72863ad0caac3a7946589ab57291
BLAKE2b-256 3043090f6439ede08f618a8f9e9dc336feaa22f5861d93cfe37885deed32cd56

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f756e349231d7e8424b8fa73a152954a56fbb77f184b19d8550791b390d50bb5
MD5 fcb693c7de5af30f8b2d1bb1d0942ab2
BLAKE2b-256 187e8306ca541df4cfaf1a9df70d0cf5c49808f19ecd912fc7e760eb4c626e3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 48026bcce2b5caf5d8444cfc4d6a936bc3479e5cb7ec275a1c9cceb381b9d159
MD5 10d9ba264fb93a0c80637f84c7b63417
BLAKE2b-256 543dc1a635a8450791b83cd3e110935c5eaeab43690a1d181c0cf55b8a2b9b6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c38097f4bc8c19be8e2f1f49783df82f17a72a65cf029a14b35b84936e7730bc
MD5 a906ba80e87c7c0151c864174772fdd7
BLAKE2b-256 035c288a3500cb88f13fedf089562a08ae8565662bd827998958e29ffad1f442

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c440d076043b9f3e975fcf9bcf7b786e9abc38760c9a22781106915d11556800
MD5 9705115017b0046085c73f5bac75e536
BLAKE2b-256 35c05bcaad5921f4ed44544ef1705358036ac211a5cccaf12914dd249f36d4b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_native-0.2.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f1b70dc1ca22684ce2ce736570c877172b9e0506c960fb3137645b0cc203dae
MD5 6bc8b9ade50cdf99ec227d88df444b75
BLAKE2b-256 2a0879c6e22821825e7bffad44b131028d5f153b8ed50fa5d1a8860ce7d35913

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.2.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on StreamnDad/reeln-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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