This project provides a Python-based command-line tools that extracts individual slides from a screen recording (e.g., .mov or .mp4 video file). The tools detect when the content of a slide changes and saves each new slide as an image file in a dedicated folder. It helps you break a recorded presentation or video into individual slides for easy access.
-
Automatically detects changes between frames and extracts only the slides.
-
Saves each slide as a
.jpgor.pngimages. -
Includes a prompt to avoid overwriting existing files in case of duplicate output folder names.
-
Supports input files in
.mov,.mp4, and other video formats supported by OpenCV. -
There are two scripts - neither are working 100%
extract_slides.pyslide_extractor.py
Before running the tool, ensure you have the following installed:
- Python 3.x (required for running the script)
- OpenCV for Python (for video processing)
- NumPy (used for frame comparison)
You can install the required Python packages from the provided requirements.txt file.
pip install -r requirements.txtgit clone https://github.com/dougie181/slide-extractor.git
cd slide-extractorIt is recommended to create a virtual environment to isolate the project’s dependencies. Here’s how to create one:
-
macOS/Linux:
python3 -m venv .venv source .venv/bin/activate -
Windows:
python -m venv .venv .venv\Scripts\activate
Once the virtual environment is activated, install the required libraries using pip and the requirements.txt file:
pip install -r requirements.txtThis will install OpenCV, NumPy, and any other dependencies listed in the requirements.txt file.
chmod +x ./scripts/extract_slides.pyOnce you have set up the environment, you can use the extract_slides.py script to extract slides from your video. Here’s how to run the script:
-
macOS/Linux:
./scripts/extract_slides.py <path_to_your_video_file>
-
Windows:
python scripts/extract_slides.py <path_to_your_video_file>
For example, if your video file is located in data/input/slides.mov, you would run:
./scripts/extract_slides.py data/input/slides.mov # macOS/Linuxor
python scripts/extract_slides.py data/input/slides.mov # WindowsIf a folder already exists for the extracted slides (e.g., slides_extracted_frames), the script will ask whether you want to overwrite the existing folder:
Directory 'slides_extracted_frames' already exists. Do you want to overwrite it? (y/n):If you choose y, the contents will be overwritten. If you choose n, the script will exit without making any changes.
The script creates a folder named <video_name>_extracted_frames (where <video_name> is the name of your video file without the extension) and stores the extracted slides there as .jpg images.
For example, if your video file is slides.mov, the slides will be saved in a folder called slides_extracted_frames.
./scripts/extract_slides.py data/input/slides.movThe above command will extract slides from the slides.mov video located in the data/input folder and store the output images in the slides_extracted_frames folder.
Once you are done with the project, you can deactivate the virtual environment by running:
deactivateThis project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.