bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
11.62k stars 1.47k forks source link

ERR: invalid transport header: protocol not found (when using Kodi PVR IPTV Simple Client) #423

Closed jokay closed 3 years ago

jokay commented 3 years ago

Which version are you using?

0.16.2 (same for 0.16.3)

Which operating system are you using?

OS

Architecture

Describe the issue

Camera stream no longer available when requesting via Kodi PVR IPTV Simple Client.

VLC works perfectly.

Describe how to replicate the issue

  1. start the server
  2. open stream in Kodi / PVR IPTV Simple Client
  3. won't work

Did you attach a network dump?

no

Debug Log

2021/06/12 19:47:50 I [0/0] rtsp-simple-server v0.16.2
2021/06/12 19:47:50 I [0/0] [RTSP] UDP/RTP listener opened on :8000
2021/06/12 19:47:50 I [0/0] [RTSP] UDP/RTCP listener opened on :8001
2021/06/12 19:47:50 I [0/0] [RTSP] TCP listener opened on :55555
2021/06/12 19:47:50 I [0/0] [RTMP] listener opened on :1935
2021/06/12 19:47:50 I [0/0] [HLS] listener opened on :8888
2021/06/12 19:48:03 I [0/0] [RTSP] [conn 192.168.1.10:55804] opened
2021/06/12 19:48:03 D [0/0] [RTSP] [conn 192.168.1.10:55804] [c->s] OPTIONS rtsp://192.168.1.100:55555/cam1 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.45.100

2021/06/12 19:48:03 D [0/0] [RTSP] [conn 192.168.1.10:55804] [s->c] RTSP/1.0 200 OK
CSeq: 1
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib

2021/06/12 19:48:03 D [0/0] [RTSP] [conn 192.168.1.10:55804] [c->s] DESCRIBE rtsp://192.168.1.100:55555/cam1 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf58.45.100

2021/06/12 19:48:03 I [0/0] [path cam1] [rtsp source] started
2021/06/12 19:48:03 D [0/0] [path cam1] [rtsp source] connecting
2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
CSeq: 1
User-Agent: gortsplib

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 401 Unauthorized
CSeq: 1
WWW-Authenticate: Digest realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5"

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="339a5592384425a3ae4a11cb93137118"
CSeq: 2
User-Agent: gortsplib

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Server: Rtsp Server/3.0

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] c->s DESCRIBE rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Accept: application/sdp
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="dabdf0290fe0f3317e33bee36e6e630c"
CSeq: 3
User-Agent: gortsplib

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 3
Cache-Control: must-revalidate
Content-Base: rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/
Content-Length: 433
Content-Type: application/sdp
X-Accept-Dynamic-Rate: 1

v=0
o=- 2251969722 2251969722 IN IP4 0.0.0.0
s=Media Server
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=packetization-supported:DH
a=rtppayload-supported:DH
a=range:npt=now-
m=video 0 RTP/AVP 96
a=control:trackID=0
a=framerate:25.000000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=recvonly

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] c->s SETUP rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0", response="a9e2069961a91c28acad80056bca401b"
CSeq: 4
Transport: RTP/AVP;unicast;client_port=14186-14187;mode=play
User-Agent: gortsplib

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 4
Session: 31549547020;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=14186-14187;server_port=39750-39751;ssrc=2AEB1655
X-Dynamic-Rate: 1

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] c->s PLAY rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/", response="d1187851bcde9e81464b879b89f47873"
CSeq: 5
Session: 31549547020
User-Agent: gortsplib

2021/06/12 19:48:04 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 5
RTP-Info: url=trackID=0;seq=5717;rtptime=5717
Session: 31549547020

2021/06/12 19:48:04 I [0/0] [path cam1] [rtsp source] ready
2021/06/12 19:48:04 D [0/0] [RTSP] [conn 192.168.1.10:55804] [s->c] RTSP/1.0 200 OK
CSeq: 2
Content-Base: rtsp://192.168.1.100:55555/cam1/
Content-Length: 288
Content-Type: application/sdp
Server: gortsplib

v=0
o=- 0 0 IN IP4 127.0.0.1
s=Stream
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=control:trackID=0

2021/06/12 19:48:04 D [0/0] [RTSP] [conn 192.168.1.10:55804] [c->s] SETUP rtsp://192.168.1.100:55555/cam1/trackID=0 RTSP/1.0
CSeq: 3
Transport: ����RTP/AVP/UDP;unicast;client_port=10542-10543
User-Agent: Lavf58.45.100

