Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

mistercar-screenshooter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mistercar-screenshooter

A versatile, high-performance Python package for cross-platform screen capturing and recording

  • 1.0.3
  • PyPI
  • Socket score

Maintainers
1

๐Ÿ“ธ mistercar-screenshooter ๐Ÿ’ฅ

๐Ÿš€ A versatile, high-performance Python package for cross-platform screen capturing and recording. It offers functionality for full screen, region, window, and monitor capture, as well as video recording capabilities. ๐ŸŽž๏ธ

๐Ÿ› ๏ธ Installation

pip install mistercar-screenshooter

๐Ÿ“š Usage

Here's a comprehensive example demonstrating all the main features of screenshooter:

from mistercar_screenshooter import ScreenCapture
import cv2
import time

# Create a ScreenCapture instance
sc = ScreenCapture()

# 1. Capture the entire screen
screen = sc.capture_screen()
cv2.imwrite("full_screen.png", cv2.cvtColor(screen, cv2.COLOR_RGB2BGR))

# 2. Capture a specific region
region = sc.capture_region((100, 100, 500, 500))
cv2.imwrite("region.png", cv2.cvtColor(region, cv2.COLOR_RGB2BGR))

# 3. Capture a specific window (Windows only)
try:
    window = sc.capture_window("*Untitled - Notepad")
    cv2.imwrite("window.png", window)
except NotImplementedError:
    print("Window capture is not supported on this platform.")

# 4. List and capture from multiple monitors
monitors = sc.list_monitors()
for i, monitor in enumerate(monitors):
    img = sc.capture_monitor(i)
    cv2.imwrite(f"monitor_{i}.png", cv2.cvtColor(img, cv2.COLOR_RGB2BGR))

# 5. Record a video
sc.record_video("output.mp4", duration=5, fps=60, capture_type="screen")

# 6. Use the recorder for continuous capture
recorder = sc.create_recorder("screen")
recorder.start()
start_time = time.time()
frame_count = 0
while time.time() - start_time < 5:  # Record for 5 seconds
    frame = recorder.get_latest_frame()
    # In a real application, you might process or save the frame here
    frame_count += 1
recorder.stop()
print(f"Captured {frame_count} frames in 5 seconds (approx. {frame_count / 5:.2f} FPS)")

This example covers all main functionalities:

  1. ๐Ÿ“ท Full screen capture
  2. ๐Ÿ” Region capture
  3. ๐ŸชŸ Window capture (Windows only)
  4. ๐Ÿ–ฅ๏ธ๐Ÿ–ฅ๏ธ Multiple monitor support
  5. ๐ŸŽฅ Video recording
  6. ๐Ÿ”„ Continuous capture with the recorder

You can find this example as a runnable script in the examples/demo.py file in the repository.

Platform-specific notes

๐ŸชŸ Windows

On Windows, screenshooter uses the BetterCam library for high-performance screen capture. This provides several benefits:

  • โšก High-speed capture (240Hz+ capable)
  • ๐ŸŽฎ Ability to capture from Direct3D exclusive full-screen applications
  • ๐Ÿ–ผ๏ธ Automatic adjustment for scaled/stretched resolutions

๐Ÿง Linux and ๐ŸŽ macOS

On Linux and macOS, screenshooter uses the MSS (Multiple Screen Shot) library for screen capture. While it doesn't offer the same level of performance as BetterCam on Windows, it provides a consistent cross-platform experience.

๐Ÿ™ Acknowledgements

ScreenShooter is built upon these fantastic projects:

  • ๐Ÿ–ผ๏ธ BetterCam: The world's fastest Python screenshot library for Windows.
  • ๐Ÿ–ฅ๏ธ MSS (Multiple Screen Shot): An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.

We're grateful to the maintainers and contributors of these projects for their excellent work!

๐Ÿงช Testing

To run the tests, install pytest and run:

pytest tests/

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc