How IP Cameras Stream Video: RTSP and ONVIF

An IP camera looks simple from the outside: a lens, a cable, and a small blinking light. Inside, it’s a small networked computer that captures images, compresses them into video, and sends that video across a network to whoever is allowed to watch or record it.

If you understand how IP addresses and ports work, you already know half of how security cameras communicate. This tutorial covers the other half: the two standards that make IP cameras work with recorders, apps, and cloud platforms. They are RTSP and ONVIF.

What is an IP camera (and how is it different from analog CCTV)?


Older closed-circuit television (CCTV) systems used analog cameras. Each camera sent an analog video signal over a coaxial cable to a DVR (digital video recorder), which converted it to digital and stored it.

An IP camera works differently:

  • It converts the image to digital video inside the camera.
  • It has its own IP address, just like a laptop or phone on the network.
  • It sends compressed video as network packets over Ethernet or Wi-Fi.
  • Many IP cameras are powered over the same Ethernet cable using PoE (Power over Ethernet).

Because an IP camera is a network device, anything else on the network can talk to it if it knows the right address, port, and protocol and has the right credentials.

What is RTSP, and how does a live stream travel over the network?


RTSP stands for Real-Time Streaming Protocol. Think of it as a remote control for a video stream. A client (a recorder, a media player like VLC, or a cloud platform) uses RTSP to ask the camera to start, pause, or stop sending video.

Here’s what happens step by step when a recorder connects to a camera:

  1. Connect. The client opens a connection to the camera’s IP address on the RTSP port. The default RTSP port is 554.
  2. DESCRIBE. The client asks, “What streams do you have?” The camera replies with details such as the video codec (for example, H.264 or H.265) and resolution.
  3. SETUP. The client and camera agree on how the video packets will be delivered.
  4. PLAY. The camera starts sending video. The actual video data usually travels using RTP (Real-time Transport Protocol), while RTSP keeps managing the session.
  5. TEARDOWN. When the client is done, it ends the session.

A useful way to remember it: RTSP is the conversation, RTP carries the video.

Why video compression matters

Raw video is huge. A camera compresses it using a codec before sending it. The two most common codecs in IP cameras are H.264 and H.265. H.265 produces smaller files at similar quality, which saves bandwidth and storage, but it needs more processing power to decode.

Anatomy of an RTSP URL (with an example)

To connect to a camera’s stream, you need its RTSP URL. The exact path differs by manufacturer, but the structure is always similar:
rtsp://username:password@192.168.1.64:554/stream1

PartExampleMeaning
Schemertsp://Tells the client to use the RTSP protocol.
Credentialsusername:password@The camera login (never leave the factory default).
IP address192.168.1.64The camera’s address on the local network.
Port:554The default RTSP port.
Path/stream1Which stream to play; set by the manufacturer.

Many cameras offer two streams: a main stream in high resolution for recording and a sub-stream in lower resolution for live viewing on phones or for running analytics with less bandwidth.

Try it yourself: If you have an IP camera on your home or lab network, open VLC Media Player, go to Media → Open Network Stream, and paste the camera’s RTSP URL. If the address, port, path, and credentials are correct, the live video will play.

What is ONVIF? Profiles S, T, G and M


RTSP tells you how to stream video. But how does a recorder find cameras on the network, learn their RTSP URLs, or control a camera’s zoom?

Every manufacturer could invent its own method, and in the early days they did. That’s the problem ONVIF solves.

ONVIF (Open Network Video Interface Forum) is an industry standard that defines a common way for IP security devices to talk to each other. It uses web services, so devices exchange structured messages over HTTP. With ONVIF, a recorder can:

  • Discover cameras on the local network automatically
  • Ask each camera for its RTSP stream addresses and capabilities
  • Configure settings such as resolution and frame rate
  • Control pan-tilt-zoom (PTZ) cameras
  • Receive events, such as motion detection

ONVIF groups features into profiles. A device that claims a profile supports that set of features:

ProfileWhat it covers
Profile SBasic video streaming, PTZ control and simple events
Profile TAdvanced streaming, including H.265, plus richer events
Profile GRecording and storage on the device (edge storage) and playback
Profile MMetadata and analytics, such as object detection results

