Skip to main content

long-screen

Turn a screen recording of a page explored along any path (scrolling, panning, zooming out and back) into one big screenshot, from Python. This is the engine of Long Screen compiled as a native extension module: everything runs locally, nothing is uploaded.

pip install long-screen
import long_screen

result = long_screen.reconstruct("recording.mov")
result.save("print.png")
for d in result.diagnostics:
    if d["severity"] != "info":
        print(d["code"], d["message"])

Reconstruction is heuristic. A run that ends complete does not prove the print is right: read the diagnostics, and look at result.fragments, the pieces the run could not place on the print.

Decoding

  • macOS: the system decoder (AVFoundation) reads MP4, MOV and anything else QuickTime plays. Nothing else to install.
  • Windows: the system decoder (Media Foundation) reads MP4 and other formats Windows plays.
  • Linux, and files the system decoder cannot read (WebM on macOS, for example): a user-installed ffmpeg and ffprobe, run as child processes (sudo apt install ffmpeg, brew install ffmpeg, winget install Gyan.FFmpeg). ffmpeg is not bundled. Without it, reconstruct raises DecoderMissingError, whose message says how to install it. Set LONGSCREEN_FFMPEG and LONGSCREEN_FFPROBE to use executables that are not on PATH.

Frames are never resampled: screen recordings are variable frame rate, and every decoded frame is used once at its own timestamp.

API

reconstruct(path, *, lang="en", threads=None, memory_mb=None, backend="auto", on_progress=None) -> Result

  • lang: language of diagnostic and progress messages, "en" or "zh".
  • threads: kernel threads (default one per core). Results do not depend on it.
  • memory_mb: working memory of the tile cache (default 128).
  • backend: "auto", "avfoundation", "mediafoundation" or "ffmpeg".
  • on_progress: called with a Progress (phase, fraction, frames, total, time, message) about ten times a second. Return False to stop and keep what is done (the result is then "partial"); an exception raised in it stops the run and propagates.

reconstruct_frames(frames, *, width, height, lossless=False, duration=None, ...) -> Result takes frames you decoded yourself: an iterable of (timestamp_seconds, image) pairs, each image a uint8 RGBA NumPy array of shape (height, width, 4). The engine reads the frames once per pass, so a list is iterated several times; a generator is first copied to a temporary file (width × height × 4 bytes per frame). Pass lossless=True for exact screen pixels (screenshots, lossless captures); the default allows for the noise of a lossy video codec.

Result:

  • status: "complete", "partial" (stopped, or not every frame could be used) or "error".
  • diagnostics: a list of dicts with code, severity, message, action, frame, time, canvas, occurrences and params (the diagnostic's other fields).
  • save(path): the print as an RGBA PNG, written one band of tiles at a time, so memory stays small however long the print is.
  • print_image(): the print as a NumPy array. It is large: a 1320 × 12 000 print is 63 MB. Prefer save() when a file is what you need.
  • print (the canvas the web app shows first), fragments (the rest of the reconstructed content, in the app's order), canvases: Canvas objects (id, kind, width, height, bounds, save(path), image()).

The engine runs with the GIL released. Ctrl-C stops a run at its next step and raises KeyboardInterrupt.

Errors: FileNotFoundError; DecoderMissingError (ffmpeg needed and not installed) and DecoderError (no decoder reads the file); RunFailedError when nothing could be reconstructed (its .result.diagnostics say why); ValueError and TypeError for bad arguments and frames. All Long Screen errors derive from LongScreenError.

Requirements

CPython 3.11 or later (one abi3 wheel per platform) and NumPy. Wheels: macOS (Apple silicon and Intel), Linux (manylinux x86_64 and aarch64) and Windows x86_64.

License

MIT, Copyright (c) 2026 Yi-Ting Chiu. The source, the web app and the command line are at https://github.com/t41372/long-screen.

Metadata

Release files for long-screen 0.1.1

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

Source distribution (sdist)

Source distribution for long-screen 0.1.1
File Size Uploaded Provenance Actions
long_screen-0.1.1.tar.gz 477.6 kB With provenance Details for long_screen-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for long-screen 0.1.1
File Actions
long_screen-0.1.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for long_screen-0.1.1-cp311-abi3-win_amd64.whl
long_screen-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for long_screen-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
long_screen-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for long_screen-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
long_screen-0.1.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for long_screen-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
long_screen-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for long_screen-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 6.7 MB

Release files / long_screen-0.1.1.tar.gz

Download URL long_screen-0.1.1.tar.gz
Size 477.6 kB
Tags Source
SHA-256 checksum
How to use checksums
312711f6afd1f124ecd2735a4b845cfb9a55d906f089602501d9e762aff1d881
BLAKE2b-256 checksum
How to use checksums
477251f167be079858cb7bacc0a22ad8a9a8d46d81c8f2ab38de88dfd85a2da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / long_screen-0.1.1-cp311-abi3-win_amd64.whl

Download URL long_screen-0.1.1-cp311-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7ec25d3b3afeb5c3bc284a8fdfce73c8dfe9309cb2a38c0c39f29a13998164e1
BLAKE2b-256 checksum
How to use checksums
96b36686cf0d4d830f92b934e238e3d6e0ed60b8fb121c0945aa3fd01467c48b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / long_screen-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL long_screen-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
96b885940a23fd1d3a37af2ad3c85c5534a4f6c1c25919150a8fd7af822364c4
BLAKE2b-256 checksum
How to use checksums
cff5973906209b2304e0a83680685199da1817869299b627f4ec5fe15e63fc38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / long_screen-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL long_screen-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c6ffd954f387ef0cc64adbf6ee8ccdb342da0a5c7556171ef8a92320f1340ca9
BLAKE2b-256 checksum
How to use checksums
6030a95dcd642759bc1d739cc42899b471af66ea957ae044dd4d6ca5f3f878ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / long_screen-0.1.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL long_screen-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e34d249721104331623760d62ac1894e9324a1571294f89227097f455ffd57e4
BLAKE2b-256 checksum
How to use checksums
378dd5cb75363f7aadba87716cb2261eefc8f8cae424d9c7ee5e1f102002027a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / long_screen-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL long_screen-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f125f40df4c9ae68847f22cbb917a16ffd80e33ce2a7cc9e5688084b2a1b6837
BLAKE2b-256 checksum
How to use checksums
1821b5127c98568e27519e8e70065ece62ad064398e210524e5584cd675a3738
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Security for long-screen 0.1.1

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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for long_screen-0.1.1.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 Oct 19, 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.1.1 This release

6 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