
Python Screen Recorder
Python screen recorder also pyscreenrecorder
is a powerful Python package for screen recording with an optional mouse cursor overlay.
It allows high-performance screen capturing, custom resolution, and real-time mouse tracking.
β¨ Features
- π₯ Record screen with smooth frame rates (30 FPS default).
- π± Mouse overlay customization (color, size, thickness).
- πΊ Multi-monitor support β Choose which monitor to record.
- π Set custom resolution (e.g., 1280x720, 1920x1080).
- β‘ Optimized performance with
mss
for fast screen capture.
- π¨ Flexible output formats β Supports
.mp4
, .avi
, and .mkv
.
- π Monitor detection β List available monitors and their specs.
π¦ Installation
Install pyscreenrecorder
using pip:
pip install pyscreenrecorder
Upgrade pyscreenrecorder
using pip:
pip install pyscreenrecorder -U
π Usage
Basic Screen Recording
from pyscreenrecorder import ScreenRecorder
ScreenRecorder(
filename="screen_record.mp4",
duration=10,
fps=30,
monitor_number=1,
mouse=True,
)
πΊ Listing Available Monitors
from pyscreenrecorder import pyScreenRecorder
monitors = pyScreenRecorder.list_monitors()
print("Available Monitors:", monitors)
Example Output:
[
{ "monitor": 0, "width": 1920, "height": 1080 },
{ "monitor": 1, "width": 2560, "height": 1440 }
]
π₯ Recording with Custom Settings
from pyscreenrecorder import ScreenRecorder
ScreenRecorder(
filename="custom_record.mp4",
duration=15,
fps=60,
monitor_number=2,
resolution=(1280, 720),
mouse=True,
mouse_color=(255, 0, 0),
mouse_size=10,
mouse_thickness=3,
)
πΉ 60 FPS Recording
πΉ Custom 1280x720 resolution
πΉ Red-colored mouse cursor with increased size
π Advanced Example
from pyscreenrecorder import pyScreenRecorder
if __name__ == "__main__":
monitors = pyScreenRecorder.list_monitors()
print("Available Monitors:", monitors)
pyRec = pyScreenRecorder(
filename="high_quality_record.mp4",
duration=30,
fps=60,
monitor_number=1,
resolution=(1920, 1080),
mouse=True,
mouse_color=(0, 255, 0),
mouse_size=6,
mouse_thickness=2,
)
pyRec.screenRecorder()
β Supported File Formats
pyscreenrecorder
supports the following video formats:
MP4 | High compatibility |
AVI | Uncompressed quality |
MKV | Modern, flexible |
Set the format by using the appropriate file extension in filename
.
Example:
ScreenRecorder(filename="recording.mkv")
π― Dependencies
pyscreenrecorder
relies on:
opencv-python
numpy
mss
pyautogui
MouseInfo
PyGetWindow
PyMsgBox
pyperclip
PyRect
PyScreeze
pytweening
No additional configuration is required.
π License
This project is licensed under the MIT License.
π More Information
π GitHub Repository:
π https://github.com/SSujitX/pyscreenrecorder
π Issue Tracker:
π Report a Bug
π Conclusion
pyscreenrecorder
is an efficient, easy-to-use, and customizable screen recording tool in Python. Whether you need basic screen capturing or advanced mouse-tracked recordings, this package provides all the features.
π Try it today! π
