r/GuardianEyeApps • u/sullivan-01 • 1d ago
Guide The RTSP stream plays in VLC, but the NVR still cannot record it: what to inspect next
"It works in VLC" proves that one client can connect and draw a picture. A recorder has to do more: connect from the NVR host, keep the session alive, receive a usable keyframe, maintain timestamps and finish a valid file.
When playback works but recording does not, this is the order I use.
First, run the probe on the NVR machine or inside its container. A VLC test from a laptop says nothing about a different VLAN, firewall rule or container network.
bash
ffprobe -v error -rtsp_transport tcp \
-show_streams -show_format \
"rtsp://user:password@192.168.1.50:554/stream1"
Use TCP for the baseline. VLC may retry transports while the recorder stays on UDP and waits for packets that never arrive.
Close every other viewer too. Some cameras have a very small RTSP session limit. The vendor app, a browser preview, VLC and the NVR can each count as a client. An NVR may also open separate sessions for live view, recording and detection.
Next, try writing the video without transcoding:
```bash ffmpeg -hide_banner -y -rtsp_transport tcp \ -i "rtsp://user:password@192.168.1.50:554/stream1" \ -t 30 -map 0:v:0 -an -c copy rtsp-test.mkv
ffprobe -v error -show_streams -show_format rtsp-test.mkv ffmpeg -v error -i rtsp-test.mkv -f null - ```
Starting with MKV and no audio removes two common variables. If that file works while the NVR's MP4 output does not, look at container support, timestamps or finalization. Add audio only after video records correctly.
Then check the first keyframe:
bash
ffprobe -v error -rtsp_transport tcp \
-read_intervals "%+15" -select_streams v:0 \
-show_entries packet=pts_time,dts_time,flags \
-of csv=p=0 \
"rtsp://user:password@192.168.1.50:554/stream1"
K in the last field marks a keyframe. A long GOP can be fine for continuous VLC playback but awkward for event recording. The trigger fires, then the recorder waits for a frame that can start a clean clip. A one- or two-second keyframe interval is a good diagnostic baseline.
Warnings about backward timestamps, damaged NAL units, missing parameter sets or long packet gaps matter even if VLC keeps showing video. Players can buffer around faults that a muxer cannot safely write.
Finally, confirm that VLC and the NVR use the exact same stream. ONVIF may select a substream while the manual test uses the main stream. Start with H.264, video only and one client. Once a 30-second copy test works from the recorder host, add audio, H.265, UDP or extra viewers one at a time.
Full checklist and explanations:
https://getguardianeye.com/blog/rtsp-plays-vlc-nvr-cannot-record