Closed rrygl closed 2 weeks ago
Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!
I'm not so sure... it looks to me like the port isn't configured and it isn't getting a hostname for localhost... What do you have in Options->Network->MIN_RTP_PORT ? Default is 40200. You might try changing this...
MIN_RTP_PORT is still default 40200.
The error log shows that it tried to bind port 0 and 1 (comes from 0+1). Binding 0 was fine because it picked a random one instead. Binding 1 failed. This simply means that the port number variables were only initial default values.
These two threads are not supposed to run at all (the comment says so). But yet they run and try to bind port 0 and 1. That's the problem.
I've this issue too
I have the same issue on Debian 11, zoneminder-1.36.33-bullseye1 from the zoneminder APT repo.
This is what I got from the debug output:
02/14/24 22:07:32.611078 zmc_m3[132786].DB2-zm_rtsp.cpp/474 [Got RTSP session BBD57073, timeout 60 secs]
02/14/24 22:07:32.611090 zmc_m3[132786].DB2-zm_rtsp.cpp/479 [Got RTSP transport RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=001FF16F;mode="PLAY"]
02/14/24 22:07:32.611107 zmc_m3[132786].DB2-zm_rtsp.cpp/517 [RTSP Method is RTP/RTSP]
02/14/24 22:07:32.611116 zmc_m3[132786].DB2-zm_rtsp.cpp/518 [RTSP Distribution is unicast]
02/14/24 22:07:32.611124 zmc_m3[132786].DB2-zm_rtsp.cpp/519 [RTSP SSRC is 1ff16f]
02/14/24 22:07:32.611133 zmc_m3[132786].DB2-zm_rtsp.cpp/520 [RTSP Local Host is ]
02/14/24 22:07:32.611142 zmc_m3[132786].DB2-zm_rtsp.cpp/521 [RTSP Local Ports are 0/0]
02/14/24 22:07:32.611150 zmc_m3[132786].DB2-zm_rtsp.cpp/522 [RTSP Remote Ports are 0/0]
02/14/24 22:07:32.611159 zmc_m3[132786].DB2-zm_rtsp.cpp/523 [RTSP Remote Channels are 0/1]
02/14/24 22:07:32.611175 zmc_m3[132786].DB2-zm_rtsp.cpp/43 [Sending RTSP message: PLAY rtsp://cam3.domain.com:80/axis-media/media.amp?videocodec=h264&resolution=1280x960 RTSP/1.0^M
I dug a bit in the source (I'm not an expert!) but it seems that a new RtpSource object is created here in zm_rtsp.cpp:
switch( mMethod ) {
case RTP_RTSP :
case RTP_RTSP_HTTP :
{
RtpSource *source = new RtpSource( mId, "", remoteChannels[0], mHost, remoteChannels[0], ssrc, seq, rtpClock, rtpTime, codecId );
}
}
Where remoteChannels[0]
(3rd parameter) is passed further down to fill the values of localPortBase
/ mLocalPortChans
which are used by getLocalCtrlPort()
But looking at the source (again in zm_rtsp.cpp):
} else if (StartsWith(parts[i], "interleaved=") ) {
method = "RTP/RTSP";
StringVector subparts = Split(parts[i], "=");
StringVector channels = Split(subparts[1], "-");
remoteChannels[0] = strtol( channels[0].c_str(), nullptr, 10 );
remoteChannels[1] = strtol( channels[1].c_str(), nullptr, 10 );
it seems to just parse the value from interleaved=0-1
in the RTSP transport response and pass that as port number to the bind calls later on.
MIN_RTP_PORT
is only used in requestPorts()
but that is only called for type RTP_UNICAST
it seems.
Hope this makes any sense and helps you track down the issue.
@connortechnology going to deprecate Remote for 1.38? I think you mentioned useful for snapshot still but if it has issues we need to fix or remove.
Yeah remote should stick around but deprecated for rtsp.
I feel like this should be fixed though.
Describe Your Environment
Describe the bug Remote/RTSP is broken with error log: "Failed to bind RTCP server" I think the bug was introduced in 71edb9d830696a618e9f8a5911c748bbf4356f92. Before this commit RtpCtrlThread needs to call .start() but this commit changed it to start without it. Then in zm_rtsp.cpp there is a ctrl thread that doesn't want to start:
Now it starts and fails.
To Reproduce Simply use Remote/RTSP.
Expected behavior It should work
Debug Logs