This Python script allows you to record your screen for a user-defined duration and save the video with a custom name in the same directory where the script is located. It uses OpenCV and PyAutoGUI to capture the screen and create a video file.
- Python 3.x
- Libraries:
opencv-pythonpyautoguinumpypywin32
You can install the required libraries using pip:
pip install opencv-python pyautogui numpy pywin32- Clone or download this repository.
- Navigate to the folder where the script is located.
- Run the script:
python screen_recorder.py- When prompted:
- Enter the name for the video file (e.g.,
recording.mp4). - Enter the duration (in seconds) for the screen recording.
- Enter the name for the video file (e.g.,
The video will be saved in the same directory as the script with the name you provided.
- Customizable video name.
- User-defined recording duration.
- Saves video in the current directory.
- Uses XVID codec for video encoding.
Enter the name for the video: my_recording.mp4
Enter The duration for screen recording in seconds: 10
****Recording Started****
---Video has been stored in same directory as the code---This project is open-source and available under the MIT License.