Through a network switch

Use this guide if you have both PCs plugged into a network switch.

About 6 minutes to read

Use this guide if both PCs are plugged into a network switch and you want to use UDP streaming instead of NDI.

UDP vs NDI: Both are network-based capture methods. NDI is generally easier to set up and more commonly used. UDP gives you more control over bitrate and compression but requires more manual configuration. If you're not sure which to use, try NDI first.

Important: Running UDP through a router (rather than a dedicated switch) can cause bandwidth saturation and game ping spikes. If your PCs are plugged directly into your home router and you experience high ping in-game while streaming, consider using a dedicated network switch between the two PCs, or switch to the NDI Network Switch setup instead.


#Prerequisites

Before starting:

  • Both PCs are connected via Ethernet to the same network switch. Wi-Fi on either PC will cause issues.
  • Windows is fully updated on both PCs.
  • System clocks are synced on both PCs: Settings → Time & Language → Date & Time → Sync now.
  • You know your Script PC's IP address. Open Command Prompt on the Script PC and run ipconfig — note the IPv4 address (e.g., 192.168.1.11).

Open PowerShell as admin on both PCs and run:

Get-NetAdapter | Select-Object Name, Status, LinkSpeed

Both Ethernet adapters must show 1 Gbps or higher. UDP streaming at high bitrates can saturate slower links.


#Step 1: Install OBS (Gaming PC Only)

Everything in this section is installed on the Gaming PC.

Download and install OBS Studio.

No additional plugins needed. Unlike NDI, UDP streaming uses OBS's built-in FFmpeg output. You don't need DistroAV or NDI Runtime.


#Step 2: Configure OBS (Gaming PC)

#Video Settings

Navigate to Settings → Video and set:

  • Base (Canvas) Resolution and Output (Scaled) Resolution to the same value:
    • 800x600 — lowest bandwidth, works for most games
    • 1024x768 — good middle ground
    • 1280x720 — highest fidelity of the three
  • FPS: Set to Fractional FPS, at least 80/1. Ideal is 240/1.

Your in-game resolution doesn't affect this. OBS captures and scales independently.

#Advanced Settings

Navigate to Settings → Advanced and set:

  • Color Format: NV12

#Recording Output (This Is Your UDP Stream)

UDP streaming uses OBS's Recording output, not the regular streaming feature. This is the part people find unintuitive — you'll click "Start Recording" to begin the UDP stream.

Navigate to Settings → Output → Recording and configure:

  1. At the top, change Output Mode to Advanced.

  2. Set Type to Custom Output (FFmpeg).

  3. Set FFmpeg Output Type to Output to URL.

  4. Set File path or URL to:

    udp://SCRIPT_PC_IP:PORT

    Replace SCRIPT_PC_IP with your Script PC's actual IP address, and PORT with any port number you choose.

    Example: udp://192.168.1.11:1234

    The port can be any number you want (e.g., 1234, 2341, 5000). Just remember it — you'll need the same port on the Script PC side.

  5. Set Container Format to mpjpeg.

  6. Set Video Bitrate — start with 50000 Kbps and adjust from there:

    • Lower bitrate (10000–30000 Kbps) = more compression, less bandwidth used, more image artifacts
    • Medium bitrate (30000–80000 Kbps) = good balance for most setups
    • Higher bitrate (80000–150000 Kbps) = cleaner image, but more bandwidth and potentially more lag if your network can't keep up
    • If you're on a 1 Gbps link, stay under ~80000 Kbps to leave headroom for game traffic.
  7. Set Keyframe interval to 0.

  8. Set Video Encoder to mjpeg (MJPEG - Motion JPEG) — this should be the default encoder.

#Game Capture Source

  1. In the Sources panel, click + and select Game Capture.
  2. Set Mode to Capture Specific Window and select your game (must be open).
  3. Select the Game Capture source in Sources, then press Ctrl + D to center it.

#Disable Preview and Start the Stream

  1. Right-click on the OBS preview area and select the option to disable the preview to reduce GPU usage.
  2. Click "Start Recording" to begin the UDP stream.

