All posts

RTSP to HLS: What It Means and Why It Matters

Learn the difference between RTSP and HLS, why browsers can't play RTSP streams directly, and how to convert RTSP to HLS to stream your IP camera on any device.

If you've ever bought an IP camera and tried to view it in a web browser, you've probably hit a wall. The camera works fine in its own app, but getting that video onto a website, a dashboard, or a shared screen? That's where things get complicated — and where understanding RTSP to HLS conversion becomes essential.

This guide breaks down what RTSP and HLS are, why they don't naturally work together, and how converting between them lets you stream your camera feed anywhere.

What Is RTSP?

RTSP stands for Real-Time Streaming Protocol. It's the standard way that IP cameras deliver video over a local network. When you set up a Hikvision, Dahua, Reolink, or almost any other network camera, it exposes an RTSP URL that looks something like this:

rtsp://192.168.1.100:554/stream1

RTSP was designed in the late 1990s for real-time media delivery. It's efficient, low-latency, and works well for its intended purpose: sending a continuous video stream from a camera to a single viewer on the same network.

RTSP's strengths

  • Low latency — typically under one second on a local network
  • Universal camera support — virtually every IP camera speaks RTSP
  • Efficient — sends raw H.264 or H.265 video with minimal overhead

RTSP's limitations

  • No browser support — no modern web browser can play RTSP natively
  • Not firewall-friendly — RTSP uses multiple ports and doesn't traverse NATs easily
  • Single-viewer design — each viewer opens a separate connection to the camera, which can overload cheap hardware

That last point matters more than you'd think. Most consumer IP cameras can only handle 2–4 simultaneous RTSP connections before they start dropping frames or crashing entirely.

What Is HLS?

HLS stands for HTTP Live Streaming. Apple created it in 2009, and it has since become the dominant protocol for video delivery on the web. Every time you watch a live stream on YouTube, Twitch, or a news site, you're almost certainly watching HLS (or its close cousin DASH).

HLS works by breaking a video stream into small files — typically 2–6 second chunks — and serving them over standard HTTP. A playlist file (.m3u8) tells the player which chunks to download and in what order.

Why HLS works everywhere

  • HTTP-based — works through any firewall, CDN, or proxy
  • Browser-native — plays in Safari directly, and in Chrome/Firefox/Edge via hls.js (a tiny JavaScript library)
  • Scalable — one server can serve thousands of viewers because it's just serving files
  • Adaptive bitrate — can automatically adjust quality based on the viewer's connection speed

The tradeoff: latency

Standard HLS has a latency of 10–30 seconds. That's fine for watching a football match, but it's noticeable when you're monitoring a camera. You press a button, and the response appears half a minute later.

Modern variants like Low-Latency HLS (LL-HLS) bring this down to 2–5 seconds, which is acceptable for most surveillance and monitoring use cases. It's not as instant as RTSP on a local network, but it's dramatically better than standard HLS.

RTSP vs HLS: A Quick Comparison

Here's how the two protocols stack up:

RTSP HLS
Designed for Real-time local streaming Web-scale video delivery
Latency < 1 second 2–30 seconds
Browser support None Universal
Firewall traversal Difficult Easy (just HTTP)
Scalability Limited (per-viewer connections) Excellent (CDN-friendly)
Camera support Native Requires conversion

The two protocols complement each other. RTSP is great at getting video out of a camera. HLS is great at getting video into a browser. The missing piece is the conversion layer.

How RTSP to HLS Conversion Works

Converting RTSP to HLS is a process called transcoding (or more precisely, transmuxing when you're just repackaging the video without re-encoding it).

Here's what happens step by step:

  1. Connect to the camera — A server opens an RTSP connection to your camera and starts receiving the raw video stream
  2. Buffer the video — The incoming video frames are collected into small segments (typically 2–6 seconds each)
  3. Package as HLS — Each segment is wrapped in an MPEG-TS or fMP4 container, and a .m3u8 playlist file is generated that references these segments
  4. Serve over HTTP — The segments and playlist are made available via a standard web server, ready for any browser to consume

If the camera's H.264 video is compatible with HLS (which it usually is), this process doesn't require expensive re-encoding. The server is essentially just repackaging the same video data into a different container format — a process called transmuxing. This is lightweight and can run on modest hardware.

Re-encoding is only needed when:
- The camera outputs H.265/HEVC (which has limited browser support)
- You want to reduce bandwidth by lowering the resolution or bitrate
- You need to add overlays like timestamps or watermarks

When Do You Need RTSP to HLS?

You need this conversion whenever you want to do something that RTSP alone can't handle:

Viewing cameras in a browser

This is the most common reason. Whether it's a monitoring dashboard, a public webcam, or a customer-facing live view, browsers need HLS. There's no way around it.

Remote access without a VPN

RTSP doesn't work well over the internet. Port forwarding your camera's RTSP port is a security nightmare. HLS streams can be delivered over HTTPS, with proper authentication, through standard web infrastructure.

Sharing a stream with multiple viewers

Remember that 2–4 viewer limit on most cameras? With HLS, one server pulls a single RTSP stream from the camera and serves it to unlimited viewers. The camera only sees one connection.

Embedding video on a website

If you're building a property listing site, a tourism page, a construction progress dashboard, or any web application that shows live camera feeds, HLS is your only practical option.

Mobile apps and smart TVs

Most modern video players on iOS, Android, and smart TV platforms support HLS natively. It's the lingua franca of video streaming.

The DIY Approach vs. a Managed Service

You can build your own RTSP-to-HLS pipeline. The typical stack involves:

  • FFmpeg to pull the RTSP stream and segment it into HLS
  • Nginx with the RTSP module (or a similar media server) to serve the HLS segments
  • A Linux server running 24/7 to keep it all alive
  • SSL certificates, authentication, and monitoring on top

It works, but it's a project. You'll spend time tuning segment lengths, managing FFmpeg processes that crash when cameras go offline, handling reconnections, setting up HTTPS, and debugging why your stream freezes every few hours.

This is exactly the problem QuickCam was built to solve. You give it your camera's RTSP URL, and it gives you back an HLS stream URL and an embeddable player. No servers to manage, no FFmpeg scripts to babysit. The conversion happens in European data centres, so your camera feed stays within the EU — which matters if you care about GDPR compliance.

Latency: Setting the Right Expectations

If you're coming from a local RTSP setup where video is essentially real-time, HLS will feel slower. Here's what to expect:

  • Standard HLS: 15–30 seconds of delay
  • Low-Latency HLS: 2–5 seconds of delay
  • Local RTSP: under 1 second

For most monitoring, security overview, and public streaming use cases, 2–5 seconds of latency is perfectly fine. You can see what's happening in near-real-time, just not instant real-time.

Where low latency truly matters — like PTZ camera control or two-way audio — you'd typically keep RTSP on the local network for operators while serving HLS to remote or web viewers.

Wrapping Up

RTSP gets video out of your camera. HLS gets it into browsers, phones, and websites. Converting RTSP to HLS bridges that gap, letting you share your camera feeds with anyone, anywhere, on any device.

The conversion process is well-understood and technically straightforward, but running it reliably 24/7 takes effort. Whether you build it yourself or use a service like QuickCam, understanding what's happening under the hood helps you make better decisions about latency, quality, and architecture.

Your cameras already speak RTSP. The web speaks HLS. Now you know how to make them talk to each other.