Video Compression Workflow for Fab Academy (macOS)¶
Overview¶
This guide documents the setup of an automated video compression system for Fab Academy documentation on macOS. Claude.ai was used to walk me through the steps, and to create this workflow with the options I chose. A custom Quick Action was created that allows me to right-click any video file in Finder, and compress it to a smaller size suitable for GitLab repositories.
Author: Dorian Fritze
Date: February 2, 2026
System: MacBook Pro running macOS
Tools Used: Automator, FFmpeg, Homebrew, Claude.ai
Table of Contents¶
- Prerequisites Installation
- Creating the Automator Quick Action
- Understanding the Compression Script
- Usage Instructions
- Expected Results
- Troubleshooting
- Customization Options
- Why This Matters for Fab Academy
Prerequisites Installation¶
Step 1: Install Homebrew¶
Homebrew is a package manager for macOS that simplifies software installation.
-
Open Terminal (Applications → Utilities → Terminal)
-
Run the installation command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Enter your Mac password when prompted (text won't appear as you type - this is normal security behavior)
-
Wait 5-10 minutes for installation
-
Critical Step: After installation, run the "Next steps" commands shown in the Terminal output:
echo '' >> ~/.bash_profile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile source ~/.bash_profile -
Verify installation:
Expected output:brew --versionHomebrew 4.x.xor similar
Step 2: Install FFmpeg¶
FFmpeg is a powerful video processing tool that handles the actual compression.
-
Install via Homebrew:
brew install ffmpeg -
Wait 5-10 minutes for download and installation
-
Verify installation:
Expected output: Version information (e.g.,ffmpeg -versionversion 7.0.1or8.0.1)
Creating the Automator Quick Action¶
Step 1: Open Automator¶
- Press
Cmd + Space(Spotlight Search) - Type "Automator"
- Press Enter
Step 2: Create New Quick Action¶
- Click "New Document" (or File → New)
- Select "Quick Action" (gear icon)
- Click "Choose"
Step 3: Configure Workflow Settings¶
At the top of the Automator window: - "Workflow receives current" → "movie files" - "in" → "Finder" - Leave "Output replaces input" unchecked (preserves original files)
Step 4: Add Run Shell Script Action¶
- In the left sidebar, ensure you're viewing "Library" (not a specific category)
- Find "Run Shell Script" action:
- Option A: Search for it in the search box
- Option B: Look under the "Utilities" category
- Drag "Run Shell Script" into the workflow area on the right
Step 5: Configure the Shell Script¶
In the "Run Shell Script" action:
- Shell:
/bin/bash - Pass input:
as arguments - Delete the default code
- Paste this script:
export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH
for f in "$@"
do
filename="${f%.*}"
output="${filename}_compressed.mp4"
/opt/homebrew/bin/ffmpeg -i "$f" -vcodec h264 -crf 28 -preset medium -vf "scale=-2:720" -movflags +faststart "$output"
done
osascript -e 'display notification "Video compression complete!" with title "Fab Academy"'
Step 6: Save¶
- Press
Cmd + S(or File → Save) - Name: "Compress for Fab Academy"
- Saves automatically to
~/Library/Services/
Understanding the Compression Script¶
Script Breakdown¶
export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH
for f in "$@"
do
filename="${f%.*}"
output="${filename}_compressed.mp4"
/opt/homebrew/bin/ffmpeg -i "$f" -vcodec h264 -crf 28 -preset medium -vf "scale=-2:720" -movflags +faststart "$output"
osascript -e 'display notification "Video compression complete!" with title "Fab Academy"'
FFmpeg Parameters Explained¶
| Parameter | Value | Purpose |
|---|---|---|
-i "$f" |
Input file | Source video to compress |
-vcodec h264 |
H.264 codec | Universal video codec, plays everywhere |
-crf 28 |
Quality level | Constant Rate Factor: 18=high quality, 28=balanced, 32+=small files |
-preset medium |
Encoding speed | Balance between speed and compression efficiency |
-vf "scale=-2:720" |
720p height | Resize to 720p, maintains aspect ratio |
-movflags +faststart |
Streaming optimization | Moves metadata to file beginning for faster web loading |
"$output" |
Output filename | Destination for compressed video |
Why These Settings?¶
- H.264 codec: Most compatible format, plays in all browsers
- CRF 28: Good balance between quality and file size (70-90% reduction)
- 720p: Sufficient resolution for documentation, significantly smaller than 1080p/4K
- Medium preset: Reasonable compression time without excessive CPU usage
- Fast start: Videos begin playing immediately on web pages
Usage Instructions¶
Single Video Compression¶
- Navigate to your video file in Finder
- Right-click the video (e.g.,
fabrication_process.MOV) - Hover over "Quick Actions"
- Click "Compress for Fab Academy"
- Wait for processing (30 seconds to several minutes)
- Notification appears: "Video compression complete!"
- Compressed file appears:
fabrication_process_compressed.mp4
Batch Processing Multiple Videos¶
- Select multiple video files in Finder (Cmd+Click each file)
- Right-click selection
- Quick Actions → "Compress for Fab Academy"
- All videos process sequentially
- Each compressed file appears as processing completes
Integration with Fab Academy Workflow¶
1. Record process on iPhone → video.MOV (450 MB)
2. Transfer to Mac via AirDrop/cable
3. Right-click → Compress for Fab Academy
4. Get video_compressed.mp4 (35 MB)
5. Add to Fab Academy repo
6. Commit and push to GitLab
Expected Results¶
Typical Compression Performance¶
| Original Format | Original Size | Compressed Size | Reduction | Resolution |
|---|---|---|---|---|
| iPhone 4K MOV | 450 MB | 35 MB | 92% | 720p |
| iPhone 1080p MOV | 180 MB | 18 MB | 90% | 720p |
| Drone 4K MP4 | 800 MB | 65 MB | 92% | 720p |
| Screen Recording | 120 MB | 12 MB | 90% | 720p |
File Naming Convention¶
- Original:
milling_process.MOV - Compressed:
milling_process_compressed.mp4 - Both files coexist in the same folder
- Original remains untouched as backup
Quality Assessment¶
Suitable for: - ✅ Fab Academy documentation pages - ✅ Process demonstrations - ✅ Machine operation videos - ✅ Web embedding - ✅ GitLab repository storage
Not ideal for: - ❌ Professional video production - ❌ Large screen presentations - ❌ Detailed close-up work requiring 4K - ❌ Archival purposes (use originals)
Troubleshooting¶
Quick Action Doesn't Appear in Context Menu¶
Solution: 1. Go to System Settings → Privacy & Security 2. Click Extensions → Finder 3. Ensure "Compress for Fab Academy" is enabled/checked 4. Restart Finder if needed (Option+Right-click Finder icon → Relaunch)
Video Compression Fails Silently¶
Diagnosis: Check FFmpeg installation
ffmpeg -version
If command not found:
brew install ffmpeg
Check Homebrew PATH:
echo $PATH
/opt/homebrew/bin
If PATH missing:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
source ~/.bash_profile
Manual Test in Terminal¶
To diagnose issues, run compression manually:
cd ~/Desktop # or wherever your video is
/opt/homebrew/bin/ffmpeg -i input_video.MOV -vcodec h264 -crf 28 -preset medium -vf "scale=-2:720" -movflags +faststart output_compressed.mp4
This shows error messages if something fails.
Common Error Messages¶
"Permission denied" - Check file isn't open in another application - Ensure you have write permissions in the folder
"Invalid codec"
- FFmpeg might not be fully installed
- Reinstall: brew reinstall ffmpeg
"No such file or directory" - File path contains special characters - Try moving video to Desktop and retry
Customization Options¶
Adjusting Video Quality¶
Edit the -crf value in the script:
| CRF Value | Quality | File Size | Use Case |
|---|---|---|---|
-crf 18 |
Very High | Larger | High-quality presentations |
-crf 23 |
High | Large | Important documentation |
-crf 28 |
Good (default) | Balanced | General use |
-crf 32 |
Acceptable | Small | Maximum compression |
-crf 35 |
Lower | Very small | Quick previews |
Changing Output Resolution¶
Edit the scale=-2:720 parameter:
-vf "scale=-2:1080" # 1080p Full HD
-vf "scale=-2:720" # 720p HD (default)
-vf "scale=-2:480" # 480p SD (very small files)
Adjusting Encoding Speed¶
Edit the -preset value:
| Preset | Speed | File Size | CPU Usage |
|---|---|---|---|
ultrafast |
Very fast | Largest | Low |
fast |
Fast | Large | Medium |
medium |
Balanced (default) | Good | Medium |
slow |
Slower | Smaller | High |
veryslow |
Very slow | Smallest | Very high |
Recommendation: Keep medium for normal use, use slow for final documentation videos.
Example Custom Configuration¶
For maximum compression (smallest files):
/opt/homebrew/bin/ffmpeg -i "$f" -vcodec h264 -crf 32 -preset slow -vf "scale=-2:480" -movflags +faststart "$output"
For higher quality documentation:
/opt/homebrew/bin/ffmpeg -i "$f" -vcodec h264 -crf 23 -preset slow -vf "scale=-2:1080" -movflags +faststart "$output"
Why This Matters for Fab Academy¶
GitLab Repository Considerations¶
File Size Limits: - Most GitLab instances limit individual files to 100MB - Repository quotas often range from 500MB to 5GB - Uncompressed iPhone videos easily exceed these limits
Clone Performance: - Smaller repos download faster for instructors/peers - Reduces bandwidth usage on limited connections - Faster CI/CD pipeline execution
Example Impact:
Week 1-16 documentation with 3 videos each:
- Uncompressed: 48 videos × 400MB = 19.2 GB ❌ (exceeds quota)
- Compressed: 48 videos × 30MB = 1.44 GB ✅ (well within limits)
Documentation Best Practices¶
Web Performance: - 720p loads quickly on documentation pages - H.264/MP4 plays natively in all browsers - Fast-start optimization enables immediate playback - Mobile-friendly file sizes
Archival Strategy:
Keep originals on:
- External hard drive
- Cloud storage (Google Drive, iCloud)
- Personal backup
Commit to Git:
- Compressed versions only
- Optimized for web viewing
- Within size constraints
Workflow Efficiency¶
Time Savings: - Manual compression: ~5 minutes per video - Automated Quick Action: ~30 seconds interaction time - Batch processing: Set and forget
Consistency: - All videos use same settings - Predictable file sizes - Uniform quality across documentation
Professional Presentation: - Clean, consistent video formats - Fast-loading documentation pages - No broken/missing videos due to size issues
Real-World Fab Academy Scenario¶
Assignment: Document CNC milling process
Without compression workflow:
1. Record 10-minute process → 1.2 GB file
2. Try to commit → Git rejects (file too large)
3. Search for online converter
4. Upload to sketchy website
5. Wait for processing
6. Download result
7. Hope quality is acceptable
Total time: 20+ minutes, security concerns
With compression workflow:
1. Record 10-minute process → 1.2 GB file
2. Right-click → Compress for Fab Academy
3. Wait 2 minutes → 95 MB file
4. Commit and push successfully
Total time: 3 minutes, secure local processing
Advanced Tips¶
Creating Multiple Quality Profiles¶
You can create multiple Quick Actions with different settings:
- "Compress for Fab Academy (High Quality)"
-
CRF 23, 1080p, slow preset
-
"Compress for Fab Academy (Small)"
-
CRF 32, 480p, fast preset
-
"Compress for Fab Academy (Balanced)" (default)
- CRF 28, 720p, medium preset
Adding Progress Indication¶
For longer videos, modify the script to show progress:
/opt/homebrew/bin/ffmpeg -i "$f" -vcodec h264 -crf 28 -preset medium -vf "scale=-2:720" -movflags +faststart -progress pipe:1 "$output" 2>&1 | grep -oP 'frame=\K[0-9]+'
Automating Upload to GitLab¶
Extend the workflow to automatically stage compressed videos:
# After compression
cd /path/to/fab/academy/repo
git add "*_compressed.mp4"
osascript -e 'display notification "Ready to commit!" with title "Fab Academy"'
Summary¶
What You Built¶
A professional video compression pipeline that:
✅ Reduces video file sizes by 70-90%
✅ Maintains documentation-appropriate quality
✅ Integrates seamlessly into Finder workflow
✅ Preserves original files as backups
✅ Produces GitLab-compatible file sizes
✅ Uses industry-standard H.264/MP4 format
Setup Investment vs. Time Saved¶
One-time setup: ~20 minutes
Time saved per video: ~5 minutes
Break-even point: After 4 videos
Typical Fab Academy term: 40+ videos = 3+ hours saved
Key Takeaways¶
- Automation eliminates repetitive tasks - Right-click beats remembering commands
- Local processing is secure - No uploading to third-party services
- Consistency improves documentation - All videos follow same standards
- Preservation of originals - Non-destructive workflow maintains archives
- GitLab-friendly - Respects repository constraints from the start
Resources¶
Official Documentation¶
- FFmpeg Documentation: https://ffmpeg.org/documentation.html
- Homebrew Documentation: https://docs.brew.sh
- Fab Academy Documentation: http://fabacademy.org
Further Learning¶
- FFmpeg encoding guide: https://trac.ffmpeg.org/wiki/Encode/H.264
- Video compression theory: Understanding codecs, bitrates, and quality metrics
- Git LFS (Large File Storage): Alternative for managing large files in Git
Alternative Tools¶
If this workflow doesn't meet your needs:
- HandBrake: GUI application for video compression
- Compressor (Mac): Apple's professional video encoding tool
- Adobe Media Encoder: Full-featured professional solution
- Online tools: CloudConvert, FreeConvert (less secure, requires upload)
Changelog¶
Version 1.0 - February 2, 2026 - Initial documentation - Tested on MacBook Pro, macOS 14+ - FFmpeg 7.x/8.x - Homebrew 4.x
License & Attribution¶
This workflow and documentation created for Fab Academy 2026.
Feel free to: - Share with classmates and instructors - Adapt for your specific needs - Contribute improvements
Created by: Dorian Fritze
Fab Academy Year: 2026
Institution: [Your Fab Lab]
Questions or Issues?¶
If you encounter problems with this workflow:
- Check the Troubleshooting section
- Verify FFmpeg installation:
ffmpeg -version - Test manual compression in Terminal
- Contact your Fab Academy instructor
- Consult Fab Academy forum or Slack channel
Remember: Keep your original videos backed up separately from your Git repository!
Last updated: February 2, 2026