RTSP to WebRTC: Real-Time Browser Playback fo RTSP Cameras and Drones (Update)
Most IP cameras stream live video over the Real-Time Streaming Protocol (RTSP), and so do many enterprise and public safety drone platforms, including drone services and tactical UAS tools. Most consumer and prosumer drones push the Real-Time Messaging Protocol (RTMP) instead, and modern web browsers can’t play RTMP or RTSP on their own. Repackaging the feed into HTTP Live Streaming (HLS) makes it playable, but can result in operators watching events that happened 20 seconds ago or more. Converting RTSP or RTMP to WebRTC in Wowza Streaming Engine delivers the same feed to Chrome, Edge, Firefox, or Safari in under a second, with no plugin or proprietary viewer requirements.
Demand for real-time surveillance continues to grow, with the global video surveillance market projected to reach $83.3 billion in 2028, an almost 10% increase from 2023. Part of this growth comes from public and private organizations recognizing the value that connected cities, building ecosystems, and more have for safety, security, and cost savings. But possibly more significant are the technological advancements that have made the surveillance opportunities we’ve dreamed of a reality.
Surveillance streaming has evolved beyond traditional CCTV cameras and surveillance control rooms to include connected IP cameras, drones, and artificial intelligence (AI), allowing for faster data processing, more accurate predictions for what will happen next in time-sensitive situations, and real-time video delivery to decision-makers in remote locations. These new features and capabilities have shifted the security landscape. Technology like facial recognition, which allows IP cameras to capture an image from a significant distance and run it against a database in real time, is transforming surveillance across every vertical.
But what puts the “real-time” in real-time surveillance? How are we able to make these bold claims about the speed with which this newly enhanced data can be gathered, processed, and delivered? That’s where underlying protocols like RTSP and WebRTC come into play. By converting RTSP and RTMP feeds to WebRTC, Wowza Streaming Engine delivers surveillance footage from cameras and drones to a browser at sub-second speeds.
Why Real-Time Surveillance?
Real-time surveillance data is critical in emergency situations where every second counts. Faster data means faster response times from law enforcement and first responders. As such, real-time crime centers across the United States have been created to aggregate and analyze incoming streams using AI capabilities, like facial recognition, license plate readers, and gunshot detection.
Hazardous work environments, military operations, and even healthcare settings also benefit from advancements in real-time surveillance. AngelEye Health, for example, uses Wowza to deliver around-the-clock patient monitoring to parents of newborns in the NICU. Another Wowza customer uses IP cameras to stream coastlines in real-time. Real-time surveillance can also be used as evidence in court cases, provide peace of mind for homeowners, and be instrumental in flood and wildfire detection.
Real-Time Surveillance Use Case Summary:
- Industrial robots
- Mining operations
- Healthcare monitoring
- Law enforcement crowd control
- Natural disaster detection and response
- Active-shooter situations
- First response video calls
- Courtroom evidence
- Workplace safety
- Traffic management
- Drone inspections
- Emergency response
From sophisticated drones to camera-equipped robots, security capabilities that once only existed in sci-fi films are here and growing at a rapid speed. Innovations in surveillance technology can increase our level of comfort by saving lives, reducing security threats, preventing industrial catastrophes, and sparing businesses from losing millions of dollars.
Advanced Video Surveillance
From real-time analytics to AI and machine learning, are you doing enough to protect your people and property?
What is RTSP?
First developed in a collaboration between RealNetworks, Netscape, and Columbia University back in 1996, the Real-Time Streaming Protocol (RTSP) was designed to create and maintain a connection between raw data sources and streaming servers while also allowing for real-time media manipulation. But let’s take several steps back and unpack why that is significant for a real-time surveillance workflow.
Protocols are sets of rules that govern how data is handled within a given workflow. Different types of protocols manage different steps in this process. For example, a transport protocol (sometimes called a streaming protocol) dictates how data is packaged and sent from one location to another. A security protocol establishes how data is encrypted or otherwise protected. An application layer protocol defines the parameters or commands by which a server and source might communicate.
In an RTSP surveillance workflow, RTSP is the application layer protocol that uses the Real-Time Transport Protocol (RTP) to actually transfer the streaming media. RTP brings the data from the raw source to the server. RTSP gives the server the ability to send commands to the raw source, allowing viewers to pause, play back, and otherwise interact with footage in real time. This unique functionality is what makes RTSP the protocol of choice for IP cameras.
Higher-end enterprise drones are more likely to offer RTSP, while many consumer and prosumer drones push RTMP from their controller apps instead. Wowza Streaming Engine converts RTMP and SRT drone feeds to WebRTC through the same workflow. RTSP typically runs over TCP port 554, and RTSPS, the TLS-encrypted variant, defaults to TCP port 322. Learn more about RTSP: https://www.wowza.com/rtsp.
What is WebRTC?
Web Real Time Communications (WebRTC) is a collection of protocols, standards, and JavaScript APIs that work together to stream data at sub-second speeds. WebRTC came about in 2011, after Google acquired an open-source, browser-based video calling technology that was designed for calls between a few people. It was built for low-latency conversation, not one-to-many broadcasting, so it doesn’t scale to large streaming audiences without extra server infrastructure.
WebRTC is so fast in part because it streams media continuously over UDP instead of downloading and buffering segments of video. Every modern browser plays WebRTC content natively. Basically, WebRTC only needs a webcam and browser to accomplish what other streams need a media server and encoder for.
WebRTC’s strength is also its weakness. These stripped-down peer-to-peer connections lack scalability. Despite not requiring it, WebRTC becomes more scalable and its use cases more varied when paired with streaming infrastructure like media servers and video content delivery networks (CDNs). Even with these additional steps, WebRTC can stream at sub-second speeds. Wowza Streaming Engine’s WebRTC stack supports simulcast, bandwidth estimation, packet-loss recovery (NACK and RTX), ICE restart, and data channels to make browser-based delivery more resilient across varied network conditions. Learn more about WebRTC here: https://www.wowza.com/webrtc.
How Can RTSP and WebRTC Work Together for Real-Time Surveillance?
A single streaming workflow can involve different transport protocols. RTSP (with RTP) is often, but not exclusively, used for ingest (packaging data for delivery from the raw source to the media server) as opposed to egress (delivery from the media server to the end user devices).
Most IP cameras use RTSP by default, including many enterprise drone platforms and UAS tools, but web browsers do not support RTSP natively. That makes viewing a stream challenging unless a media server repackages the feed into a more playback-friendly protocol like HTTP Live Streaming (HLS) or WebRTC for viewing. Unfortunately, RTSP to HLS can result in up to 20 seconds of latency (when not optimized), which is unacceptable for critical surveillance use cases. HLS delivers video in segments, and players buffer several segments before playback starts. A common rule of thumb is to put HLS latency at around three times the segment duration. So, a 6-second segment would add roughly 18 seconds of latency. Learn more about HLS and Low-Latency HLS (LL-HLS) here: https://www.wowza.com/hls.
This is where WebRTC comes in. WebRTC is often used for both ingest and egress without negatively impacting latency. By converting RTSP and RTMP streams to WebRTC, operators keep their existing IP cameras and drones, while gaining real-time speeds.
For the broadest browser compatibility, Wowza recommends H.264 at 720p and 30 frames per second with a Baseline profile, and turning off B-frames on cameras that use Main or High profiles. Low-latency tuning on the camera can help here too. Transcoding, including AAC to Opus audio conversion that WebRTC requires, will add some processing time. This guide to How Latency Affects Streaming Video breaks down where that delay enters a workflow.
How Can Drone Video Stream to a Browser With Ultra-Low Latency?
Most consumer and prosumer drones push RTMP from their flight apps, while higher-end enterprise drones, drone docks, and tactical UAS are more likely to offer RTSP or RTSPS. Neither RTMP nor RTSP plays in a web browser natively, so drone video follows the same workflow as an IP camera feed. A media server repackages the feed as HLS, or it converts the feed to WebRTC for sub-second delivery. Wowza Streaming Engine converts legacy protocols like RTMP, along with RTSP and SRT, to WebRTC, so the same workflow that brings an IP camera feed into a browser can also deliver drone video with ultra-low latency.
Drones that push RTMP publish straight to the live application, while RTSP drones connect through a .stream file like any IP camera. Wowza Streaming Engine can also serve an RTMP drone feed out as RTSP for video management systems (VMS) and analytics tools that only accept RTSP. Our Wowza Streaming Engine guide to ingesting RTSP, SRT, or RTMP streams for WebRTC playback covers these workflows in more detail.
Real-Time Surveillance with Wowza Streaming Engine
Wowza supports on-premises, cloud-based, and hybrid surveillance solutions. Wowza Streaming Engine, Wowza’s flagship media server software, ingests an IP camera stream as RTSP, or a drone stream as RTMP or RTSP, and repackages it into WebRTC for delivery at sub-second speeds. It can run on-premises, air-gapped, in the cloud, at the edge, or in a hybrid deployment. And, a single ingest can feed HLS delivery and a recording simultaneously.
Here is how to configure WebRTC in Wowza Streaming Engine 4.12:
- Configure TLS and enable WebRTC for a live application
- Connect the camera with a .stream file, or publish the drone feed over RTMP
- Transcode AAC audio to Opus for WebRTC playback when the source carries audio
- Play the stream on the WebRTC test page before moving to a production player
WebRTC requires encryption, so the server needs a TLS certificate and WebRTC signaling on its TLS host port before any stream can play. In Wowza Streaming Engine, uncommenting the port 443 example in VHost.xml produces a working TLS port with WebRTC signaling. Read on for the full tutorial.
Connect an RTSP Camera or Drone Feed to Wowza Streaming Engine
Here is how to connect an RTSP camera or drone feed to Wowza Streaming Engine using Wowza Streaming Engine Manager:
- Sign in to Wowza Streaming Engine Manager.
- Click the Applications tab.
- Select the Live Application, and click WebRTC.
- On the General tab, enable WebRTC playback, as well as WHIP and WHEP if the player or encoders will use HTTP signaling.
- Save the settings and restart the application.
- In the Server contents panel, click Stream Files and then click Add Stream File.
- Enter a name for the stream file and the device’s RTSP or RTSPS URL in the Stream URI, then click Add.
Note: The short, descriptive stream file name is required. IP camera and drone manufacturers use proprietary URL syntax, so check the device documentation for the correct RTSP or RTSPS URL. Drones that push RTMP skip the .stream file steps, and instead the flight app publishes to the application’s RTMP URL rtmp://[server-address]:1935/[application-name]/[stream-name]. The stream appears under Incoming Streams once the drone starts streaming.
- Click the Connect icon for the new stream file.
- In the Connect A Stream File dialog box, select the live application and the RTP connection type, then click OK.
- Click Incoming Streams and confirm the stream shows as Active.
Note: Wowza Streaming Engine supports WebRTC simulcast, which relies on publishers that send multiple quality layers. An RTSP camera sends a single stream, and the Wowza Transcoder can still create an adaptive bitrate HLS stream for larger audiences. The camera or drone feed must be reachable from the Wowza Streaming Engine server. Special characters in usernames or passwords can break the RTSP URL, so test the full URL with VLC or ffplay from the server host before connecting it. RTSP uses TCP port 554 by default. RTSPS defaults to TCP port 322. Devices on other ports need the port number in the RTSP URL.
- On the application’s Setup tab, select any additional playback types (like HLS) that the stream needs alongside WebRTC.
- Set the camera to the following settings for the broadest browser compatibility:
- Codec: H.264
- Resolution: 720p
- Frame rate: 30 frames per second
- Profile: Baseline
Modify The Codecs for WebRTC Playback
For WebRTC playback in Wowza Streaming Engine, most camera and drone streams need these codecs:
- Video: H.264 (passthrough in most cases)
- Audio: Opus (transcoded from AAC, only when the source carries audio)
Many surveillance cameras and drones only send video, so those streams can skip the audio transcode entirely. For sources that carry AAC audio, configure the Wowza Transcoder as follows:
- Enable the Wowza Transcoder for the live application.
- Open the transcoder template for the application.
- Add an encode that passes the video through and converts the audio to Opus at 48 kHz in stereo.
- If the video is also transcoded, turn off B-frame generation since the Wowza Transcoder adds B-frames by default as of Wowza Streaming Engine 4.8.14.
- Save the template and restart the application.
Note: Transcoding adds processing time and server load, so passing video through unmodified keeps latency at its lowest. The RTSP ingest for WebRTC documentation includes complete Transcoder examples.
Configure the Hosted WebRTC Playback Page
Wowza provides a hosted WebRTC playback test page for your quick testing before deploying anything to production.
- Open the WebRTC hosted test page (www.wowza.com/developer/webrtc) and press Play.
- Choose WebSocket or WHEP as the playback method.
- In the Signaling URL field, enter the server’s secure WebSocket URL, wss://[ssl-domain]:[ssl-port]/webrtc-session.json.
- For WHEP, enter the HTTPS form of the URL instead.
Note: The URL needs the port number, unless the server is using the default TLS port 443.
- For Application Name, enter the live application’s name.
- For Stream Name, enter the stream file name, including the .stream extension.
Note: Applications protected with a WHEP bearer token or SecureToken need the token entered in the test page’s token fields.
Start the Stream and Play It in a Browser
- Confirm the stream still shows as Active under Incoming Streams in the Wowza Streaming Engine Manager.
- Return to the WebRTC test page.
- Click Play.
Congratulations! The WebRTC stream should now begin on the hosted test page at sub-second latency. To deliver the same RTSP stream over both WebRTC and HLS, enable HLS under the application’s Playback types, and share the HLS playback URL with larger audiences. In Wowza Streaming Engine 4.12 and later, the Application Monitoring page also shows WebRTC connection statistics.
How To Troubleshoot Common RTSP to WebRTC Issues
The issues below come up most often in Wowza support tickets for camera and drone workflows.
Why Does an RTSP Camera Play in VLC but Not in Wowza Streaming Engine?
A camera that plays in VLC on a workstation may still be unreachable from the server, so the first test runs VLC or ffplay from the Wowza Streaming Engine host itself. Some cameras also send ONVIF metadata or other tracks the server can’t parse, and the rtspFilterUnknownTracks property filters them out. Our guide to troubleshooting RTSP and RTSPS restreaming errors walks through the full decision tree.
Why Does a Camera Connect but Send No Video?
Firewalls and NAT devices often block the UDP ports RTP uses for media. Switching the RTPTransportMode setting, or rtpTransportMode in the .stream file, to interleave mode carries the media inside the RTSP TCP connection and resolves most of these cases. Cameras behind NAT can also advertise a private IP address in their SDP, so the DESCRIBE request succeeds, but no media arrives. Wowza Streaming Engine 4.12 adds the rtspIgnoreAdvertisedHost property for this case. Setting it to true makes the server send SETUP and PLAY requests to the host and port in the configured stream URL. On servers that run both RTSP and WebRTC, the 4.12 release notes also advise separate UDP ranges, since both default to ports 6970 to 9999.
Why Does the WebRTC Player Show a Black Screen or Disconnect?
A black screen usually means ICE could not find a working network path between the server and the viewer. WebRTC needs TCP 443 for signaling, UDP 6970 to 9999 for media, and TCP 1935 as a fallback, and the WebRTC workflows guide recommends bypassing deep packet inspection on all three. On networks that block outbound UDP, Wowza Streaming Engine 4.11.3 and later can relay media through a TURN server over TCP or TLS. In Wowza Streaming Engine 4.12, the ICE/Network tab lists the ICE candidates the server gathered, which makes it the first place to check. When UDP drops mid-session, 4.12 also restarts ICE and continues over ICE-TCP instead of closing the session. The ICE documentation covers STUN and TURN setup.
Why Is There Video but No Audio?
Wowza Streaming Engine delivers WebRTC audio in Opus or PCM formats, and most IP cameras that carry audio usually send AAC. Without the AAC-to-Opus transcode described above, the WebRTC stream plays silently. H.264 remains the safest video codec for browsers. Wowza Streaming Engine supports H.264, VP8, and VP9 for WebRTC.
Why Do Drone or Wireless Camera Feeds Stutter or Freeze?
Drone and wireless camera feeds often travel over cellular or wireless backhaul, where packets arrive late or out of order. Enabling the RTP jitter buffer smooths bursty RTSP ingest at the cost of some added delay. On the playback side, Wowza Streaming Engine 4.12 adds NACK and RTX packet-loss recovery, which ship turned off and live on the Advanced/RTP Feedback tab. Turning them on trades a small amount of latency for a steadier picture. The WebRTC configuration reference lists every related property.
What Changes After Upgrading to Wowza Streaming Engine 4.12?
A server that has upgraded from a build older than 4.11 keeps running the legacy WebRTC implementation until an admin updates its VHost.xml and Application.xml files, as the WebRTC upgrade guide explains. WebRTC settings in Wowza Streaming Engine Manager now sit on the General, ICE/Network, Simulcast, and Advanced/RTP Feedback tabs. Wowza Streaming Engine 4.12 also introduces a new password hashing scheme, so rolling back to 4.11 after adding or changing Manager users can lock those users out.
Wowza Streaming Engine 4.12 validates SecureToken on WebRTC publish and playback sessions, and rejects any session with a missing, invalid, or expired token.
Frequently Asked Questions
Do web browsers support RTSP natively?
Web browsers do not support RTSP natively. Chrome, Edge, Firefox, and Safari need a media server such as Wowza Streaming Engine to convert an RTSP camera or drone stream to WebRTC or HLS before playback. Streaming RTSP in a browser with sub-second latency requires converting it to WebRTC.
What port does RTSP use?
RTSP uses TCP port 554 by default, and RTSPS defaults to TCP port 322. RTP media travels over UDP, and Wowza Streaming Engine uses UDP ports 6970 to 9999 for incoming RTSP/RTP streams by default.
How can an RTSP camera feed reach a browser without a 20-second lag?
An RTSP camera feed reaches a browser without a 20-second lag when a media server converts it to WebRTC instead of HLS. WebRTC skips segment buffering, so Wowza Streaming Engine delivers the feed at sub-second latency.
Can drone video stream to a browser over WebRTC?
Drone video can stream to a browser over WebRTC through a media server. Most consumer and prosumer drones push RTMP, while higher-end enterprise drones often push RTSP or RTSPS. Wowza Streaming Engine ingests either protocol, converts it to WebRTC, and delivers it to any modern browser at sub-second latency.
Can RTMP play in a web browser?
RTMP does not play in modern web browsers. Wowza Streaming Engine can convert an RTMP feed to HLS for broad playback at higher latency, or to WebRTC for sub-second delivery in modern web browsers.
Why is there no audio in WebRTC playback?
WebRTC playback has no audio when the source sends AAC, because Wowza Streaming Engine delivers WebRTC audio in Opus or PCM formats. The Wowza Transcoder converts AAC audio to Opus at 48 kHz to restore sound.
Conclusion: Wowza for Your Security
Most IP cameras and drones, the devices of choice for most surveillance and traffic monitoring operations, send out RTSP and RTMP streams that browsers can’t play. Wowza Streaming Engine, however, converts those streams to WebRTC for real-time playback in a browser or on any device, without the 20-second lag of HLS.
Not sure the RTSP-to-WebRTC workflow above covers all of your real-time surveillance needs? Schedule a free consultation with a member of our team to learn about surveillance, monitoring, and security solutions across our suite of services.