A native macOS camera application built with C++17, Qt6 and FFmpeg. Captures video from any connected camera (built-in, external, or Continuity Camera) and displays it in a resizable window.
- Camera selection - choose from all available video devices at startup
- Configurable settings - resolution, framerate and pixel format are queried from the hardware and presented in a settings dialog
- Live preview - real-time video feed with aspect-ratio-preserving scaling
- macOS integration - proper app bundle with camera permission handling
- macOS 12 or later
- Homebrew
- Xcode Command Line Tools (
xcode-select --install)
Install the dependencies:
brew install ffmpeg qtgit clone https://github.com/anborr/camera-viewer.git
cd camera-viewer
mkdir -p build && cd build
cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix qt);$(brew --prefix ffmpeg)"
make -j$(sysctl -n hw.ncpu)open camera-viewer.appOn first launch, macOS will prompt for camera access. The app then presents two dialogs in sequence:
- Camera Selection - pick from the list of detected video devices
- Camera Settings - configure resolution, framerate and pixel format
After confirming, the live camera feed is displayed.
camera-viewer/
├── CMakeLists.txt # Build configuration
├── Info.plist # macOS app bundle metadata
├── main.cpp # Entry point and startup flow
├── CameraWorker.h/cpp # FFmpeg capture and frame decoding
├── CameraWidget.h/cpp # Qt display widget
├── CameraSettingsDialog.h/cpp # Settings UI with capability query
├── CameraSettings.h # Settings data structures
├── CameraPermission.h/mm # macOS camera permission (Obj-C++)
└── build/ # Build output (gitignored)
- Frame capture runs on the main thread via
QTimerbecause AVFoundation requires an active CFRunLoop to deliver frames. - Capability discovery queries the camera's supported modes by parsing AVFoundation's log output through FFmpeg's
av_log_set_callback. - The app is built as a macOS bundle with
NSCameraUsageDescriptioninInfo.plistto enable the system permission dialog.
MIT