Skip to main content
network switch cabinet rack IP cameras cabling

RTSP and ONVIF Explained: Connecting Analytics to Your IP Cameras and NVR

CountPort Team · · 10 min read

If you want to add people counting to cameras you already own, two acronyms keep coming up: RTSP and ONVIF. Understanding RTSP and ONVIF for people counting is the difference between a smooth rollout and a confusing afternoon on the phone with IT. The concepts are simple once you see what each one does.

This guide explains both in plain English. You will learn how counting software reads a feed off a camera or an NVR, how to find your stream URL, and the network checks your IT team should run before anything goes live.

No new cabling, no firmware flashing, no hardware swaps. If your camera or recorder can hand over a video stream, software can read it and count from it.

Key takeaways

  • RTSP carries the video. ONVIF is a standard that helps devices discover and talk to each other, including handing over the RTSP stream URL.
  • If your camera or NVR exposes an RTSP stream, counting software can read it without new hardware.
  • Test the stream in VLC first, then confirm port 554 is reachable and the analytics computer sits on the right network.
  • Video is analysed on-site only. Nothing is streamed to the internet or stored as footage.

RTSP and ONVIF in one minute

RTSP stands for Real Time Streaming Protocol. It carries the actual video frames from your camera to whatever is watching. When a player or a piece of software shows you a live feed, RTSP is usually moving those frames across the network.

ONVIF is different. It is a standard that lets cameras, recorders, and software discover each other and agree on settings. Think of it as a shared language for setup, not the video itself. ONVIF does not carry frames. It helps a device find a camera and ask, in effect, "where is your stream?"

The two work together. ONVIF helps you discover the camera and hand over the RTSP stream URL. RTSP then delivers the frames. If you already know the URL, you can use RTSP on its own.

Why does this matter for analytics? The rule is simple. If software can read the RTSP stream, it can count from it. The camera brand, the resolution, and the recorder behind it matter far less than one question: does it expose a stream you can open?

How counting software reads a camera or NVR feed

The software opens the RTSP stream the same way a player like VLC does. It connects to the camera, pulls the live frames, and analyses them on the machine where it runs. That machine can be a back-office PC, a mini-PC, or a Mac Mini in the cabinet. The analysis happens right there, on-site.

You have two common sources for that stream:

  • A single camera. The software connects straight to the camera's IP address and reads its stream. This is the simplest path and gives you direct control over resolution and frame rate.
  • A channel off an NVR or recorder. Many recorders expose an RTSP channel per camera, so the software reads that channel instead. This is handy when cameras are not directly reachable but the recorder is.

On those frames, the software does body-only detection. It looks for the shape and movement of people, counts them as they cross a line or fill a zone, and discards the frame. No footage is stored, and nothing is sent off the network. There is no facial recognition. For the longer view on where processing happens and why, our guide to on-premise versus cloud video analytics walks through the trade-offs.

One practical choice is the main stream versus the sub-stream. The main stream is full resolution; the sub-stream is a lighter, lower-resolution copy. Counting does not need huge resolution, but it does need a steady frame rate and enough detail to separate people in the scene. In most setups, a clean stream at a moderate resolution and a stable frame rate beats a high-resolution feed that stutters.

Finding your RTSP URL and credentials

Before any software touches the camera, you need its RTSP URL and a login. There are three reliable places to look:

  • The manufacturer's documentation. Most brands publish the exact RTSP path. Search the model number plus "RTSP URL."
  • ONVIF Device Manager. A free tool that scans the network, finds ONVIF cameras, and shows the stream URL it discovers. It is the fastest way when you are not sure of the path.
  • The camera's own settings page. Log into the camera in a browser and look under the network or streaming section.

Anatomy of an RTSP URL

A typical RTSP URL has a few parts:

rtsp://username:password@192.168.1.64:554/Streaming/Channels/101

  • rtsp:// tells the software which protocol to use.
  • username:password are the camera credentials.
  • 192.168.1.64 is the camera's IP address.
  • 554 is the default RTSP port.
  • /Streaming/Channels/101 is the stream path. It varies by brand and tells the camera which stream you want.

Test in VLC first

Before connecting anything else, paste the URL into VLC (Media, then Open Network Stream) and press play. If the feed opens, your URL, credentials, and network path all work. If it does not, you have found the problem early, before any analytics software is involved.

Use a dedicated camera account

