Test an RTSP Stream with ffplay
ffplay is the simplest way to verify an RTSP stream works:
Force TCP if UDP drops frames:
Show stream info without playing:
Record RTSP Stream to MP4 with FFmpeg
Use -c copy whenever possible so FFmpeg writes the camera's H.264 or H.265 stream directly without re-encoding.
Convert RTSP to HLS (for Browser Playback)
RTSP does not play directly in browsers, so a common workflow is converting the stream to HLS:
If you want this continuously for many viewers, MediaMTX or go2rtc is usually easier than managing FFmpeg scripts by hand.
Re-stream RTSP with MediaMTX
MediaMTX (formerly rtsp-simple-server) re-publishes one RTSP source to many viewers:
Then viewers connect to: rtsp://localhost:8554/camera1
It also exposes HLS at: http://localhost:8888/camera1/index.m3u8
And WebRTC at: http://localhost:8889/camera1
Tip: For iPhone viewing without FFmpeg, SmartRTSP connects directly to your camera's RTSP URL — no MediaMTX needed.
GStreamer RTSP Commands
GStreamer is the main alternative when you need custom, pipeline-based RTSP processing:
GStreamer is especially common on embedded Linux, Raspberry Pi, Jetson, and hardware-accelerated video pipelines.
FFmpeg vs GStreamer vs MediaMTX — Which to Use?
| Tool | Best For | Complexity | Platform |
|---|---|---|---|
| ffplay | Quick RTSP test | Low | All |
| FFmpeg | Recording, conversion | Medium | All |
| GStreamer | Embedded, pipelines | High | Linux/RPi |
| MediaMTX | Re-streaming, multi-protocol | Medium | All (Docker) |
| go2rtc | Home Assistant, WebRTC | Low | All |
| SmartRTSP | iPhone/Mac live view | Very Low | iOS/macOS |
View RTSP on iPhone Without FFmpeg
FFmpeg is powerful, but it requires a desktop or server. If you just want to watch an RTSP camera on iPhone or Mac, SmartRTSP is much simpler.
- No command line needed
- Supports H.264 and H.265 hardware decoding
- ONVIF auto-discovery
- Free download
FFmpeg RTSP FAQ
How do I test an RTSP stream with FFmpeg?
Use ffplay -rtsp_transport tcp rtsp://user:pass@IP:554/stream. It opens the stream in a player window immediately.
How do I record an RTSP stream with FFmpeg?
Run ffmpeg -rtsp_transport tcp -i rtsp://user:pass@IP/stream -c copy output.mp4 to save the camera stream directly to MP4.
What is MediaMTX?
MediaMTX is an open-source media server that can receive an RTSP stream and re-publish it as RTSP, HLS, WebRTC, or RTMP.
Can I view RTSP on iPhone without FFmpeg?
Yes — SmartRTSP connects directly to RTSP cameras on iPhone and Mac with no computer required.