Yes, it says "Recording." OBS doesn't have a separate UDP stream button. The recording output is configured to send to a UDP URL instead of a file, so "Start Recording" is what starts the stream. You must click this every time you want to begin streaming to the Script PC.


#Step 3: Configure the Application (Script PC)

On your Script PC:

  1. Set Capture Mode to UDP in the capture tab.
  2. Enter the same port number you configured in OBS (e.g., 1234).
  3. Load a community config — don't use the default config. Make sure it's set to UDP mode.
  4. Press Start.

If the capture isn't working, make sure you clicked "Start Recording" in OBS on the Gaming PC first.


#Troubleshooting

#Stream not connecting / no capture

1. Did you click "Start Recording" in OBS? This is the most common miss. The UDP stream doesn't start until you click this button. Check the bottom of OBS — it should show a recording timer if the stream is active.

2. Verify network connectivity. Open Command Prompt on the Script PC and ping the Gaming PC:

ping 192.168.1.10

If this fails, your PCs aren't communicating over the network.

3. Firewall whitelisting. On the Gaming PC, whitelist obs64.exe for both Private and Public networks. On the Script PC, whitelist the application exe for both Private and Public networks.

To whitelist:

  1. Press Win + R, type firewall.cpl, press Enter.
  2. Click Allow an app or feature through Windows Defender Firewall.
  3. Click Change settings, then Allow another app.
  4. Browse to the exe and add it. Check both Private and Public.

Keep the firewall on and whitelist. Don't just disable it — that can cause more problems than it solves.

4. Check the port. Make sure the port in your OBS URL matches the port configured in the application's capture settings. A mismatched port means the stream goes nowhere.

5. Set network to Private. On both PCs:

  • Windows 10: Settings → Network & Internet → Status → Change connection properties → Private.
  • Windows 11: Settings → Network & Internet → Ethernet → click connection → Private.

6. Install .NET Runtime. Download from https://dotnet.microsoft.com/en-us/download, install, restart.

#Lag, stuttering, or frame drops

Lower the bitrate. If you set bitrate too high for your network to handle, frames will drop. Try reducing to 30000–50000 Kbps and see if stability improves.

Check link speed. Run the PowerShell command from Prerequisites — both adapters must be 1 Gbps+.

Router vs switch. If both PCs are plugged directly into your home router (not a separate switch), the router may be the bottleneck. UDP streaming through a router has been confirmed to cause bandwidth issues and high in-game ping. Use a dedicated network switch or consider switching to NDI.

#Game ping spikes while streaming

This usually means the UDP stream is consuming too much bandwidth on a shared link. Solutions:

  1. Lower OBS bitrate — reduce until game ping stabilizes.
  2. Lower OBS resolution and/or FPS — less data to send.
  3. Use a dedicated network switch instead of your router.
  4. Verify both PCs are on Ethernet — if either is on Wi-Fi, that's your bottleneck.

#Full restart procedure

  1. Close OBS and the application on both PCs.
  2. Shut down both PCs completely.
  3. Power cycle the switch/router (unplug for 10 seconds).
  4. Start the Gaming PC first. Open OBS, verify settings, click "Start Recording."
  5. Start the Script PC. Launch the application, set capture to UDP with the correct port, press Start.

#Quick Reference

SettingLocationValue
OBS ResolutionSettings → Video800x600, 1024x768, or 1280x720
OBS FPSSettings → Video80/1 to 240/1 (fractional)
Color FormatSettings → AdvancedNV12
Output ModeSettings → Output → RecordingAdvanced
TypeSettings → Output → RecordingCustom Output (FFmpeg)
FFmpeg Output TypeSettings → Output → RecordingOutput to URL
File path or URLSettings → Output → Recordingudp://SCRIPT_PC_IP:PORT
Container FormatSettings → Output → Recordingmpjpeg
Video BitrateSettings → Output → Recording50000 Kbps (adjust as needed)
Keyframe intervalSettings → Output → Recording0
Video EncoderSettings → Output → Recordingmjpeg (MJPEG)
Start streamOBS main windowClick "Start Recording"

Stuck on a step? Ask in the Moonlight Discord and a staff member will help.