Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"[rtsp source] ERR: invalid transport header: invalid source ()" failure when server is opening an RTSP stream from a camera introduced at 0.18.0. #986

Closed
1 task done
pkerney opened this issue Jun 10, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@pkerney
Copy link

pkerney commented Jun 10, 2022

Which version are you using?

v0.17.17 -> 0.18.0 and higher

Which operating system are you using?

  • Linux amd64 standard

Describe the issue

When using RTSP camera (the camera is a little old) the server used to be able to open the stream and proxy it. Some change introduced to version 0.18.0 now throws a "[rtsp source] ERR: invalid transport header: invalid source ()" and server will not proxy the stream.
The camera stream is being authenticated using digest authentication in the RTSP URI.
I went back through several of the releases and the issue appeared at the transition from 0.17.17 to 0.18.0.
Not sure if this is a bug or just an unsupported camera or a camera that doesn't return the correct information. Adding it as a bug because it used to work.

Describe how to replicate the issue

# rtsp-simple-server.yml
paths:
  garage:
    source: rtsp://XXXX:XXXX@10.1.1.21/live/0/MAIN

VLC can open this URI.
Start rtsp-simple-server

Obfuscated some of the parameters with XXXX, not sure which ones are important.
This is the server debug log of a failing open, a subset of a working open/proxy is further below.

pkerney@quartz:~/rtsp$ ./rtsp-simple-server rtsp-simple-server.yml.good 
2022/06/10 13:34:11 INF rtsp-simple-server v0.18.0
2022/06/10 13:34:11 INF [metrics] listener opened on 127.0.0.1:9998
2022/06/10 13:34:11 DEB [path garage] created
2022/06/10 13:34:11 DEB path manager created
2022/06/10 13:34:11 INF [path garage] [rtsp source] started
2022/06/10 13:34:11 INF [RTSP] listener opened on :7554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2022/06/10 13:34:11 DEB [path garage] [rtsp source] connecting
2022/06/10 13:34:11 INF [RTMP] listener opened on :1935
2022/06/10 13:34:11 INF [HLS] listener opened on :8888
2022/06/10 13:34:11 INF [API] listener opened on 127.0.0.1:9997
2022/06/10 13:34:11 DEB [path garage] [rtsp source] c->s OPTIONS rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
CSeq: 1
User-Agent: gortsplib


2022/06/10 13:34:11 DEB [path garage] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 1
Cache-Control: no-cache
Content-Length: 0
Public: OPTIONS, DESCRIBE, SET_PARAMETER, SETUP, PLAY, PAUSE, TEARDOWN, GET_PARAMETER
Server: RtpRtspFlyer


2022/06/10 13:34:11 DEB [path garage] [rtsp source] c->s DESCRIBE rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: gortsplib


2022/06/10 13:34:12 DEB [path garage] [rtsp source] s->c RTSP/1.0 401 Unauthorized
CSeq: 2
Server: RtpRtspFlyer
WWW-Authenticate: Digest realm="turing",nonce="b6d9516e9XXXXd69df3222"
WWW-Authenticate: Basic realm="/"


2022/06/10 13:34:12 DEB [path garage] [rtsp source] c->s DESCRIBE rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
Accept: application/sdp
Authorization: Digest username="XXXX", realm="turing", nonce="b6d9516XXXX9df3222", uri="rtsp://10.1.1.21/live/0/MAIN", response="78acb1XXXX5c6e673"
CSeq: 3
User-Agent: gortsplib


2022/06/10 13:34:12 DEB [path garage] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 3
Content-Base: rtsp://10.1.1.21/live/0/MAIN
Content-Length: 493
Content-Type: application/sdp
Server: RtpRtspFlyer

v=0
o=RTSP 1659513XXXX16416 16595XXXX61809 IN IP4 
s=RTSP Server
e=NONE
t=0 0
a=recvonly
a=x-dimensions:1920,1080
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=64002a;sprop-parameter-sets=Z2QAKqwsaoHgCJ+WbgICAgQ=,aO4xshs=
a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0
b=AS:5000
a=control:rtsp://10.1.1.21/live/0/MAIN/trackID=0

