RTSP testing
Use a Mac Camera as an RTSP Test Stream
You can turn the built-in Mac camera or a USB webcam into a local RTSP stream with FFmpeg and MediaMTX. This is useful for testing SmartRTSP, VLC, ONVIF/RTSP workflows, and multi-camera grids without relying on exposed public cameras.
Last updated: July 6, 2026
Quick answer
Install FFmpeg and MediaMTX, list the Mac camera devices, start MediaMTX, then publish the camera to a local URL such as rtsp://127.0.0.1:8554/mac-camera. On another Apple device, replace 127.0.0.1 with the Mac's LAN IP address and open the stream in SmartRTSP.
Safe test source
Use a camera you control instead of random public RTSP URLs.
Local network realism
Test latency, Wi-Fi, codec, and viewer behavior on your actual LAN.
Great for grids
Add it beside real cameras to verify multi-camera layouts.
Setup commands
These commands create a local test stream. Camera indexes vary by Mac, so list devices first.
1. Install FFmpeg and MediaMTX
brew install ffmpeg mediamtx
2. List Mac camera devices
ffmpeg -f avfoundation -list_devices true -i ""
3. Start the local RTSP server
mediamtx
4. Publish the Mac camera to RTSP
ffmpeg -f avfoundation -framerate 30 -i "0" \
-c:v libx264 -preset veryfast -tune zerolatency \
-pix_fmt yuv420p -f rtsp rtsp://127.0.0.1:8554/mac-camera
5. Open the stream in SmartRTSP
rtsp://192.168.1.20:8554/mac-camera
Replace 192.168.1.20 with your Mac's local IP address. Use ipconfig getifaddr en0 for Wi-Fi on many Macs.
When to use this test stream
| Use case | Why it helps | Next step |
|---|---|---|
| Test SmartRTSP before buying cameras | You can validate RTSP playback and grid behavior with hardware you already own. | Add the Mac URL manually. |
| Debug viewer or codec behavior | A controlled local stream removes internet and public-camera variables. | Compare SmartRTSP, VLC, and ffplay. |
| Build a demo camera wall | You can mix one webcam RTSP feed with real ONVIF cameras. | Use substreams for real cameras. |
FAQ
Can I turn a Mac webcam into an RTSP stream?
Yes. FFmpeg can capture the Mac camera, and MediaMTX can serve it as a local RTSP stream.
Is this good for production surveillance?
No. Treat it as a test source. For production monitoring, use a dedicated IP camera with stable power, networking, and RTSP/ONVIF firmware.
Why does the URL work on the Mac but not on iPhone?
Do not use 127.0.0.1 from another device. Use the Mac's LAN IP address and make sure the firewall allows incoming connections.