This repository contains a Bash script for automating a photogrammetry workflow on Linux 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 Linux adaptation of celestial's Mac adaptation of Polyfjord’s workflow here, with minimul adaptations to run smoothly on Linux systems.
- One-Command Automation: Processes all videos in the input folder in a single run.
- 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.
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
.mp4or.movfiles 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 (only necessary if they aren't already on $PATH):
FFMPEG="$(which ffmpeg)" COLMAP="$(which colmap)" GLOMAP="$(which 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.
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.
Hi @Norgus, first of all, thank you very much for your reply.
Unfortunately, it didn't get me directly to my goal, but by analyzing the error with the help of our beloved AI, I was able to achieve my goal. I'll try to summarize it here.
The installation of Colmap, as described by you, worked perfectly. I only had to change the line
ninja -C “$srcdir/build” $(grep -oP -- ‘-+[A-z]+ ?[0-9]*’<<<“${MAKEFLAGS:--j1}”)in PKBUILD with
ninja -C “$srcdir/build” -j$(nproc)Then it got trickier. But that's where ChatGPT came in. The following answer made all the difference:
I probably wouldn't have figured that out on my own.
So thank you again.