RTSP URL Generator
Generate RTSP URLs for IP cameras and video streaming with authentication, custom paths, and common device presets
Input
Output
Readme
What is RTSP?
RTSP (Real Time Streaming Protocol) is a network protocol designed for controlling streaming media servers. Unlike HTTP which downloads entire files, RTSP establishes and controls media sessions between endpoints, enabling real-time playback of audio and video content. It's the standard protocol used by IP cameras, surveillance systems, and video encoders to transmit live video feeds over networks.
RTSP typically operates on port 554 (or 322 for secure RTSPS connections) and works alongside RTP (Real-time Transport Protocol) which handles the actual media delivery. The protocol supports commands like PLAY, PAUSE, and TEARDOWN, giving clients control over the media stream.
How do RTSP URLs work?
An RTSP URL follows a specific structure that tells media players how to connect to a stream:
rtsp://[username:password@]host[:port]/path[?query_parameters]- Protocol:
rtsp://for standard orrtsps://for encrypted connections - Authentication: Optional username and password for secured streams
- Host: IP address or hostname of the camera/server
- Port: Network port (defaults to 554 for RTSP, 322 for RTSPS)
- Path: Camera-specific endpoint that identifies the stream
- Query Parameters: Additional options like channel, subtype, or encoding settings
Different camera manufacturers use different path formats, which is why finding the correct URL can be challenging without documentation.
Tool description
This tool generates properly formatted RTSP URLs for IP cameras and streaming devices. It supports both standard RTSP and secure RTSPS protocols, handles URL encoding for special characters in credentials, and includes preset paths for popular camera brands like Hikvision, Dahua, Axis, Foscam, and Sony. The generator also creates ready-to-use commands for VLC media player and FFmpeg.
Examples
Basic camera stream:
- Host:
192.168.1.100 - Path:
/stream - Result:
rtsp://192.168.1.100/stream
Authenticated Hikvision camera:
- Host:
192.168.1.64 - Username:
admin - Password:
camera123 - Path:
/Streaming/Channels/101 - Result:
rtsp://admin:camera123@192.168.1.64/Streaming/Channels/101
Dahua camera with custom port:
- Host:
10.0.0.50 - Port:
8554 - Path:
/cam/realmonitor - Query:
channel=1&subtype=0 - Result:
rtsp://10.0.0.50:8554/cam/realmonitor?channel=1&subtype=0
Features
- Multiple protocols: Support for both RTSP and secure RTSPS connections
- Brand presets: Built-in path templates for Hikvision, Dahua, Axis, Foscam, Sony, and ONVIF-compatible cameras
- Credential encoding: Automatic URL encoding for usernames and passwords containing special characters
- Query parameter builder: Easy addition of custom parameters like channel numbers and stream quality
- Command generation: Auto-generates VLC playback and FFmpeg recording commands
Use cases
- Security system setup: Configure IP cameras for NVR systems or video management software by generating correct connection URLs
- Home automation integration: Create RTSP URLs to add camera feeds to smart home platforms like Home Assistant or Node-RED
- Video recording scripts: Generate FFmpeg commands for scheduled recording or continuous archiving of camera streams
- Remote monitoring: Set up mobile apps or desktop players to view live feeds from IP cameras over local network or VPN
- Troubleshooting connections: Test different URL formats and parameters when diagnosing camera connectivity issues
Common camera path formats
| Brand | Main Stream | Sub Stream |
|---|---|---|
| Hikvision | /Streaming/Channels/101 |
/Streaming/Channels/102 |
| Dahua | /cam/realmonitor?channel=1&subtype=0 |
/cam/realmonitor?channel=1&subtype=1 |
| Axis | /video1 |
/video2 |
| Foscam | /videoMain |
/videoSub |
| Sony | /MediaInput/h264 |
/MediaInput/h264/sub |
| ONVIF | /onvif1 |
/onvif2 |
VLC and FFmpeg usage
The generated commands can be used directly in terminal:
VLC playback:
vlc "rtsp://admin:pass@192.168.1.100/stream"FFmpeg recording:
ffmpeg -i "rtsp://admin:pass@192.168.1.100/stream" -c copy output.mp4FFmpeg with reconnection (for unstable streams):
ffmpeg -rtsp_transport tcp -i "rtsp://admin:pass@192.168.1.100/stream" -c copy output.mp4