mistercar-screenshooter


Namemistercar-screenshooter JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/PypayaTech/mistercar-screenshooter
SummaryA versatile, high-performance Python package for cross-platform screen capturing and recording
upload_time2024-10-05 23:13:20
maintainerNone
docs_urlNone
authorPypayaTech
requires_python<4.0,>=3.10
licenseMIT
keywords screen capture screenshot video recording
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐Ÿ“ธ **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

```bash
pip install mistercar-screenshooter
```

## ๐Ÿ“š Usage

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

```python
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](https://github.com/RootKit-Org/BetterCam): The world's fastest Python screenshot library for Windows.
- ๐Ÿ–ฅ๏ธ [MSS (Multiple Screen Shot)](https://github.com/BoboTiG/python-mss): 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:

```bash
pytest tests/
```

## ๐Ÿ“œ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PypayaTech/mistercar-screenshooter",
    "name": "mistercar-screenshooter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "screen capture, screenshot, video recording",
    "author": "PypayaTech",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/2b/8a/c2337e76857473b625c5a13591cc81f8c11893cea89271e9c63eb51f9b50/mistercar_screenshooter-1.0.3.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcf8 **mistercar-screenshooter** \ud83d\udca5\n\n\ud83d\ude80 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. \ud83c\udf9e\ufe0f\n\n## \ud83d\udee0\ufe0f Installation\n\n```bash\npip install mistercar-screenshooter\n```\n\n## \ud83d\udcda Usage\n\nHere's a comprehensive example demonstrating all the main features of screenshooter:\n\n```python\nfrom mistercar_screenshooter import ScreenCapture\nimport cv2\nimport time\n\n# Create a ScreenCapture instance\nsc = ScreenCapture()\n\n# 1. Capture the entire screen\nscreen = sc.capture_screen()\ncv2.imwrite(\"full_screen.png\", cv2.cvtColor(screen, cv2.COLOR_RGB2BGR))\n\n# 2. Capture a specific region\nregion = sc.capture_region((100, 100, 500, 500))\ncv2.imwrite(\"region.png\", cv2.cvtColor(region, cv2.COLOR_RGB2BGR))\n\n# 3. Capture a specific window (Windows only)\ntry:\n    window = sc.capture_window(\"*Untitled - Notepad\")\n    cv2.imwrite(\"window.png\", window)\nexcept NotImplementedError:\n    print(\"Window capture is not supported on this platform.\")\n\n# 4. List and capture from multiple monitors\nmonitors = sc.list_monitors()\nfor i, monitor in enumerate(monitors):\n    img = sc.capture_monitor(i)\n    cv2.imwrite(f\"monitor_{i}.png\", cv2.cvtColor(img, cv2.COLOR_RGB2BGR))\n\n# 5. Record a video\nsc.record_video(\"output.mp4\", duration=5, fps=60, capture_type=\"screen\")\n\n# 6. Use the recorder for continuous capture\nrecorder = sc.create_recorder(\"screen\")\nrecorder.start()\nstart_time = time.time()\nframe_count = 0\nwhile time.time() - start_time < 5:  # Record for 5 seconds\n    frame = recorder.get_latest_frame()\n    # In a real application, you might process or save the frame here\n    frame_count += 1\nrecorder.stop()\nprint(f\"Captured {frame_count} frames in 5 seconds (approx. {frame_count / 5:.2f} FPS)\")\n```\n\nThis example covers all main functionalities:\n1. \ud83d\udcf7 Full screen capture\n2. \ud83d\udd0d Region capture\n3. \ud83e\ude9f Window capture (Windows only)\n4. \ud83d\udda5\ufe0f\ud83d\udda5\ufe0f Multiple monitor support\n5. \ud83c\udfa5 Video recording\n6. \ud83d\udd04 Continuous capture with the recorder\n\nYou can find this example as a runnable script in the `examples/demo.py` file in the repository.\n\n## Platform-specific notes\n\n### \ud83e\ude9f Windows\n\nOn Windows, screenshooter uses the BetterCam library for high-performance screen capture. This provides several benefits:\n\n- \u26a1 High-speed capture (240Hz+ capable)\n- \ud83c\udfae Ability to capture from Direct3D exclusive full-screen applications\n- \ud83d\uddbc\ufe0f Automatic adjustment for scaled/stretched resolutions\n\n### \ud83d\udc27 Linux and \ud83c\udf4e macOS\n\nOn 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.\n\n## \ud83d\ude4f Acknowledgements\n\nScreenShooter is built upon these fantastic projects:\n\n- \ud83d\uddbc\ufe0f [BetterCam](https://github.com/RootKit-Org/BetterCam): The world's fastest Python screenshot library for Windows.\n- \ud83d\udda5\ufe0f [MSS (Multiple Screen Shot)](https://github.com/BoboTiG/python-mss): An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.\n\nWe're grateful to the maintainers and contributors of these projects for their excellent work!\n\n## \ud83e\uddea Testing\n\nTo run the tests, install pytest and run:\n\n```bash\npytest tests/\n```\n\n## \ud83d\udcdc License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A versatile, high-performance Python package for cross-platform screen capturing and recording",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/PypayaTech/mistercar-screenshooter",
        "Repository": "https://github.com/PypayaTech/mistercar-screenshooter"
    },
    "split_keywords": [
        "screen capture",
        " screenshot",
        " video recording"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "051635d294dec97b582d727bb3d06dc1e0c1d783fa1c2d2089e9758061f6432d",
                "md5": "5fee4f65d2ebbcf9fdbe6f5d372eef43",
                "sha256": "fc83a748a4c00e13e657f858b9774f8f4fbad12c30eb77ea9a987103b459e0a1"
            },
            "downloads": -1,
            "filename": "mistercar_screenshooter-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5fee4f65d2ebbcf9fdbe6f5d372eef43",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13228,
            "upload_time": "2024-10-05T23:13:19",
            "upload_time_iso_8601": "2024-10-05T23:13:19.244984Z",
            "url": "https://files.pythonhosted.org/packages/05/16/35d294dec97b582d727bb3d06dc1e0c1d783fa1c2d2089e9758061f6432d/mistercar_screenshooter-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b8ac2337e76857473b625c5a13591cc81f8c11893cea89271e9c63eb51f9b50",
                "md5": "2fd84f6b071a14430f3133abe8b11b97",
                "sha256": "cd1ebfb82b5ab2a0fc9eacb4e63a11251f6710537afbd565e865e0d1a17dce6f"
            },
            "downloads": -1,
            "filename": "mistercar_screenshooter-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2fd84f6b071a14430f3133abe8b11b97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 8292,
            "upload_time": "2024-10-05T23:13:20",
            "upload_time_iso_8601": "2024-10-05T23:13:20.674717Z",
            "url": "https://files.pythonhosted.org/packages/2b/8a/c2337e76857473b625c5a13591cc81f8c11893cea89271e9c63eb51f9b50/mistercar_screenshooter-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 23:13:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PypayaTech",
    "github_project": "mistercar-screenshooter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mistercar-screenshooter"
}
        
Elapsed time: 0.47363s