2021/06/12 19:48:04 I [0/0] [RTSP] [session 167815548] opened by 192.168.1.10:55804
2021/06/12 19:48:04 D [0/0] [RTSP] [conn 192.168.1.10:55804] [s->c] RTSP/1.0 400 Bad Request
CSeq: 3
Server: gortsplib

2021/06/12 19:48:04 I [0/0] [RTSP] [conn 192.168.1.10:55804] ERR: invalid transport header: protocol not found (����RTP/AVP/UDP;unicast;client_port=10542-10543)
2021/06/12 19:48:04 I [0/0] [RTSP] [conn 192.168.1.10:55804] closed
2021/06/12 19:48:04 I [0/0] [RTSP] [session 167815548] closed
2021/06/12 19:48:14 I [0/0] [path cam1] [rtsp source] stopped
2021/06/12 19:48:14 D [0/0] [path cam1] [rtsp source] c->s TEARDOWN rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="1a120f0e4d79c9e42490bb92683932d5", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/", response="2daaa0b71a782eefe1b3a5049c792c02"
CSeq: 6
Session: 31549547020
User-Agent: gortsplib

2021/06/12 19:48:14 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 0 

2021/06/12 19:48:25 I [0/0] [RTSP] [conn 192.168.1.10:55806] opened
2021/06/12 19:48:25 D [0/0] [RTSP] [conn 192.168.1.10:55806] [c->s] OPTIONS rtsp://192.168.1.100:55555/cam1 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.45.100

2021/06/12 19:48:25 D [0/0] [RTSP] [conn 192.168.1.10:55806] [s->c] RTSP/1.0 200 OK
CSeq: 1
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib

2021/06/12 19:48:25 D [0/0] [RTSP] [conn 192.168.1.10:55806] [c->s] DESCRIBE rtsp://192.168.1.100:55555/cam1 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf58.45.100

2021/06/12 19:48:25 I [0/0] [path cam1] [rtsp source] started
2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] connecting
2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
CSeq: 1
User-Agent: gortsplib

2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 401 Unauthorized
CSeq: 1
WWW-Authenticate: Digest realm="Login to 2K02A98PBA00001", nonce="a6dc060070e288b6c915b5a9533ca559"

2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="a6dc060070e288b6c915b5a9533ca559", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="144d806b79c00c4430eb0ec376141a5f"
CSeq: 2
User-Agent: gortsplib

2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Server: Rtsp Server/3.0

2021/06/12 19:48:25 D [0/0] [path cam1] [rtsp source] c->s DESCRIBE rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Accept: application/sdp
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="a6dc060070e288b6c915b5a9533ca559", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="e984db87e79438264f1f58b9d9e019b4"
CSeq: 3
User-Agent: gortsplib

2021/06/12 19:48:26 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 3
Cache-Control: must-revalidate
Content-Base: rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/
Content-Length: 433
Content-Type: application/sdp
X-Accept-Dynamic-Rate: 1

v=0
o=- 2251969743 2251969743 IN IP4 0.0.0.0
s=Media Server
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=packetization-supported:DH
a=rtppayload-supported:DH
a=range:npt=now-
m=video 0 RTP/AVP 96
a=control:trackID=0
a=framerate:25.000000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=recvonly

2021/06/12 19:48:26 D [0/0] [path cam1] [rtsp source] c->s SETUP rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="a6dc060070e288b6c915b5a9533ca559", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0", response="a16f659396eeaa2bb99d6e5664a45841"
CSeq: 4
Transport: RTP/AVP;unicast;client_port=48230-48231;mode=play
User-Agent: gortsplib

2021/06/12 19:48:26 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 4
Session: 31571018497;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=48230-48231;server_port=39036-39037;ssrc=5BD5A8CB
X-Dynamic-Rate: 1

2021/06/12 19:48:26 D [0/0] [path cam1] [rtsp source] c->s PLAY rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="a6dc060070e288b6c915b5a9533ca559", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/", response="7510807ddc336b84cf37f9bf55c21a39"
CSeq: 5
Session: 31571018497
User-Agent: gortsplib

2021/06/12 19:48:26 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 5
RTP-Info: url=trackID=0;seq=43211;rtptime=43211
Session: 31571018497

2021/06/12 19:48:26 I [0/0] [path cam1] [rtsp source] ready
2021/06/12 19:48:26 D [0/0] [RTSP] [conn 192.168.1.10:55806] [s->c] RTSP/1.0 200 OK
CSeq: 2
Content-Base: rtsp://192.168.1.100:55555/cam1/
Content-Length: 288
Content-Type: application/sdp
Server: gortsplib

v=0
o=- 0 0 IN IP4 127.0.0.1
s=Stream
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=control:trackID=0

2021/06/12 19:48:26 D [0/0] [RTSP] [conn 192.168.1.10:55806] [c->s] SETUP rtsp://192.168.1.100:55555/cam1/trackID=0 RTSP/1.0
CSeq: 3
Transport: ����RTP/AVP/UDP;unicast;client_port=23248-23249
User-Agent: Lavf58.45.100

2021/06/12 19:48:26 I [0/0] [RTSP] [session 304770248] opened by 192.168.1.10:55806
2021/06/12 19:48:26 D [0/0] [RTSP] [conn 192.168.1.10:55806] [s->c] RTSP/1.0 400 Bad Request
CSeq: 3
Server: gortsplib

2021/06/12 19:48:26 I [0/0] [RTSP] [conn 192.168.1.10:55806] ERR: invalid transport header: protocol not found (����RTP/AVP/UDP;unicast;client_port=23248-23249)
2021/06/12 19:48:26 I [0/0] [RTSP] [conn 192.168.1.10:55806] closed
2021/06/12 19:48:26 I [0/0] [RTSP] [session 304770248] closed

Couldn't find a way to make it work again.

dorinclisu commented 3 years ago

Seems like the problem might originate from invalid characters in transport protocols (����) but it's not clear where do these come from.

jokay commented 3 years ago

@dorinclisu any idea on how I could further debug the issue?

jokay commented 3 years ago

This is the debug log if using VLC (where it works).

2021/06/17 07:12:11 I [0/0] rtsp-simple-server v0.16.2
2021/06/17 07:12:11 I [0/0] [RTSP] UDP/RTP listener opened on :8000
2021/06/17 07:12:11 I [0/0] [RTSP] UDP/RTCP listener opened on :8001
2021/06/17 07:12:11 I [0/0] [RTSP] TCP listener opened on :55555
2021/06/17 07:12:11 I [0/0] [RTMP] listener opened on :1935
2021/06/17 07:12:11 I [0/0] [HLS] listener opened on :8888
2021/06/17 07:12:12 I [0/0] [RTSP] [conn 192.168.1.10:41412] opened
2021/06/17 07:12:12 D [0/0] [RTSP] [conn 192.168.1.10:41412] [c->s] OPTIONS rtsp://192.168.1.100:55555/cam1 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:12 D [0/0] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 200 OK
CSeq: 2
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib

2021/06/17 07:12:12 D [0/0] [RTSP] [conn 192.168.1.10:41412] [c->s] DESCRIBE rtsp://192.168.1.100:55555/cam1 RTSP/1.0
Accept: application/sdp
CSeq: 3
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:12 I [0/0] [path cam1] [rtsp source] started
2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] connecting
2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
CSeq: 1
User-Agent: gortsplib

2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 401 Unauthorized
CSeq: 1
WWW-Authenticate: Digest realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd"

2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="1b6564db36ed8f68595317b616bdc669"
CSeq: 2
User-Agent: gortsplib

2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Server: Rtsp Server/3.0

2021/06/17 07:12:12 D [0/0] [path cam1] [rtsp source] c->s DESCRIBE rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
Accept: application/sdp
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0", response="66310152ee296f80a91c88c13417fd70"
CSeq: 3
User-Agent: gortsplib

2021/06/17 07:12:13 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 3
Cache-Control: must-revalidate
Content-Base: rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/
Content-Length: 433
Content-Type: application/sdp
X-Accept-Dynamic-Rate: 1

v=0
o=- 2251971494 2251971494 IN IP4 0.0.0.0
s=Media Server
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=packetization-supported:DH
a=rtppayload-supported:DH
a=range:npt=now-
m=video 0 RTP/AVP 96
a=control:trackID=0
a=framerate:25.000000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=recvonly

2021/06/17 07:12:13 D [0/0] [path cam1] [rtsp source] c->s SETUP rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0 RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/trackID=0", response="1e15cb4bff52e2b591a22c1ddc4704f8"
CSeq: 4
Transport: RTP/AVP;unicast;client_port=14186-14187;mode=play
User-Agent: gortsplib

2021/06/17 07:12:13 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 4
Session: 33321649852;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=14186-14187;server_port=20620-20621;ssrc=522955AB
X-Dynamic-Rate: 1

2021/06/17 07:12:13 D [0/0] [path cam1] [rtsp source] c->s PLAY rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/", response="21fe5a5661414d3ef72ea7312cdbc567"
CSeq: 5
Session: 33321649852
User-Agent: gortsplib

