A high-performance screen recording utility built with Python. This project utilizes the mss library for fast frame grabbing and threading to ensure smooth recording at 60 FPS without lagging the live preview.
- Multi-threaded Capture: Separates the screen grabbing logic from the video writing process to maintain consistent frame rates.
- Live Preview: Real-time window showing what is being recorded (scaled for performance).
- High Performance: Uses
mss, which is significantly faster than standard PIL or PyAutoGUI methods. - XVID Encoding: Saves recordings in
.aviformat.
Before running the script, ensure you have Python 3.x installed.
- Clone the repository:
git clone [https://github.com/DakshNamdev/python-screen-recorder.git](https://github.com/DakshNamdev/python-screen-recorder.git)
cd screen-recorder- Install the required dependencies:
pip install -r requirements.txtSimply run the main script:
python main.py- Live Preview: A window named "Live" will appear.
- Stop Recording: Press the 'q' key while the preview window is focused to stop recording and save the file.
- Output: The recorded file will be saved as
Recording.aviin the project directory.
You can adjust the following constants in the code to match your monitor setup:
WIDTH&HEIGHT: Set these to your monitor's resolution (default is 1920x1080).fps: Target frames per second (default is 60.0).