Unifi rtsp stream not working
I followed some of the advice of the previous threads. I took the unifi generated rtsp stream and put it into a mac app called "Camera Feeds". once I add rtsp://192.168.1.101:7447/eR17I39IBgdZar85 then everything works fine in the mac app. If i put it into RTSPtoWeb then it doesn't work. no feeds work. ive been debugging for a few hours and throwing in the towel. im still sorta a noob so maybe something dumb?
lazydocker showing logs
showing RTSPtoWeb with the mac app over top. mac app (purposefully blurred, shows that the rtsp url is working)
the ip seems that your rtp server is behind of the NAT, Are the RTP server's location, RTSPtoWeb server's location and your client(Browser) same vLAN?
i only have a single network (no vlans or anything like that). pretty basic unifi home wifi setup (in my opinion) i dont even have unifi cloud enabled. its all local. then i enabled rtsp stream in the unifi console for my camera, and wanted to host a little website locally so that my SO can view camera feeds without logging in.
so to answer your question "Are the RTP server's location, RTSPtoWeb server's location and your client(Browser) same vLAN?" yes everything in on my local network.
Found a log in your image indicating no video stream, which triggered ErrorStreamNoVideo. This might be related to issue #531.
- Can you show the complete RTSP logs from start to finish?
- What's the GOP setting for this camera?
Sure! just to clarify (because im a noob at docker and rtsp)
1. Can you show the complete RTSP logs from start to finish?
Do you just mean the full docker logs? if so, yes i can do that.
2. What's the GOP setting for this camera?
What's GOP? Tried googling and looks like GOP settings aren't really exposed for unifi gear? https://community.ui.com/questions/UniFi-Protect-RTSP-specific-GOP-or-FPS-address/50fdaf5e-e66d-4261-95bf-4ae3a3d5b024
These are my options for enabling rtsp streams
The full url is rtsps://192.168.1.101:7441/YFpLFoeBRbpNllbU?enableSrtp so i actually convert that to rtsp://192.168.1.101:7447/YFpLFoeBRbpNllbU because according to other people on this github repo have said that i need rtsp not rtsps and port 7447 not 7441, and to remove the enableSrtp url arg
- I need logs(of RTSPtoWeb) that capture the entire RTSP session lifecycle for a specific ID, from session start to session end.
- While GOP can be verified using tools like ffprobe, I'm asking this to confirm whether I can be certain that a key frame will arrive within 10 seconds.
- sorry. noob here."I need logs(of RTSPtoWeb) that capture the entire RTSP session lifecycle for a specific ID, from session start to session end." Where do i find those? just in the chrome dev tools or what?
- I'll try to use
ffprobeto verify GOP. Thanks
For 2 I ran this command (thanks to chatgpt for putting the command together)
➜ ~ ffprobe -hide_banner -rtsp_transport tcp -v error \
-select_streams v:0 -show_frames -show_entries frame=pict_type \
-of csv=p=0 "rtsp://192.168.1.101:7447/RJxV8HKBMBMmeJWg" \
| awk '
BEGIN{c=0; seen=0; sum=0; n=0}
$1=="I"{
if(seen){ printf("GOP=%d\n", c); sum+=c; n++ }
c=0; seen=1; next
}
{ c++ }
END{
if(n>0) printf("Average GOP=%.2f\n", sum/n);
else print "No I-frames observed (let it run longer?)"
}'
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
GOP=23
The output (GOP=23) shows up after about 3 seconds.
- I noticed the first image shows lazy docker. In that tool, you should see logs during the period when an RTSP session with a specific ID starts and disconnects (from when you launch the player in your web browser if you added the stream with
OnDemandset totrue, or from the moment you added the stream if not). I'd like to know what caused the RTSP session to disconnect by examining those logs. - 24 frames per I-frame means that if you're using a commercial camera (which certainly wouldn't be running at 2fps), it's likely running at 24fps, so keyframes should definitely arrive within 10 seconds. If you're receiving a
noVideosignal and the RTSP session terminates under these conditions, then you're experiencing the same issue I reported. That's why I need to see the logs.
Very weird. I readded the camera today and it seems to sort of work? its pretty choppy/laggy/keeps skipping back a few seconds so I don't have smooth playback (vs other rtsp viewer apps)
Attaching all logs from docker from starting the image to running the camera in the website.