RTSP vs ONVIF: how they work together


Beginners often ask which one is better. That’s the wrong question, because they do different jobs:

RTSPONVIF
Main jobControls the live video streamDiscovers, configures, and controls devices
AnalogyPlay, pause, and stop buttons for one streamChannel guide and settings menu for the whole camera
Can work alone?Yes, if you already know the stream URLNo, it points clients to RTSP streams for video

In a typical setup, a recorder uses ONVIF to find the camera and ask for its stream address, then uses RTSP to actually pull the video. This is why most modern IP cameras support both.

Because both standards are open, software from one company can record cameras from another. Some cloud video platforms are designed around this idea.

For a real-world example, Coram’s guide to ONVIF and RTSP explained how its system connects to existing IP cameras by pointing at each camera’s RTSP URL, as long as the camera provides an RTSP stream in H.264 or H.265.

NVR vs DVR vs cloud: where the video ends up


Once video leaves the camera, it needs somewhere to be stored and watched.

  • DVR (Digital Video Recorder): Works with analog cameras. It digitizes and records the analog signal coming over coaxial cable.
  • NVR (Network Video Recorder): Works with IP cameras. It receives already-digital video over the network, usually via RTSP, and stores it on hard drives.
  • Cloud platform: Video is managed through the internet, and sometimes stored there. Many modern systems are hybrid: a small on-site device records locally and handles heavy processing, while viewing, alerts and user management happen through the cloud.

Here’s the full path of a single frame of video in a hybrid setup:

Camera (captures + compresses H.264/H.265)
   → local network (RTP packets, controlled by RTSP)
      → on-site recorder (stores video, may run AI analysis)
         → cloud (secure outbound connection for remote viewing and alerts)
            → web browser or mobile app

Camera security basics every beginner should know


An IP camera is a computer on your network, so it needs the same care as any other device. Poorly secured cameras have been used in large botnets in the past.

  1. Change default passwords immediately. Default credentials are publicly listed online.
  2. Update firmware regularly to patch known vulnerabilities.
  3. Never forward port 554 (or the camera’s web port) directly to the internet. Anyone who finds it can try to log in.
  4. Put cameras on a separate network or VLAN so a compromised camera can’t reach your other devices.
  5. Prefer systems that make outbound connections for remote viewing instead of requiring open inbound ports.
  6. Disable services you don’t use, such as UPnP or unused protocols.

FAQs

What port does RTSP use?

The default RTSP port is 554. Some cameras let you change it, and the video data itself often travels over separate RTP ports.

Can I view an RTSP stream in a browser?

Not directly. Most browsers don’t play RTSP natively. You can use a media player like VLC, or a recorder or platform that converts the stream into a browser-friendly format.

Do all IP cameras support ONVIF?

Most business-grade IP cameras do, but not all, and not every camera supports every profile. Check the camera’s datasheet for the ONVIF profiles it supports.

Is ONVIF the same as RTSP?

No. ONVIF handles discovery, configuration, and control. RTSP handles the live video stream. Most systems use both together.

What is the difference between H.264 and H.265?

Both are video compression codecs. H.265 can deliver similar quality at a smaller file size, saving bandwidth and storage, but it needs more processing power to decode.

Conclusion

IP cameras are networked computers that speak open standards. RTSP manages the live video session, RTP carries the packets, and ONVIF lets devices from different makers find and control each other.

Once you understand these three pieces, you can connect a camera to VLC, choose between an NVR and a cloud system, and secure your setup properly. That’s the foundation behind every modern video security system.

DEEPAK GUPTA

DEEPAK GUPTA

Deepak Gupta is the Founder of Scientech Easy, a Full Stack Developer, and a passionate coding educator with 8+ years of professional experience in Java, Python, web development, and core computer science subjects. With strong expertise in full-stack development, he provides hands-on training in programming languages and in-demand technologies at the Scientech Easy Institute, Dhanbad.

He regularly publishes in-depth tutorials, practical coding examples, and high-quality learning resources for both beginners and working professionals. Every article is carefully researched, technically reviewed, and regularly updated to ensure accuracy, clarity, and real-world relevance, helping learners build job-ready skills with confidence.