Skip to main content

A small and cross-platform python library for recording screen.

Project description

pyscreenrec

pyscreenrec is a small and cross-platform python library for recording screen.

Downloads


Installation

Install on Windows: pip install pyscreenrec

Install on Linux/macOS: pip3 install pyscreenrec


Example usage

>>> import pyscreenrec
>>> recorder = pyscreenrec.ScreenRecorder()

>>> # to start recording
>>> recorder.start_recording("recording.mp4", 10) 
>>> # 'recording.mp4' is the name of the output video file, may also contain full path like 'C:/Users/<user>/Videos/video.mp4'
>>> # the second parameter(10) is the FPS. You can specify the FPS for the screen recording using the second parameter.

>>> # to pause recording
>>> recorder.pause_recording()

>>> # to resume recording
>>> recorder.resume_recording()

>>> # to stop recording
>>> recorder.stop_recording()

Keep in mind that the start_recording method is non-blocking, it will start a thread in the background to capture the screenshots.

The stop_recording saves the video and deletes all screenshots used in the session. So calling the stop_recording method is necessary when start_recording is called.

If a screen recording session is already running, calling the start_recording and resume_recording methods raises a ScreenRecodingInProgress warning.

Similarly, if a screen recording session is not running, calling the stop_recording and pause_recording methods raises a NoScreenRecodingInProgress warning.


Known limitations

pyscreenrec is not able to:

  • capture the system sound during screen recording
  • capture only a certain part of the screen

Change Log

Changes made in the latest version (v0.5) are:

  • Remove the HighFPSWarning and InvalidFPS exception classes.
  • Raise frame count by almost 2 times.
  • Calling start and resume recording methods on an already running recorder instance raises a warning instead of printing, and vice versa.
  • Temporary screenshots are now stored in ~/.pyscreenrec_data folder.
  • Internal refactors.

View CHANGELOG for more details.


Contribution

Pull requests are welcome. If you want to make a major change, open an issue first to discuss about the change.

For further details, view CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyscreenrec-0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

pyscreenrec-0.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pyscreenrec-0.5.tar.gz.

File metadata

  • Download URL: pyscreenrec-0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for pyscreenrec-0.5.tar.gz
Algorithm Hash digest
SHA256 6016f90c4147ae335d9f7712bec28a98b8b3562b5406bc0762a14cc790c8a3ab
MD5 04b5398a4e390ed7b42cbc39eb91c37c
BLAKE2b-256 1018f829fe96974b7eca01e31efb8091138506da6bf94324dd4f8515bd480475

See more details on using hashes here.

File details

Details for the file pyscreenrec-0.5-py3-none-any.whl.

File metadata

  • Download URL: pyscreenrec-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for pyscreenrec-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d30cdbb444be8385e9f39e3a9d05a84ed0b51a165a33db8a940b0b86994284a9
MD5 1fa43a8766d0eb49ad637fafe4e29545
BLAKE2b-256 005c61abeba917e359ce97118a0a59e831678ea53604e44e5457984962163a9f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page