This repository now contains two scripts:
screen_recorder.py— screen recording only (original).screen_recorder_with_audio.py— screen recording + system audio (Windows / WASAPI loopback).
- OpenCV
- NumPy
- pyautogui
- datetime
Records the screen and saves an .avi output file with date & time in the filename.
- When the program is executed, a preview window opens which can be minimized without any hinderance to recording.
- To stop the recording you need to open the preview window and press
e. - Do not exit the program by crossing out the preview window or python shell as it may create a non viewable video file.
- Records the full screen video.
- Records system audio (“what you hear”) using Windows WASAPI loopback.
- Automatically finds
ffmpegif installed, otherwise it installs a bundled FFmpeg viaimageio-ffmpegon first run. - Produces a final
screen_with_audio_<timestamp>.mp4.
Note: This script is intended for Windows. For macOS/Linux, system-audio capture typically needs different routing/loopback setup.
PyAudioWPatch(WASAPI loopback capture)imageio-ffmpeg(auto-providesffmpeg.exeif missing)threading,wave,subprocess,shutil(standard library)
pip install opencv-python pyautogui numpy
pip install PyAudioWPatch
- A preview window opens; you can minimize it while recording.
- To stop: focus the preview window and press
e. - The script may create temporary/intermediate files (e.g.,
.avifor video and.wavfor audio) before muxing into the final.mp4.