Connection Close after 60 Seconds!
Can you provide more details?
That is how I work:
1: started server
*** Client: start listening 0.0.0.0:4554 ***
*** Camera: connected [camera14551] ***
*** Client: play [camera14551] [fatoiyv4l] [192.168.0.166] LibVLC/3.0.20 (LIVE555 Streaming Media v2016.11.28) ***
*** Client closed [camera14551] [fatoiyv4l] [192.168.0.166] ***
*** Camera: closed [camera14551] ***
connects with vlc to server it stars and after 60 seconds server prints this
*** Client closed [camera14551] [fatoiyv4l] [192.168.0.166] ***
*** Camera: closed [camera14551] ***
Full Log
*** Client: start listening 0.0.0.0:4554 ***
Client: new connection from 192.168.0.143:48188
~~~ Client: read
OPTIONS rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28)
~~~ Camera: write
OPTIONS rtsp://192.168.144.25:8554/main.264 RTSP/1.0
CSeq: 1
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 1
Date: Thu, Jan 01 1970 00:26:26 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
~~~ Camera: write
DESCRIBE rtsp://192.168.144.25:8554/main.264 RTSP/1.0
CSeq: 2
Accept: application/sdp
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 2
Date: Thu, Jan 01 1970 00:26:26 GMT
Content-Base: rtsp://192.168.144.25:8554/main.264/
Content-Type: application/sdp
Content-Length: 647
v=0
o=- 5261318 1 IN IP4 192.168.144.25
s=LIVE555 Streaming Media v2019.08.12
i=LIVE555 Streaming Media v2019.08.12
t=0 0
a=tool:LIVE555 Streaming Media v2019.08.12
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:LIVE555 Streaming Media v2019.08.12
a=x-qt-text-inf:LIVE555 Streaming Media v2019.08.12
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H265/90000
a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA==
a=control:track1
~~~ Camera: write
SETUP rtsp://192.168.144.25:8554/main.264/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=5550-5551
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 3
Date: Thu, Jan 01 1970 00:26:26 GMT
Transport: RTP/AVP;unicast;destination=192.168.144.159;source=192.168.144.25;client_port=5550-5551;server_port=6970-6971
Session: 74DDD7B7;timeout=65
*** Camera: connected [camera14551] ***
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY
~~~ Client: read
DESCRIBE rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
CSeq: 3
User-Agent: LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28)
Accept: application/sdp
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Length: 390
v=0
o=- 812435 7 IN IP4 127.0.1.1
s=python-rtsp-server
t=0 0
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H265/90000
a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA==
a=control:track1
~~~ Client: read
SETUP rtsp://192.168.0.143:4554/camera14551/track1 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28)
Transport: RTP/AVP;unicast;client_port=47768-47769
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 4
Transport: RTP/AVP;unicast;client_port=47768-47769;server_port=5998-5999
Session: quv47linq;timeout=60000
~~~ Client: read
PLAY rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
CSeq: 5
User-Agent: LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28)
Session: quv47linq
Range: npt=0.000-
~~~ Camera: write
PLAY rtsp://192.168.144.25:8554/main.264 RTSP/1.0
CSeq: 4
Session: 74DDD7B7
Range: npt=0.000-
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 4
Date: Thu, Jan 01 1970 00:26:26 GMT
Range: npt=0.000-
Session: 74DDD7B7
RTP-Info: url=rtsp://192.168.144.25:8554/main.264/track1;seq=48061;rtptime=3460004550
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 5
Session: quv47linq
RTP-Info: url=rtsp://127.0.1.1:4554/track1;seq=48061;rtptime=3460004577
*** Client: play [camera14551] [quv47linq] [192.168.0.143] LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28) ***
~~~ Client: read
TEARDOWN rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
CSeq: 6
User-Agent: LibVLC/3.0.19 (LIVE555 Streaming Media v2016.11.28)
Session: quv47linq
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 6
Session: quv47linq
*** Client closed [camera14551] [quv47linq] [192.168.0.143] ***
*** Camera: closed [camera14551] ***
Client: connection closed: 192.168.0.143:48188
Also can't connect using openCV
it shows this error :
*** Client: start listening 0.0.0.0:4554 ***
Client: new connection from 192.168.0.166:13472
~~~ Client: read
OPTIONS rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.76.100
~~~ Camera: write
OPTIONS rtsp://192.168.144.25:8554/main.264 RTSP/1.0
CSeq: 1
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 1
Date: Thu, Jan 01 1970 00:37:58 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
~~~ Camera: write
DESCRIBE rtsp://192.168.144.25:8554/main.264 RTSP/1.0
CSeq: 2
Accept: application/sdp
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 2
Date: Thu, Jan 01 1970 00:37:58 GMT
Content-Base: rtsp://192.168.144.25:8554/main.264/
Content-Type: application/sdp
Content-Length: 647
v=0
o=- 5261318 1 IN IP4 192.168.144.25
s=LIVE555 Streaming Media v2019.08.12
i=LIVE555 Streaming Media v2019.08.12
t=0 0
a=tool:LIVE555 Streaming Media v2019.08.12
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:LIVE555 Streaming Media v2019.08.12
a=x-qt-text-inf:LIVE555 Streaming Media v2019.08.12
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H265/90000
a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA==
a=control:track1
~~~ Camera: write
SETUP rtsp://192.168.144.25:8554/main.264/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=5550-5551
~~~ Camera: read:
RTSP/1.0 200 OK
CSeq: 3
Date: Thu, Jan 01 1970 00:37:58 GMT
Transport: RTP/AVP;unicast;destination=192.168.144.159;source=192.168.144.25;client_port=5550-5551;server_port=6972-6973
Session: 0F408501;timeout=65
*** Camera: connected [camera14551] ***
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 1
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY
~~~ Client: read
DESCRIBE rtsp://192.168.0.143:4554/camera14551 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf58.76.100
~~~ Client: write
RTSP/1.0 200 OK
CSeq: 2
Content-Type: application/sdp
Content-Length: 390
v=0
o=- 756313 1 IN IP4 127.0.1.1
s=python-rtsp-server
t=0 0
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H265/90000
a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA==
a=control:track1
~~~ Client: read
SETUP rtsp://192.168.0.143:4554/camera14551/track1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
CSeq: 3
User-Agent: Lavf58.76.100
Client: error: can't handle request from 192.168.0.166: invalid transport ports
Also can't connect using openCV
it shows this error :
*** Client: start listening 0.0.0.0:4554 *** Client: new connection from 192.168.0.166:13472 ~~~ Client: read OPTIONS rtsp://192.168.0.143:4554/camera14551 RTSP/1.0 CSeq: 1 User-Agent: Lavf58.76.100 ~~~ Camera: write OPTIONS rtsp://192.168.144.25:8554/main.264 RTSP/1.0 CSeq: 1 ~~~ Camera: read: RTSP/1.0 200 OK CSeq: 1 Date: Thu, Jan 01 1970 00:37:58 GMT Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER ~~~ Camera: write DESCRIBE rtsp://192.168.144.25:8554/main.264 RTSP/1.0 CSeq: 2 Accept: application/sdp ~~~ Camera: read: RTSP/1.0 200 OK CSeq: 2 Date: Thu, Jan 01 1970 00:37:58 GMT Content-Base: rtsp://192.168.144.25:8554/main.264/ Content-Type: application/sdp Content-Length: 647 v=0 o=- 5261318 1 IN IP4 192.168.144.25 s=LIVE555 Streaming Media v2019.08.12 i=LIVE555 Streaming Media v2019.08.12 t=0 0 a=tool:LIVE555 Streaming Media v2019.08.12 a=type:broadcast a=control:* a=range:npt=0- a=x-qt-text-nam:LIVE555 Streaming Media v2019.08.12 a=x-qt-text-inf:LIVE555 Streaming Media v2019.08.12 m=video 0 RTP/AVP 96 c=IN IP4 0.0.0.0 b=AS:500 a=rtpmap:96 H265/90000 a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA== a=control:track1 ~~~ Camera: write SETUP rtsp://192.168.144.25:8554/main.264/track1 RTSP/1.0 CSeq: 3 Transport: RTP/AVP;unicast;client_port=5550-5551 ~~~ Camera: read: RTSP/1.0 200 OK CSeq: 3 Date: Thu, Jan 01 1970 00:37:58 GMT Transport: RTP/AVP;unicast;destination=192.168.144.159;source=192.168.144.25;client_port=5550-5551;server_port=6972-6973 Session: 0F408501;timeout=65 *** Camera: connected [camera14551] *** ~~~ Client: write RTSP/1.0 200 OK CSeq: 1 Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY ~~~ Client: read DESCRIBE rtsp://192.168.0.143:4554/camera14551 RTSP/1.0 Accept: application/sdp CSeq: 2 User-Agent: Lavf58.76.100 ~~~ Client: write RTSP/1.0 200 OK CSeq: 2 Content-Type: application/sdp Content-Length: 390 v=0 o=- 756313 1 IN IP4 127.0.1.1 s=python-rtsp-server t=0 0 m=video 0 RTP/AVP 96 c=IN IP4 0.0.0.0 b=AS:500 a=rtpmap:96 H265/90000 a=fmtp:96 profile-space=0;profile-id=1;tier-flag=0;level-id=150;interop-constraints=000000000000;sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ;sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqACgIAtFja5JMmuWcAgAAB9IAAOqcE=;sprop-pps=RAHgdrAmQA== a=control:track1 ~~~ Client: read SETUP rtsp://192.168.0.143:4554/camera14551/track1 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 CSeq: 3 User-Agent: Lavf58.76.100 Client: error: can't handle request from 192.168.0.166: invalid transport ports
change mode into TCP and its now working...
when connection closed cant connect again and need to launch script!
Well, then you can help the project by debugging the client-server exchange. As far as I understand, in your case the client initiates the connection termination. By the way, you need to set the same TCP/UDP mode on the client and server sides.