Skip to main content

screenstream-client

The Python client for screenstream: the phone's screen as raw RGBA frames on a local port, and the same capture as H.264 in a fragmented MP4 on a second one. No Android, no device, no runtime dependency beyond the standard library (ffmpeg is used only when a PNG is wanted).

pip install screenstream-client
# or install it in an isolated environment:
pipx install screenstream-client

The commands keep the flags of the scripts they replace, so an existing python3 client/stream.py --port 7200 --seconds 5 --png out/stream becomes:

screenstream-stream --port 7200 --seconds 5 --frames-dir out/stream
screenstream-fmp4 --seconds 10 --out out/live.mp4

As a library:

from screenstream_client import connect, read_fmp4, save_png

with connect("127.0.0.1", 7100) as link:
    frame = link.wait_for_change(timeout=5)          # None on a still screen
    print(frame.number, frame.timestamp_ns, frame.size)
    save_png(frame, "out/frame.png")

    for number, timestamp_ns, size, pixels in link.frames():
        ...

read_fmp4 parses an init segment, a saved file, or bytes. base_ns gives the device clock's reading for the track's zero from the udta/uuid box, so a frame's device time is base_ns + pts * 1000.

Protocol version

This client speaks screenstream protocol 2.x. A stream whose major version is different is refused with a sentence that names both versions, not read as if the fields still meant the same thing. Protocol 1 (magic RAW1, the unversioned 36-byte header) is still accepted for an app installed before the version existed.

The distribution and the AAR share the version in pyproject.toml; it must equal build.gradle.kts and build.sh, and the test suite checks that.

The control surface

screenstream_client.control is the shared parser for the content call wire format: parse_call for a command, parse_result for the Result: Bundle[{code=..., data=...}] reply, parse_fields for the key=value body and parse_extra for name:type:value. Its SCHEMA_VERSION must equal the Java library's ControlContract.SCHEMA_VERSION; test/test_control.py reads both and the shared fixture, so the Java and Python grammars cannot drift silently. client/control.py is the adb command-line wrapper over it.

The contract is docs/control-surface.md in the repository.

License

GPL-3.0-or-later, as the rest of screenstream.

Metadata

Release files for screenstream-client 0.2.0

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

Source distribution (sdist)

Source distribution for screenstream-client 0.2.0
File Size Uploaded Provenance Actions
screenstream_client-0.2.0.tar.gz 13.1 kB With provenance Details for screenstream_client-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for screenstream-client 0.2.0
File Interpreter ABI Platform Actions
screenstream_client-0.2.0-py3-none-any.whl Python 3 none any Details for screenstream_client-0.2.0-py3-none-any.whl

Total release size: 27.0 kB

Release files / screenstream_client-0.2.0.tar.gz

Download URL screenstream_client-0.2.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
445dd8a3b240877a610dcb9dc9b50e2b2c38f523f2f69b2463b755cd36bb7f50
BLAKE2b-256 checksum
How to use checksums
9747f44917b788b1574431e76d088539cc31e564a2a3b2ca7d9f0d345f62e84b
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 24, 2026.

Transparency log

Release files / screenstream_client-0.2.0-py3-none-any.whl

Download URL screenstream_client-0.2.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bf8959d3ee796026c66a69fb5f79678ef6b6b5bcb50d8b0d525cdea44115745
BLAKE2b-256 checksum
How to use checksums
f92b083d713f6bbd3bb11a5d1364db50404995fcf7956d58df6382060ee3e083
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 24, 2026.

Transparency log

Security for screenstream-client 0.2.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.

Select from 2 files

Attestation for screenstream_client-0.2.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 24, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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