Skip to content

Latest commit

 

History

History
122 lines (87 loc) · 3.92 KB

File metadata and controls

122 lines (87 loc) · 3.92 KB

iPhone Camera Streamer

A Windows application that streams your iPhone camera to your PC, integrates headless OBS VirtualCam output, and wraps everything in a single WinForms UI with debug logging, tray support, and self-signed certificate generation.


Features

  • WebSocket-based video stream from browser (publisher) to embedded WebView2 (subscriber).

  • Headless OBS integration:

    • Automatically launches OBS minimized to tray
    • Switches to a pre-configured profile & scene
    • Starts/stops the VirtualCam output
  • Security:

    • HTTP (port 8080) and HTTPS (port 8443) endpoints
    • On-demand self-signed certificate generation (Generate Cert button)
  • User interface:

    • Embedded browser (WebView2) for live video feed
    • Debug log panel for real-time status messages
    • Buttons for Reload, Run in Tray, Cleanup, and Generate Cert
  • Tray integration:

    • Minimize to Windows notification area
    • Context menu: Open & Exit

Getting Started

Prerequisites

  1. .NET 6+ SDK (or .NET 7) installed on Windows.
  2. OBS Studio (version ≥ 29) installed in C:\Program Files\obs-studio\bin\64bit\obs64.exe.
  3. OBS-WebSocket plugin (if using OBS < 28, otherwise OBS 28+ has built-in WebSocket). Ensure it's enabled at port 4455. No password is required by default.
  4. WebView2 Runtime installed (for embedded browser).

Clone & Build

git clone https://github.com/WilleLX1/IphoneCameraStreamer.git
cd IphoneCameraStreamer
dotnet build -c Release

Manual Configuration

Some settings must be adjusted in code or via UI until a settings panel is implemented:

  1. OBS Executable Path & Working Directory

    • In ObsHeadlessLauncher.cs, verify:

      private const string ObsExePath    = "C:\\Program Files\\obs-studio\\bin\\64bit\\obs64.exe";
      private const string ObsWorkingDir = "C:\\Program Files\\obs-studio\\bin\\64bit";
  2. OBS Profile & Scene

    • Ensure you have an OBS Profile and Scene Collection named iPhoneCam
    • In ObsHeadlessLauncher.cs CLI args: --profile "iPhoneCam" --collection "iPhoneCam"
  3. OBS-WebSocket Port & Password

    • Default port: 4455. Change in ObsHeadlessLauncher.cs constructor if needed.
    • Leave password blank or set one in OBS Settings → WebSocket.
  4. HTTPS Certificate & Password

    • The app will generate cert.pfx in the EXE directory with default password changeit via Generate Cert button.

    • To use your own cert, drop cert.pfx alongside the EXE and update the password in Program.cs:

      options.Listen(IPAddress.Any, 8443, opts => opts.UseHttps("cert.pfx", "yourpassword"));
  5. Firewall Rules

    • Open inbound ports 8080, 8443, and 4455 in Windows Firewall if streaming or OBS control across the LAN.

Usage

  1. Run the application (.\bin\Debug\net6.0-windows\IphoneRemoteCamera.exe).
  2. Generate Cert (only on first run) to create cert.pfx.
  3. Click Reload to launch/refresh headless OBS and VirtualCam.
  4. Click Run in Tray to minimize the UI.
  5. To stop and clean up, click Cleanup (kills OBS and exits).
  6. Use Open or double-click the tray icon to restore the window.

Folder Structure

IphoneRemoteCamera/
├─ wwwroot/
│  ├─ index.html
│  ├─ result.html      # subscriber page
│  ├─ publisher.js     # camera publish logic
│  ├─ subscriber.js    # subscriber render logic
│  └─ style.css
├─ ObsHeadlessLauncher.cs
├─ Program.cs
├─ WebSocketHandler.cs
├─ Form1.cs
├─ Form1.Designer.cs
└─ README.md

Future Enhancements

  • Add a Settings panel (or external JSON config) to avoid code edits.
  • Automate trusted root store import for the generated cert.
  • Replace JPEG-over-WS with WebRTC or NDI for lower latency.
  • Implement structured logging and health-checks.

Enjoy your iPhone-to-PC streaming!