Skip to main content

tatolab-browser

A web page as a stream source, built the way a third party builds a node: a standalone maturin wheel that depends on tatolab-stream, pyo3 and tatolab-module-sdk, and on no engine crate.

  • BrowserSource renders url offscreen with Chromium, through CEF, as a tab in the machine's browser host: one CEF the runtime starts at the first BrowserSource's lease and stops 30 s after the last, shared by every stream on the machine, each stream with a CEF profile (cookies, storage) of its own. The node's helper runs no CEF. On start() it lends its ports to this wheel's Rust, which leases the host through the module host table (1.7), opens the tab over the versioned tab protocol (tab-protocol/), and writes each frame the host paints, handed over in shared memory, into a texture from the node's output pool (surface_write_from_host_memory), published as an RGBA VideoFrame. Python never runs at frame or sample cadence.
  • data input: each msgpack map reaches the page as window.dispatchEvent(new CustomEvent("tatolab:data", { detail })).
  • events output: each window.tatolab.publish(object) call is one msgpack map.
  • audio output: what the page plays, as the house audio block (interleaved f32, stereo, at audio_sample_rate). A silent page publishes nothing.
  • A page's renderer that crashes is reloaded by the host. When the host itself ends, the runtime starts it again under its restart backoff and each open page opens again in the new host. The node fails, shown in error in the graph while the rest of the stream runs on, when the renderer crashes more than 5 times in a minute, when the runtime gives up on the host, or when a running host refuses to open the page again for a minute.
  • BrowserSourceOutputProbe logs a source's frame rate, its audio's continuity and how long a data message takes to reach the page's paint.

Config: url, width, height, frame_rate (1 to 60), transparent_background, audio_sample_rate, output_pool_rotation_depth.

Linux only for now. Frames cross the CPU once per paint; zero-copy is next.

Build it

The wheel itself carries no CEF. The browser host, its CEF subprocess and the CEF runtime ship in the runtime unit, under lib/tatolab/browser-host/: on Linux side by side, on macOS as tatolab-browser-host.app, with CEF's framework and the subprocess as the helper apps CEF launches inside it. python3 -I scripts/fetch_cef_binary_distribution.py <directory> lays out the distribution for this machine, licence included, for CEF_PATH. Building them needs CEF's binary distribution, the one cef-dll-sys links against. export-cef-dir, which fetches it for cef-dll-sys, leaves out the distribution's LICENSE.txt; copy it into $CEF_PATH from the official cef_binary_*_linux64_minimal archive:

export CEF_PATH=/path/to/cef   # holding libcef.so (or the macOS framework) and LICENSE.txt
cargo xtask build-runtime      # stages the browser host when CEF_PATH is set
uvx maturin@1.9.6 build --release   # in packages/tatolab-browser

cargo xtask stage-browser-host stages the host alone into the unit.

Run it

With this machine's runtime running:

cd streams/browser-source
tatolab dev

A file:// page loads classic scripts only: Chromium refuses module scripts from a file URL, so a library shipped only as ES modules (three.js r160 and later) needs a classic build, inlined modules, or the page served over http.

The probe page animates every frame, plays a 440 Hz tone and answers each data message from its next animation frame. Watch it at http://127.0.0.1:4446/watch/<machine>/main; a BrowserSourceOutputProbe: ... report lands in the project's log every 600 frames.

Check it

Without CEF, cef/dox compiles the bindings without linking them:

cargo fmt --all --check
cargo test --locked --workspace --features cef/dox
cargo clippy --locked --workspace --all-targets --features cef/dox -- -D warnings
uvx pyright@1.1.411

THIRD-PARTY-NOTICES.md is regenerated, with CEF's licence read from $CEF_PATH, by cargo xtask generate-third-party-notices --extension-package-directory packages/tatolab-browser.

Metadata

Release files for tatolab-browser 0.68.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tatolab-browser 0.68.27
File Interpreter ABI Platform Actions
tatolab_browser-0.68.27-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for tatolab_browser-0.68.27-cp310-abi3-manylinux_2_28_x86_64.whl

Release files / tatolab_browser-0.68.27-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL tatolab_browser-0.68.27-cp310-abi3-manylinux_2_28_x86_64.whl
Size 527.2 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
ae58b694356f29493a34cbfbd58efabb717972345e965023e6a213ba6f532db1
BLAKE2b-256 checksum
How to use checksums
7abb5a98bf06a29886b4729e8898f34be232e5439b865dfac413386286ad79b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tatolab-browser 0.68.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page