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.3.0.tar.gz (103.2 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.3.0-cp313-cp313-manylinux_2_28_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

reeln_native-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

reeln_native-0.3.0-cp312-cp312-manylinux_2_28_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

reeln_native-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

reeln_native-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

reeln_native-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for reeln_native-0.3.0.tar.gz
Algorithm Hash digest
SHA256 69e1c381e2f0f5541a8f8e86be974fcd4a530ad14858ac804577c4e88214f34a
MD5 ef2ae943473c9faa13c948277cbda32e
BLAKE2b-256 0593761365e5a3a493c3f311e828ff4b3cfed57355f65be203c248ae8f65f8b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0.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.3.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91cded3f600248171e8e08bc0794bb59661e7b6f985c271dff2046bfee0885ca
MD5 893bd2a399ff55319a6f28df120a3d77
BLAKE2b-256 0e20e1e9a43cc66a13f4d652f28dc89fd80ad82b78fe740bd8bfb911a16f002e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58d4983fe1a14b744b81de87f9e56266fda3fa75fe92249d363ddae0ccfb8e4c
MD5 a3a780b04d8e2b843e30ba2472f37472
BLAKE2b-256 2860a8ddee4d775e356de0e4d4ba8f65bc47fb04ba0bf7a79c5734147b6b9c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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.3.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 939404f4b76694e9015be90e1b8bd9ecf97753415e48e793620185eeb40ced3c
MD5 ee953ba6bf26e51063cf1b718a59b485
BLAKE2b-256 69850eb5fd680395b922d5fe3d9d0e616505016edb0a050306f5b3416b80c71b

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f32af7b42a275f28226501c759edfb785494ed194a1d38e5c1fdcb0b618380e7
MD5 2fc548da6e5c01c710b812008d7168ed
BLAKE2b-256 cf2112f7be1c0426a1de7a49493dfa17845e61bcbda5ef54564403692ab3cd0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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.3.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1b63181009e5147028278e6b5908a92ef82112e4361f1d5f24f74dfac6d0204c
MD5 b9f185027ddcc27c1ba3fb1166ab8894
BLAKE2b-256 933d514155e922a67fa6f8433b81989a24b1b70dab87bc0f645d9335d0b0ba13

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reeln_native-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5315ac4cec9396dc6b299ae1bc5e6d2c43bc91f06bd6f913b5bcc176cfcdedc4
MD5 a7fda358931fef8dc18ec67c0dbf5d29
BLAKE2b-256 ab9d8d60ceaa764d85846fa3e7ce97794a62f95699397e4d97bd6e59ef608e0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_native-0.3.0-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