Stream Desktop Screen or Windows to NVR

Use the ONVIF RTSP Server to stream your desktop screens or application windows directly to an NVR device via the ONVIF protocol.

1.Modify the Configuration File

Edit the default configuration file onvif.cfg and configure the <stream_uri> within the <profile> section.

To stream your entire desktop screen:

<profile>
  ...
  <stream_uri append_params="1">rtsp://YOUR_IP:554/screenlive</stream_uri>
</profile>

To stream a specific application window:

<profile>
  ...
  <stream_uri append_params="1">rtsp://YOUR_IP:554/window=windowtitle</stream_uri>
</profile>

Replace windowtitle with the exact title of the application window you want to capture. Run onvifrtspserver -l window to list all valid window titles.

Change YOUR_IP to your PC's IP address. The RTSP port (default: 554) should match the <server_port> value in your rtsp.cfg file.

The default onvif.cfg contains 2 profiles. Modify both <stream_uri> entries to rtsp://YOUR_IP:554/screenlive to stream the desktop to two separate streams on your NVR.

For multiple displays: Stream different monitors by adding an index after screenlive (index starts from 0).

rtsp://192.168.3.36:554/screenlive0  
rtsp://192.168.3.36:554/screenlive1  

2.Delete Runtime Configuration (If Present)

If a runtime configuration file named onvifrun.cfg exists in the directory, delete it to ensure the server loads your modified settings.

3.Launch the ONVIF RTSP Server

Run the onvifrtspserver executable.

4.Add the Device to Your NVR

Add the simulated camera to your NVR system.

  • Automatic Discovery: Use the NVR's device discovery feature.
  • Manual Addition: Manually add the device using its IP address.

Navigate to the NVR's preview page to view your real-time desktop screen or application window.

On Windows, screen or window capture will display a yellow border. To disable this, rename wgcapture.dll in the server directory and restart the server. This forces the use of GDI capture, which cannot capture D3D-rendered applications (e.g., most games).