2022/06/10 13:34:12 DEB [path garage] [rtsp source] c->s SETUP rtsp://10.1.1.21/live/0/MAIN/trackID=0 RTSP/1.0
Authorization: Digest username="XXXX", realm="turing", nonce="b6d9516XXXXd69df3222", uri="rtsp://10.1.1.21/live/0/MAIN/trackID=0", response="b3a04ae7XXXX9ee411e"
CSeq: 4
Transport: RTP/AVP;unicast;client_port=32560-32561;mode=play
User-Agent: gortsplib


2022/06/10 13:34:12 DEB [path garage] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 4
Cache-Control: no-cache
Server: RtpRtspFlyer
Session: 830717776
Transport: RTP/AVP/UDP;unicast;source=;client_port=32560-32561;server_port=3046-3047;ssrc=45dcb578


2022/06/10 13:34:12 INF [path garage] [rtsp source] ERR: invalid transport header: invalid source ()
^C2022/06/10 13:34:16 INF shutting down gracefully
2022/06/10 13:34:16 INF [path garage] [rtsp source] stopped
2022/06/10 13:34:16 DEB [path garage] destroyed (terminated)
2022/06/10 13:34:16 INF [API] listener is closing
2022/06/10 13:34:16 INF [RTSP] listener is closing
2022/06/10 13:34:16 DEB path manager is shutting down
2022/06/10 13:34:16 INF [HLS] listener is closing
2022/06/10 13:34:16 INF [RTMP] listener is closing
2022/06/10 13:34:16 INF [metrics] listener is closing
2022/06/10 13:34:16 INF waiting for external commands
pkerney@quartz:~/rtsp$ 

For a good session with v0.17.17 we get

2022/06/10 13:48:38 DEB [path garage] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 4
Cache-Control: no-cache
Server: RtpRtspFlyer
Session: 348403432
Transport: RTP/AVP/UDP;unicast;source=;client_port=16176-16177;server_port=3050-3051;ssrc=eeb7ed41


2022/06/10 13:48:38 INF [path garage] [rtsp source] ready
2022/06/10 13:48:38 DEB [path garage] [rtsp source] c->s PLAY rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
Authorization: Digest username="XXXX", realm="turing", nonce="7cbddc704XXXXa6c2f6d2", uri="rtsp://10.1.1.21/live/0/MAIN", response="db2a93XXXX1f1cc41e9"
CSeq: 5
Range: npt=0-
Session: 348403432
User-Agent: gortsplib


2022/06/10 13:48:38 DEB [path garage] [rtsp source] s->c RTSP/1.0 200 OK
CSeq: 5
Server: RtpRtspFlyer
Session: 348403432


2022/06/10 13:49:08 DEB [path garage] [rtsp source] c->s GET_PARAMETER rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
Authorization: Digest username="XXXX", realm="turing", nonce="7cbddc704XXXXc2f6d2", uri="rtsp://10.1.1.21/live/0/MAIN", response="37f53ffff3XXXXb2397bdb"
CSeq: 6
Session: 348403432
User-Agent: gortsplib


2022/06/10 13:49:08 DEB [path garage] [rtsp source] s->c RTSP/1.0 0 


2022/06/10 13:49:38 DEB [path garage] [rtsp source] c->s GET_PARAMETER rtsp://10.1.1.21/live/0/MAIN RTSP/1.0
Authorization: Digest username="XXXX", realm="turing", nonce="7cbddc70XXXXca6c2f6d2", uri="rtsp://10.1.1.21/live/0/MAIN", response="37f53fffXXXX2397bdb"
CSeq: 7
Session: 348403432
User-Agent: gortsplib


2022/06/10 13:49:38 DEB [path garage] [rtsp source] s->c RTSP/1.0 0 

Did you attach the server logs?

yes - inline above

Did you attach a network dump?

no

@aler9 aler9 added the bug Something isn't working label Jun 11, 2022
aler9 added a commit to bluenviron/gortsplib that referenced this issue Jun 11, 2022
@pkerney
Copy link
Author

pkerney commented Jun 24, 2022

Tried v0.19.1-18-gf41e595_linux_amd64.tar.gz from another thread and issue is resolved.

@aler9
Copy link
Member

aler9 commented Jun 24, 2022

fixed in v0.19.2.

@aler9 aler9 closed this as completed Jun 24, 2022
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants