This repository contains a Bash script for automating a photogrammetry workflow on macOS using GLOMAP and COLMAP. It takes video files as input, extracts frames via FFmpeg, and generates a 3D sparse point cloud for each video.
This script is a macOS/Apple Silicon adaptation of Polyfjord’s workflow, rewritten to run smoothly on Mac systems.
- One-Command Automation: Processes all videos in the input folder in a single run.
- CPU & Apple Silicon Ready: Automatically detects CPU threads and works on M-series Macs.
- Error Handling: Skips already processed videos and ensures the workflow executes step by step without breaking.
- Organized Output: Keeps results clean with a structured project folder.
- COLMAP + GLOMAP Integration: Extracts features, performs sequential matching, and runs sparse reconstruction automatically.
- TXT Export: Converts COLMAP models to TXT format for easier inspection or import.
- COLMAP – Structure-from-motion and multi-view stereo pipeline.
- GLOMAP – COLMAP extension for automated mapping.
- FFmpeg – For frame extraction.
- Colmap and Glomap:
Install by following this guide
- FFmpeg:
brew install ffmpeg
Project_Folder/
├── VIDEOS/ # Place input video files (.mp4, .mov) here.
├── SCENES/ # The script saves all outputs here.
└── SCRIPTS/ # The run_glomap.sh script lives here.
-
Set Up Folders: Create the structure shown above.
-
Add Videos: Copy your
.mp4
or.mov
files into theVIDEOS/
folder. -
Save the Script: Place the script (
run_glomap.sh
) in theSCRIPTS/
folder. -
Update Paths: Edit the script and update these variables to match your system installation:
FFMPEG="/opt/homebrew/bin/ffmpeg" COLMAP="/usr/local/bin/colmap" GLOMAP="/usr/local/bin/glomap"
If you are unsure of the paths, run:
which colmap ffmpeg glomap
-
Make it Executable:
chmod +x run_glomap.sh
-
Run the Script: From inside the
SCRIPTS/
folder:./run_glomap.sh
-
COLMAP/GLOMAP/FFmpeg not found: Ensure the paths in the script match your system installation.
-
No frames extracted: Check that your video files are valid and playable by FFmpeg.
-
Slow processing: Reduce
--SiftExtraction.max_image_size
(e.g., from 4096 → 2048) or process shorter clips. -
GPU/CPU issues: This script primarily uses CPU. M-series Macs may benefit from COLMAP GPU support if configured.
This script fully automates Polyfjord’s photogrammetry workflow on macOS using GLOMAP and COLMAP, making it easy to generate 3D sparse point clouds from videos. Future updates may include optimizations and support for additional Mac hardware.
Amazing work, it took very little adaptation to work for Linux and I have credited you in my fork https://gist.github.com/Norgus/9e877924949d778db12c534ff1bafe36