Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📡 WebRTC Phone-to-OBS Camera Streamer

License: MIT Python Version WebRTC

Turn your mobile phone (iPhone or Android) into a high-quality, ultra-low latency wireless camera feed for OBS Studio – no external application installations or account creations required.


💡 How It Works

Chromium browsers (used inside OBS Studio's Browser Sources) block secure features like WebRTC when loaded over self-signed HTTPS certificates. At the same time, mobile browsers require secure HTTPS contexts (getUserMedia) to access the physical cameras.

This project solves this dilemma using a Dual-Port HTTP/HTTPS Server architecture:

flowchart TD
    subgraph PC ["PC Host"]
        DB[Control Dashboard<br>http://localhost:8001]
        OBS[OBS Browser Source<br>http://localhost:8001/obs]
        Srv[Dual-Port Python Server]
    end

    subgraph Phone ["Mobile Phone"]
        Cam[Phone Camera Page<br>https://IP:8000/camera]
    end

    %% Signaling
    Cam -- 1. Sends SDP Offer / ICE Candidates (HTTPS:8000) --> Srv
    OBS -- 2. Polls Offer & Responds with Answer (HTTP:8001) --> Srv
    
    %% Direct WebRTC
    Cam <== 3. Peer-to-Peer WebRTC Stream (Low Latency) ==> OBS
Loading
  1. Port 8000 (HTTPS): Runs over secure SSL so that mobile browsers allow camera access. The phone loads the page and captures the camera stream.
  2. Port 8001 (HTTP): Runs over plain HTTP for OBS Studio. Since it is loaded from localhost, Chromium considers it a secure context and allows WebRTC without certificate checks.
  3. Both ports share the signaling state in memory, establishing a direct WebRTC stream between your phone and OBS.

🚀 Quick Start

Prerequisites

  • Python 3.7+ installed.
  • PC and Phone must be connected to the same Wi-Fi network.

Running the App

  1. Clone this repository to your PC.
  2. Double-click the start.bat file. (This script automatically installs the required cryptography library, generates local SSL certificates, and starts the server).
  3. Open your PC browser at http://localhost:8001 to access the Control Dashboard.

📱 Connection Guide

Step 1: Open the Phone Camera

  1. Scan the QR Code displayed on the PC Dashboard (or enter the generated link, e.g., https://<PC-IP>:8000/camera).
  2. Accept the self-signed SSL warning on your phone (see SSL Bypass Guide below).
  3. Allow camera/microphone access permissions.
  4. Press the green Start Stream button.

Step 2: Add Browser Source to OBS

  1. Copy the OBS Browser Source URL from the PC Dashboard (http://localhost:8001/obs).
  2. In OBS Studio, click + in the Sources panel, and select Browser.
  3. Paste the URL into the URL field.
  4. Set Width: 1920 and Height: 1080 (or switch them for portrait mode).
  5. Click OK. The low-latency camera stream will appear instantly!

🔒 SSL Bypass Guide (First-Time Setup)

Because the SSL certificates are generated locally on your PC, mobile browsers will show a privacy warning. You must bypass this once:

  • iOS (Safari):
    1. Tap Show Details at the bottom of the warning screen.
    2. Tap "visit this website" at the bottom.
    3. Tap Visit Website and verify using your passcode or Face ID.
  • Android (Chrome / Samsung Internet):
    1. Tap the Advanced button.
    2. Tap "Proceed to (unsafe)" at the bottom.

⚙️ Configuration (Command Line)

You can customize the ports by running server.py directly from your command line:

python server.py --https-port 9000 --http-port 9001

Options:

  • --https-port: Port for the secure camera input (Default: 8000)
  • --http-port: Port for the plain OBS Browser Source / Dashboard (Default: 8001)

📄 License

This project is open-source software licensed under the MIT License.

About

Turn your smartphone into a high-quality wireless camera for OBS Studio. OBScm is a lightweight, free, and easy-to-use application that lets you stream your phone's camera directly to OBS over Wi-Fi. No cables, no complicated setup, and no watermarks. Just connect your phone and PC to the same network and start streaming in seconds.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages