Opened 19 months ago

Closed 7 months ago

#7162 closed defect (needs_more_info)

rtsp socket timeout not working

Reported by: sporn Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: rtsp
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Stream does not connect. In code I get an error -138 (socket timeout) after about 20 seconds even though I have set the socket timeout to 60 seconds. It looks like ffmpeg isn't setting the windows socket timeout correctly.

VLC connects and displays this feed correctly (it takes about 22 seconds to start playing)

How to reproduce:

% ffplay rtsp://kcanda.onthewifi.com:554/onvif1 -stimeout 60000000
ffmpeg version windows 4.0
built on ... 2018-04-24

wireshark output from ffmpeg:

OPTIONS rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

CSeq: 1

User-Agent: Lavf58.13.100

RTSP/1.0 200 OK

CSeq: 1

Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER,USER_CMD_SET

DESCRIBE rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

Accept: application/sdp

CSeq: 2

User-Agent: Lavf58.13.100

RTSP/1.0 200 OK

CSeq: 2

Content-Type: application/sdp

Content-Length: 422

v=0

o=- 1421069297525233 1 IN IP4 192.168.1.101

s=H.264 Video, RtspServer_0.0.0.2

t=0 0

a=tool:RtspServer_0.0.0.2

a=type:broadcast

a=control:*

a=range:npt=0-

m=video 0 RTP/AVP 96

c=IN IP4 0.0.0.0

b=AS:500

a=rtpmap:96 H264/90000

a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==

a=control:track1

m=audio 0 RTP/AVP 8

a=control:track2

a=rtpmap:8 PCMA/8000

SETUP rtsp://kcanda.onthewifi.com:554/onvif1/track1 RTSP/1.0

Transport: RTP/AVP/UDP;unicast;client_port=25128-25129

CSeq: 3

User-Agent: Lavf58.13.100

RTSP/1.0 200 OK

CSeq: 3

Transport: RTP/AVP;unicast;destination=1.127.111.190;source=192.168.1.101;client_port=25128-25129;server_port=7020-7021

Session: 56d71937;timeout=60

SETUP rtsp://kcanda.onthewifi.com:554/onvif1/track2 RTSP/1.0

Transport: RTP/AVP/UDP;unicast;client_port=25130-25131

CSeq: 4

User-Agent: Lavf58.13.100

Session: 56d71937

RTSP/1.0 200 OK

CSeq: 4

Transport: RTP/AVP;unicast;destination=1.127.111.190;source=192.168.1.101;client_port=25130-25131;server_port=7022-7023

Session: 56d71937;timeout=60

PLAY rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

Range: npt=0.000-

CSeq: 5

User-Agent: Lavf58.13.100

Session: 56d71937

RTSP/1.0 200 OK

CSeq: 5

Range: npt=0.000-

Session: 56d71937

RTP-Info: url=rtsp:192.168.1.101:554/onvif1/track1;seq=51639;rtptime=82392221790,url=rtsp:192.168.1.101:554/onvif1/track2;seq=8714;rtptime=7323798536

wireshark output from vlc:

OPTIONS rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

CSeq: 2

User-Agent: LibVLC/3.0.2 (LIVE555 Streaming Media v2016.11.28)

RTSP/1.0 200 OK

CSeq: 2

Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER,USER_CMD_SET

DESCRIBE rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

CSeq: 3

User-Agent: LibVLC/3.0.2 (LIVE555 Streaming Media v2016.11.28)

Accept: application/sdp

RTSP/1.0 200 OK

CSeq: 3

Content-Type: application/sdp

Content-Length: 422

v=0

o=- 1421069297525233 1 IN IP4 192.168.1.101

s=H.264 Video, RtspServer_0.0.0.2

t=0 0

a=tool:RtspServer_0.0.0.2

a=type:broadcast

a=control:*

a=range:npt=0-

m=video 0 RTP/AVP 96

c=IN IP4 0.0.0.0

b=AS:500

a=rtpmap:96 H264/90000

a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==

a=control:track1

m=audio 0 RTP/AVP 8

a=control:track2

a=rtpmap:8 PCMA/8000

SETUP rtsp://kcanda.onthewifi.com:554/onvif1/track1 RTSP/1.0

CSeq: 4

User-Agent: LibVLC/3.0.2 (LIVE555 Streaming Media v2016.11.28)

Transport: RTP/AVP/TCP;unicast;interleaved=0-1

RTSP/1.0 200 OK

CSeq: 4

Transport: RTP/AVP;unicast;destination=1.127.111.190;source=192.168.1.101;interleaved=0-1

Session: 42986c0;timeout=60

SETUP rtsp://kcanda.onthewifi.com:554/onvif1/track2 RTSP/1.0

CSeq: 5

User-Agent: LibVLC/3.0.2 (LIVE555 Streaming Media v2016.11.28)

Transport: RTP/AVP/TCP;unicast;interleaved=2-3

Session: 42986c0

RTSP/1.0 200 OK

CSeq: 5

Transport: RTP/AVP;unicast;destination=1.127.111.190;source=192.168.1.101;interleaved=2-3

Session: 42986c0;timeout=60

PLAY rtsp://kcanda.onthewifi.com:554/onvif1 RTSP/1.0

CSeq: 6

User-Agent: LibVLC/3.0.2 (LIVE555 Streaming Media v2016.11.28)

Session: 42986c0

Range: npt=0.000-

RTSP/1.0 200 OK

CSeq: 6

Range: npt=0.000-

Session: 42986c0

RTP-Info: url=rtsp:192.168.1.101:554/onvif1/track1;seq=53167;rtptime=82402952130,url=rtsp:192.168.1.101:554/onvif1/track2;seq=11543;rtptime=7324704776

$..L..-...#.....................................................................................................................................................................................................................................................................................................................................$..L..-...%.....................................................................................................................................................................................................................................................................................................................................$..L..-...&H............................... etc

Change History (1)

comment:1 Changed 7 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords rtsp added; socket timeout windows removed
  • Priority changed from important to normal
  • Resolution set to needs_more_info
  • Status changed from new to closed

Needs a public stream to test, if this is rtsp over http, it was fixed by Jun Li in f502bd5432c9d7a34392ec3147bc5b5e3a868d9c

Note: See TracTickets for help on using tickets.