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.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 long-screen 0.1.0
File Size Uploaded
long_screen-0.1.0.tar.gz 390.2 kB Details

Built distributions (wheels)

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

Total release size: 6.1 MB

Release files / long_screen-0.1.0.tar.gz

Download URL long_screen-0.1.0.tar.gz
Size 390.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7fe8d9f7949130c170a58c11c33fbbeea9fc92ef73dfe82ebf0035f83e7da98e
BLAKE2b-256 checksum
How to use checksums
ff73c9b2b490059c32f5de7de04309eea7bafc65af010880558b250fc9d4964f
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 12, 2026.

Transparency log

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

Download URL long_screen-0.1.0-cp311-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3f67c163fd66bce7da44917efc8f72f481133b5f1aaebeb433e90e7a670756a2
BLAKE2b-256 checksum
How to use checksums
9dca1aa1ec2cb20d465366cd6132b205d7e89999fff8e9e8d6ffa5d998ca9d3a
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 12, 2026.

Transparency log

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

Download URL long_screen-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
1b85b10509ebe13c2ae264947076ac59b2f909b27a6859abb6a808d0ed250aa7
BLAKE2b-256 checksum
How to use checksums
b156d99e08000fb205f4bef6e49b09023df333c05d48d317865441d8fff54b42
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 12, 2026.

Transparency log

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

Download URL long_screen-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c5dd8fa8ad1773d747c0fd27371a9201b1f5885daae5681aa5d7c307ee6dd6fb
BLAKE2b-256 checksum
How to use checksums
7617fab2010bfbbea765ad881523aa22c435c7db8074fd1eeccc2816597b6a6e
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 12, 2026.

Transparency log

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

Download URL long_screen-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
14bef5a964797ec2ea0235487ca2e7f27d987a0aac3020d0c570f72a8e006876
BLAKE2b-256 checksum
How to use checksums
3ebda5450929793b1b3705703a948201c76094824206bfdf6e423050f362d00b
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 12, 2026.

Transparency log

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

Download URL long_screen-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
333915980b0a326b5a828000f06ef631022c0b092f85d26d77e71efa887b11cc
BLAKE2b-256 checksum
How to use checksums
f60fb45822ab369d5ed83dd8ada388508129a07ec3739029a349aa21f4f12395
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files

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