scene-streamer
Stream frames from an OpenGL scene renderer to a browser, a Jupyter notebook widget or an app window.
The renderer runs in your Python process (on a machine with a GPU, or a software OpenGL). scene-streamer runs a small web server in a thread of the same process. A page connects with a websocket, sends camera gestures (rotate, pan, zoom, pick) and receives frames: H.264 while the camera moves, a lossless still when it stops. Because the scene lives in your process, changing it from Python redraws every attached viewer.
- one websocket carries any number of viewers, so ten notebook widgets cost one connection;
- viewers that are scrolled out of view or frozen are not rendered, and everything a viewer held on the GPU is released when its page goes away;
- quality follows the speed of the link, so it works over SSH or a jupyter-server-proxy;
- labels and picking are done by the page from the frame's view-projection matrix, so the server never draws text.
It knows nothing about meshes or OpenGL. The package that owns the scene and the renderer supplies them by following
the protocols in scene_streamer/protocols.py.
menpo3d is the first such package (mesh.view()).
Install
pip install scene-streamer # the hub and a browser page
pip install "scene-streamer[notebook]" # + the Jupyter widget (anywidget)
pip install "scene-streamer[h264]" # + H.264 video (PyAV, which bundles ffmpeg)
pip install "scene-streamer[all]"
Without PyAV, frames are sent as JPEG (and Python warns once that a viewer asked for H.264). Browsers without WebCodecs (Firefox, Safari) always get JPEG. PyAV's wheels bundle x264, which is GPL: install the extra only if that is acceptable for what you distribute.
Use
import scene_streamer
scene_streamer.configure(
worker=get_worker
) # once: how to reach the renderer's GL thread
hub = scene_streamer.get_hub()
hub.register(scene)
print(hub.view_url(scene)) # open in any browser
from scene_streamer.window import (
show,
) # a Chromium "app" window; blocks until it is closed
from scene_streamer.widget import (
figure_widget,
) # a notebook widget (needs the `notebook` extra)
configure(host="0.0.0.0", public_url="https://box/proxy/8765") before the first viewer makes the server reachable
from another machine. Every route except /viewer.js needs the hub's token, which is part of the URLs it hands out.
The server binds to 127.0.0.1 by default.
Develop
uv sync
uv run pytest
The tests use a fake scene and renderer (tests/fakes.py), so they need no GPU.
Releasing
Push a vX.Y.Z tag. The release workflow builds the sdist and wheel, checks them, and publishes to PyPI by trusted
publishing (environment pypi). A manual run with publish: testpypi is a dry run.
BSD 3-clause licence.
Metadata
Release files for scene-streamer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scene_streamer-0.1.0.tar.gz | 193.4 kB | With provenance | Details for scene_streamer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scene_streamer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for scene_streamer-0.1.0-py3-none-any.whl |
Total release size: 218.7 kB
Release files / scene_streamer-0.1.0.tar.gz
| Download URL | scene_streamer-0.1.0.tar.gz |
|---|---|
| Size | 193.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d8ea72edd4eb99a254c7fb28685851dc744191c9864fee299e8c1937ac3952b
|
|
BLAKE2b-256 checksum How to use checksums |
e6030a2205e14c7049e94e0b794da03c983f311fec8ca9259c033f4f5b280d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / scene_streamer-0.1.0-py3-none-any.whl
| Download URL | scene_streamer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b410f93f45247d7375b8220e8eecfa4059c8968f91efd246e681ecdb3582c8bf
|
|
BLAKE2b-256 checksum How to use checksums |
e224e34f7dbb4a3dfadea4c5e2438e7fa4fb18ad8b808f138f9c4d82178ba702
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for scene-streamer 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for scene_streamer-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA 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.