2021/06/17 07:12:13 D [0/0] [path cam1] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 5
RTP-Info: url=trackID=0;seq=21931;rtptime=21931
Session: 33321649852

2021/06/17 07:12:13 I [0/0] [path cam1] [rtsp source] ready
2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 200 OK
CSeq: 3
Content-Base: rtsp://192.168.1.100:55555/cam1/
Content-Length: 288
Content-Type: application/sdp
Server: gortsplib

v=0
o=- 0 0 IN IP4 127.0.0.1
s=Stream
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640029;sprop-parameter-sets=Z2QAKaw0zgeAIn5cBbgICAoAAAfQAAGGodDAAQR4AAQR4XeXGhgAII8AAII8LvLhQAA=,aO48MAA=
a=control:trackID=0

2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [c->s] SETUP rtsp://192.168.1.100:55555/cam1/trackID=0 RTSP/1.0
CSeq: 4
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:13 I [0/0] [RTSP] [session 3370654125] opened by 192.168.1.10:41412
2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 461 Unsupported Transport
CSeq: 4
Server: gortsplib

2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [c->s] SETUP rtsp://192.168.1.100:55555/cam1/trackID=0 RTSP/1.0
CSeq: 5
Transport: RTP/AVP;unicast;client_port=37358-37359
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:13 I [0/0] [RTSP] [session 883606015] opened by 192.168.1.10:41412
2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 200 OK
CSeq: 5
Server: gortsplib
Session: 4076820959
Transport: RTP/AVP;unicast;client_port=37358-37359;server_port=8000-8001

2021/06/17 07:12:13 D [0/0] [RTSP] [conn 192.168.1.10:41412] [c->s] PLAY rtsp://192.168.1.100:55555/cam1/ RTSP/1.0
CSeq: 6
Range: npt=0.000-
Session: 4076820959
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:13 I [0/1] [RTSP] [session 883606015] is reading from path 'cam1', 1 track with UDP
2021/06/17 07:12:13 D [0/1] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 200 OK
CSeq: 6
Server: gortsplib
Session: 4076820959

2021/06/17 07:12:43 D [0/1] [path cam1] [rtsp source] c->s OPTIONS rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
Authorization: Digest username="user1", realm="Login to 2K02A98PBA00001", nonce="ca1b61053e367c323cab5941f12cdddd", uri="rtsp://192.168.2.30:55555/cam/realmonitor?channel=1&subtype=0/", response="c73dfa2fc7255750783505154f0fcd29"
CSeq: 6
Session: 33321649852
User-Agent: gortsplib

2021/06/17 07:12:43 D [0/1] [path cam1] [rtsp source] s->c RTSP/1.0 0 

2021/06/17 07:12:52 D [0/1] [RTSP] [conn 192.168.1.10:41412] [c->s] TEARDOWN rtsp://192.168.1.100:55555/cam1/ RTSP/1.0
CSeq: 7
Session: 4076820959
User-Agent: LibVLC/3.0.12 (LIVE555 Streaming Media v2018.11.26)

2021/06/17 07:12:52 D [0/1] [RTSP] [conn 192.168.1.10:41412] [s->c] RTSP/1.0 200 OK
CSeq: 7
Server: gortsplib
Session: 4076820959

2021/06/17 07:12:52 I [0/0] [RTSP] [session 883606015] closed
2021/06/17 07:12:52 I [0/0] [RTSP] [conn 192.168.1.10:41412] closed
2021/06/17 07:12:52 I [0/0] [RTSP] [session 3370654125] closed
dorinclisu commented 3 years ago

Alright, so it looks like the invalid chars originate in ffmpeg when making the SETUP request (User-Agent: Lavfxx.xx.xxx). Can you share what version of fffmpeg you are running and the exact command?

I cannot replicate the issue with ffmpeg 4.1.6-1~deb10u1 and command ffmpeg -i rtsp://localhost:8554/test. And the logs look fine:

2021/06/17 10:26:35 D [0/0] [RTSP] [conn 127.0.0.1:55010] [c->s] SETUP rtsp://localhost:8554/test/trackID=0 RTSP/1.0
CSeq: 4
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
User-Agent: Lavf58.20.100

2021/06/17 10:26:35 I [0/0] [RTSP] [session 2602881891] opened by 127.0.0.1:55010
2021/06/17 10:26:35 D [0/0] [RTSP] [conn 127.0.0.1:55010] [s->c] RTSP/1.0 200 OK
CSeq: 4
Server: gortsplib
Session: 4281480099
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=24737E2D
dorinclisu commented 3 years ago

Sorry, I just now realized you said you are using Kodi client.

