IP camera streaming server: how to stream RTSP cameras to a website
Almost every IP camera gives you an rtsp:// address, and no web browser will
open it. An IP camera streaming media server is the piece that sits
between the two: it pulls the camera on your network and serves it in formats a web page
can play.
Why browsers cannot play your camera
RTSP was designed in the late 1990s for controlling media players on a network. Browser
makers never adopted it, and plug-ins that once played it are long gone. Browsers play
video in exactly three ways today: files and HLS through the
<video> element (with Media Source Extensions), and live WebRTC. So the
camera's stream must be repackaged into one of those.
The pipeline
- Discover. With ONVIF, the server finds cameras on the network (WS-Discovery) and asks each one for its stream address, so you do not have to know every vendor's RTSP URL pattern. Pan-tilt-zoom control comes through the same standard.
- Pull. The server opens RTSP to the camera, usually with RTP over TCP for reliability, and reconnects by itself when the camera reboots or the network drops.
- Repackage. The camera's H.264 video is put into WebRTC packets and HLS segments as is. Only audio typically needs converting, since WebRTC wants Opus and cameras send G.711 or AAC.
- Deliver. Embed the server's player on your page, or give out a watch link, with control over who may watch.
Codecs: what plays where
Security: never port-forward a camera
Opening a camera's RTSP or web port to the internet is how cameras end up on public search engines for exposed devices. Their firmware is rarely updated and default passwords are common. With a streaming server in between:
- Cameras stay on a private network or VLAN, reachable only by the server.
- Camera passwords are stored on the server, never sent to viewers.
- Viewers get a watch link or an embedded player, which you can limit by sign-in, by website, or switch off.
- Everything viewers receive travels over HTTPS and encrypted WebRTC.
How many cameras can one server handle?
When video is only repackaged, the limit is mostly network, not processor: a 1080p camera at 4 Mbps costs 4 Mbps in and 4 Mbps per viewer out. Converting (H.265 to H.264, or extra qualities) is what costs processor. The arithmetic is in how to size a streaming server.
In creekX: choose Find cameras, pick yours, type its password, and it is live, with automatic reconnect, pan-tilt-zoom buttons, recording, watch links and embeds. A camera without ONVIF works from its RTSP address. See IP cameras and the camera guide.
Frequently asked questions
Can a web browser play an RTSP stream directly?
No. No current browser supports RTSP. The stream has to be converted by a server into a format browsers play, such as WebRTC or HLS.
What is the best way to stream an IP camera to a website?
Use a streaming server that pulls the camera over RTSP on the local network and serves WebRTC for low delay with HLS as a fallback, then embed its player on the page. Do not expose the camera itself to the internet.
Do I need to re-encode IP camera video?
Usually not for WebRTC or HLS if the camera sends H.264. H.265 cameras may need converting for browsers that cannot decode it, and audio in G.711 or AAC may need converting to Opus for WebRTC.
What is ONVIF?
An industry standard that lets software discover IP cameras on a network and ask them for their stream addresses and settings, so you do not have to look up each vendor’s RTSP URL format.