Do not reuse the admin login for the analytics connection. Create a separate, view-only account and give the software that. It keeps the admin credentials private, makes access easy to revoke later, and means an admin password change does not silently break your counting.

Network checks for your IT team

Most connection issues are network issues, not software ones. A short checklist clears the common cases.

Check What to confirm Why it matters
Network reachability The analytics computer shares the cameras' subnet, or is routed to reach them The software cannot read a stream it cannot reach
RTSP port Port 554 (or the camera's RTSP port) is open, not blocked by a firewall A closed port means no stream
Local bandwidth The local network can carry the camera streams the software reads Several feeds at once need headroom on the switch
VLAN access The camera VLAN stays isolated, but the analytics computer can reach it You keep cameras segmented without breaking the connection

A few notes. Reachability is the most common blocker: the computer and cameras have to see each other, on the same subnet or through proper routing. Because processing happens on-site, nothing streams to the internet, so the bandwidth that matters is on your local network, not your internet uplink. Isolating cameras on their own VLAN is good practice and fully compatible with this setup. You add a route that lets the one analytics computer reach the camera VLAN, and nothing else changes.

Common connection problems and fixes

When a stream will not connect, the cause is usually one of a handful of things.

  • Wrong or missing credentials. The most common one. Double-check the username and password, and watch out for the default-login trap: a camera left on its factory login is both a security risk and easy to get wrong once someone changes it. Set a dedicated account and use that.
  • Opens in VLC but not in the software. If VLC plays the feed but your software does not, the network is fine and the issue is in the stream. The usual culprits are the codec, the wrong stream (try the main stream instead of the sub-stream), or the transport. Switching from UDP to TCP often fixes feeds that connect but then freeze or tear.
  • Intermittent drops. A feed that works then disappears points at the physical layer. An overloaded switch, a flaky cable, or a PoE port that cannot deliver steady power shows up as a stream that drops and reconnects. Move the camera to a known-good port to confirm.
  • A non-standard stream path. Some brands use an unusual path that the standard guesses miss. Confirm the exact path in the manufacturer's docs or read it off ONVIF Device Manager, then test that URL in VLC.

If you run Hikvision or Dahua hardware, the path conventions are well documented, and we cover them in adding people counting to Hikvision and Dahua cameras you already own.

Does my camera support this?

The quick test is the one you already know: can it produce an RTSP stream? A camera is a good candidate if it is ONVIF-conformant, exposes RTSP in its settings, or has a documented stream URL. Most IP cameras sold in the last decade tick at least one of those boxes.

Mixed-brand fleets are not a problem. Because the counting runs as pure software reading standard streams, it does not care whether your cameras come from one vendor or five. As long as each camera or recorder hands over a stream it can open, the software treats them the same way. That is a practical advantage of a software-based approach over fixed sensors: you work with what is already on the ceiling.

Very old cameras are the main exception. Analog cameras with no network stream, or models too dated to expose a usable RTSP feed, cannot be read directly. In those cases you have options: read the camera through a newer NVR that does expose RTSP, replace just the cameras in the zones you most want to measure, or focus the rollout on entrances and high-value areas first. Getting the count right also depends on more than the connection. Where the camera points matters too, which is why camera placement for people counting is worth reading alongside this guide.

For the full picture from first stream to live dashboard, our guide to deploying people-counting software on your existing cameras walks through the rollout step by step.

Frequently asked questions

What is the difference between RTSP and ONVIF?

RTSP is a protocol that streams the actual video. ONVIF is a standard that lets devices discover and configure each other, including handing over the RTSP stream URL. ONVIF does not carry video by itself.

How do I find my camera's RTSP URL?

Check the manufacturer's documentation, use a free tool like ONVIF Device Manager, or look in the camera's settings. A typical URL points to the camera IP on port 554 with a stream path and login.

Can analytics read a stream from my NVR instead of the camera?

Often yes. Many recorders expose an RTSP channel per camera, so software can read that channel. Reading directly from the camera is usually simpler and gives you more control over resolution and frame rate.

Does the video leave my network?

No. The software opens the RTSP stream locally and analyses frames on-site. Only anonymous counts go to your dashboard, so the video never leaves the premises.

See it on your own cameras

The fastest way to know whether your cameras are ready is to point the software at one stream and watch it count. We can walk through your setup, check a sample feed, and show you the numbers. Request a demo and we will take it from there.

More from Deployment & Integration