HTTP service that converts EPICS PVA NTNDArray streams into MJPEG video streams consumable by any web browser.
| What | Where |
|---|---|
| Source | https://github.com/DiamondLightSource/pva-to-video |
| PyPI | pip install pva-to-video |
| Docker | docker run ghcr.io/diamondlightsource/pva-to-video:latest |
| Releases | https://github.com/DiamondLightSource/pva-to-video/releases |
EPICS areaDetector cameras publish images as NTNDArray structures over PVA.
Desktop tools like Phoebus can display these streams directly, but web
applications cannot speak PVA. pva-to-video bridges the gap by
subscribing to a PVA channel on demand and re-encoding the pixel data as an
MJPEG stream served over HTTP — a format every browser understands natively
via an <img> tag.
- A client requests
GET /mjpg/<PV_NAME>. - The service opens a PVA monitor on PV_NAME (if one is not already open).
- Each incoming NTNDArray is normalised to uint8 and JPEG-encoded.
- Frames are pushed to all connected clients as a
multipart/x-mixed-replaceMJPEG stream, capped at 30 fps per client. - When the last client disconnects the subscription is kept alive for 60 s to avoid churn, then torn down automatically.
Supported pixel formats: uint8/16/32/64, int8/16/32/64, and float32/64. Greyscale (2-D) and colour (H×W×3 RGB) arrays are both handled.
Point an <img> tag at the service:
<img src="https://my-server:8080/mjpg/BL01T-DI-CAM-01:PVA:OUTPUT" />A built-in viewer page is available at GET / for quick manual testing.
pip install pva-to-video
pva-to-video # listen on 0.0.0.0:8080
pva-to-video --port 9000 # custom port
pva-to-video --log-level debug # verbose loggingIf cameras are on a different subnet, set the PVA name server:
EPICS_PVA_NAME_SERVERS=192.168.1.50 pva-to-videodocker run --rm -p 8080:8080 ghcr.io/diamondlightsource/pva-to-video:latestTo reach IOCs on the host network:
docker run --rm --network host ghcr.io/diamondlightsource/pva-to-video:latestWith a remote PVA gateway:
docker run --rm -p 8080:8080 \
-e EPICS_PVA_NAME_SERVERS=192.168.1.50 \
ghcr.io/diamondlightsource/pva-to-video:latest| Flag | Default | Description |
|---|---|---|
--host |
0.0.0.0 |
Bind address |
--port |
8080 |
Bind port |
--log-level |
info |
debug, info, warning, or error |