Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A macOS virtual camera built with SwiftUI, AVFoundation & Vision — hand gestures, auto-framing, and NDI streaming support.

License

Notifications You must be signed in to change notification settings

pedrol2b/virtual-camera

virtual-camera

Contributors Forks Stargazers Issues MIT License

VirtualCamera
Image

An advanced virtual camera for macOS. Control your video feed with intuitive hand gestures and AI-powered auto-framing.

Experience professional-grade camera control through hand gestures, automatic face tracking, and real-time video processing—all powered by Apple's Vision framework and built natively for macOS.

✨ Features

A macOS camera built with SwiftUI, AVFoundation, and Vision framework that offers advanced features like:

  • 🎥 Virtual Camera Output

    • 📹 OBS Integration: Stream your processed video to OBS Studio via NDI
    • 🌐 Universal Compatibility: Works with Zoom, Teams, Discord, Google Meet, and any app that accepts virtual cameras
    • 🎬 Professional Broadcasting: Leverage OBS's Virtual Camera for system-wide video output
    • Low Latency: Near-real-time streaming using NDI technology (<33ms)
    • 🔌 Automatic Setup: One-click connection that creates and configures OBS scenes automatically
  • 🖐️ Hand Tracking & Gestures

    • Hand Pose Detection: Real-time hand skeleton tracking and visualization
    • 🤏 Pinch Gesture Recognition: Zoom control via pinch gestures
  • 🔒 Privacy & Security

    • Privacy Mode: Real-time face blurring (Gaussian or pixelation)
  • 🎨 Video Processing

    • Flip Camera: Horizontally flip the camera feed
    • Face Follow Mode: Automatic pan/zoom to keep faces centered
    • Manual Camera Controls: Tap to focus, scroll to zoom, drag to pan
    • Aspect Ratio Options: Crop modes (4:3, 16:9, 1:1, Original)
    • Color Filters: Apply filters (Sepia, Noir, Chrome, Fade, Instant, Mono, Process, Tonal, Transfer)
    • Color Correction: Adjust brightness, contrast, saturation, exposure, temperature, tint, highlights, shadows, and vibrance
  • 🛠️ Developer Tools

    • Debug Mode: Overlay information for development and testing
    • Hand Skeleton Visualization: Display the hand bone structure

🚀 Getting Started

Quick Start

Want to get up and running fast? Follow our Quick Start Guide!

Requirements

  • macOS 13.0+
  • Xcode 14.0+
  • OBS Studio (for Virtual Camera output)
  • NDI Runtime (bundled with project)

Installation

  1. Clone the repository:

    git clone https://github.com/pedrol2b/virtual-camera.git
    cd virtual-camera
  2. Install OBS Studio:

    brew install --cask obs

    Or download from obsproject.com

  3. Install OBS NDI Plugin:

    brew install obs-ndi

    See docs/OBS_SETUP.md for detailed instructions.

  4. Open in Xcode:

    open VirtualCamera.xcodeproj
  5. Build and run (⌘R)

🔒 Camera Permissions

The app requires camera access. On first launch, you'll be prompted to grant permission. If denied, enable it in:

System Settings → Privacy & Security → Camera

🎥 Using Virtual Camera Output

Once installed, you can stream your processed video to any application:

  1. Launch VirtualCamera and build/run in Xcode (⌘R)
  2. Click the Settings gear (⚙️) in the top-right
  3. Open the Output section (in settings)
  4. Click "Launch & Connect OBS" - Wait for green checkmark ✓
  5. Toggle "Virtual Camera" ON - OBS Virtual Camera starts automatically
  6. Open your video app (Zoom, Teams, Discord, etc.)
  7. Select "OBS Virtual Camera" as your camera device
  8. Enjoy! 🎉 Your video feed now includes all VirtualCamera effects

🎬 How Virtual Camera Works

VirtualCamera uses a unique approach to provide system-wide camera output without requiring an Apple Developer Program subscription ($99/year).

Why Not Use Camera Extensions?

macOS Camera Extensions (via CoreMediaIO/CMIO) require:

  • Paid Apple Developer Program membership ($99/year)
  • Complex code signing and provisioning
  • System extension installation (security prompts, SIP considerations)

Our Solution: OBS + NDI

Instead, we leverage two industry-standard technologies:

┌─────────────────────┐
│  VirtualCamera App  │ ← Captures video, applies effects
│  (Your Camera)      │
└──────────┬──────────┘
           │
           │ NDI Stream (Network Device Interface)
           │ • Low latency (~16-33ms)
           │ • High quality (1920x1080 @ 30fps)
           │ • Native ARM64 support
           ↓
┌─────────────────────┐
│    OBS Studio       │ ← Receives NDI stream
│  + NDI Plugin       │
└──────────┬──────────┘
           │
           │ Virtual Camera
           │ (System-wide camera device)
           ↓
┌─────────────────────┐
│  Zoom / Teams       │ ← Uses "OBS Virtual Camera"
│  Discord / etc      │
└─────────────────────┘

Benefits of This Approach

  • No subscription required - Free and open-source
  • Universal compatibility - Works with all video apps
  • Professional features - OBS provides advanced streaming capabilities
  • Better performance - NDI is optimized for low-latency video
  • Easier development - No system extensions to debug

Components

  1. VirtualCamera App - Captures and processes video with all effects
  2. NDI (Network Device Interface) - Streams video over IP (even localhost)
  3. OBS Studio - Receives NDI stream and provides Virtual Camera output
  4. OBS NDI Plugin - Enables NDI source input in OBS

🛠️ Technology Stack

  • SwiftUI - Modern, declarative UI framework
  • AVFoundation - Professional camera session management
  • Vision Framework - Advanced hand pose and face detection
  • Combine - Reactive programming for data flow
  • NDI SDK - High-performance video streaming
  • OBS WebSocket - Remote control of OBS Studio
  • Clean Architecture - Maintainable, testable code structure

📚 Documentation

Setup Guides

Technical Documentation

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide to get started.

This project follows Clean Architecture principles—see ARCHITECTURE.md for detailed documentation on project structure and design patterns.

About

A macOS virtual camera built with SwiftUI, AVFoundation & Vision — hand gestures, auto-framing, and NDI streaming support.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Languages