Then it follows that this client is using ffmpeg library under the hood, patched in some (wrong) way. I would open an issue on https://github.com/kodi-pvr/pvr.iptvsimple and attach the following logs:

2021/06/12 19:48:04 D [0/0] [RTSP] [conn 192.168.1.10:55804] [c->s] SETUP rtsp://192.168.1.100:55555/cam1/trackID=0 RTSP/1.0
CSeq: 3
Transport: ����RTP/AVP/UDP;unicast;client_port=10542-10543
User-Agent: Lavf58.45.100

2021/06/12 19:48:04 I [0/0] [RTSP] [session 167815548] opened by 192.168.1.10:55804
2021/06/12 19:48:04 D [0/0] [RTSP] [conn 192.168.1.10:55804] [s->c] RTSP/1.0 400 Bad Request
CSeq: 3
Server: gortsplib

It might also be possible to workaround by patching the server but I cannot speak about that, waiting for @aler9's opinion.

wallacebw commented 3 years ago

if It helps I am also encountering this on KODI:

ERR: invalid transport header: protocol not found (-1RTP/AVP/UDP;unicast;client_port=12196-12197)

jokay commented 3 years ago

It did work once, I may test some previous releases to be able to determine until which release it worked.

jokay commented 3 years ago

No luck using ...

... not sure if any workaround (server-side) can work for this case.

aler9 commented 3 years ago

I tested rtsp-simple-server with Kodi and PVR IPTV Simple Client and it works flawlessly.

I used:

Steps to reproduce: 1) download, configure and start rtsp-simple-server 2) install Kodi with sudo apt install kodi 3) install IPTV Simple Client with sudo apt install kodi-pvr-iptvsimple 4) create a m3u8 file with this content

```
#EXTINF:-1,hr-fernsehen HD
#EXTVLCOPT:network-caching=1000
rtsp://localhost:8554/stream
```

5) enable the IPTV Simple Client addon and configure it a) general -> location, select Local Path b) general -> M3U8 Play List Local Path -> choose the file created in the passage above

6) restart Kodi, open the channel

Please check the OS / Kodi / IPTV Simple Client version and architecture and update any outdated component. If there are no further problems, i'll close the issue in a couple of days.

jokay commented 3 years ago

@aler9 I use Kodi on an Nvidia Shield TV Pro (Android TV based OS, ARM CPU) so the result may be different.

As already mentionned it was working before and there were no configuration changes on the client side for about 10 months.

May be an update for Kodi or kodi-pvr-iptvsimple did break the functionality, who knows.

May be a server-side workaround on rtsp-simple-server could make it work again.

Auto-Updates on the Android TV system are enabled but beside this the possiblities are very limited.

Anyway feel free to close the issue if you don't see a possible server-side workaround or if the issue annoys you :wink:

wallacebw commented 3 years ago

Same issue and it would be very helpful if this could be fixed, as I am trying to leverage ffmpeg to create a montage view of 12 security cameras. Everything works great in vlc, but not so much in kodi.

I'm happy to reach out to the Kodi team, but don't know exactly what the correct transport header woud be. Thoughts?

ERR: invalid transport header: protocol not found (-1RTP/AVP/UDP;unicast;client_port=23722-23723)

Here's the client config: OS: Linux 5.12.13-arch1-2 #1 SMP PREEMPT Fri, 25 Jun 2021 22:56:51 +0000 GNU/Linux

Kodi Versions: local/kodi-addon-inputstream-adaptive 2.6.17-1 (kodi-addons kodi-addons-inputstream) local/kodi-addon-inputstream-rtmp 3.4.0-2 (kodi-addons kodi-addons-inputstream) local/kodi-addon-pvr-iptvsimple 7.6.5-1 (kodi) local/kodi-common 19.1-1 local/kodi-platform 20190726.809c5e9-23 local/kodi-x11 19.1-1 local/p8-platform 2.1.0.1-4

Anything that you can do is greatly appreciated.

aler9 commented 3 years ago

The right Transport header is

RTP/AVP/UDP;unicast;client_port=23722-23723

It seems that the Kodi addon adds some random stuff to it as prefix. It's not a custom syntax (in this case it could have been supported), it's just random stuff (in one case it's -1, in another it's some random characters).

Therefore, it's not a server problem, and there's nothing that can be done about it here. Please contact the Kodi / iptv-simple-client team, or downgrade Kodi / iptv-simple-client and use the version i posted above.

wallacebw commented 3 years ago

FYi: opened a post on the kodi forum as a 1st step. https://forum.kodi.tv/showthread.php?tid=363330

Thanks again.

github-actions[bot] commented 1 year ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.