RTSP stream buffering, stuttering or lagging?
Try the camera’s lower-bitrate sub-stream on the same local network. If it plays smoothly while the main stream stutters, check the camera bitrate and available bandwidth. If both stutter, try the same stream on another device or over a wired connection.
Isolate the source of the lag
- Slow start. If playback is smooth after the first frame, time how long the same stream takes to start in another player on the same network.
- Repeated freezes. Test one camera at a time. If the sub-stream helps, lower the main stream bitrate or frame rate and compare again.
- Smooth but delayed video. Check the player’s buffer settings and compare another player on the same network.
Measure live video delay
Put a running stopwatch where the camera can see it. Compare the time on the stopwatch with the time shown in the player. The difference is the approximate live delay.
Check both the main stream and the sub-stream on the same viewer and network. If the picture also freezes, note how often it freezes and how long it takes to resume.
Compare TCP and UDP on the same RTSP stream
Replace the example URL with your RTSP address. Run these commands one at a time with the same URL, device and network. A rising frame count means FFmpeg is decoding video.
TCP
ffmpeg -nostdin -hide_banner -xerror -rtsp_transport tcp -timeout 5000000 -i "rtsp://CAMERA_IP:PORT/PATH" -t 10 -map 0:v:0 -map "0:a:0?" -f null -
UDP
ffmpeg -nostdin -hide_banner -xerror -rtsp_transport udp -timeout 5000000 -i "rtsp://CAMERA_IP:PORT/PATH" -t 10 -map 0:v:0 -map "0:a:0?" -f null -
- One test returns 461
- The camera or recorder rejected that transport. Use the working option and check the device’s supported settings.
- UDP starts, then freezes
- Repeat the comparison over a wired connection if available. Check the local path between the camera and player for packet loss or filtering.
- Both tests keep dropping
- Check camera power and uptime. Compare the same sub-stream in another player.
Frequently asked questions
What causes RTSP video delay?
Camera encoding, network delivery and player buffering and decoding all add delay. The total varies with the equipment and settings.
Should I try H.264 instead of H.265?
If your camera offers both, try H.264 at similar settings to check player compatibility. Compare one change at a time.
What if the player loses the connection?
Use the disconnecting guide if live video stops and the player has to reconnect.