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

Invalid SDP: media 1 is invalid: invalid AAC config: otherDataPresent is not supported error using gstreamer avenc_aac plugin #1881

Closed
1 of 13 tasks
gpantazis opened this issue May 30, 2023 · 4 comments
Labels
bug Something isn't working rtsp

Comments

@gpantazis
Copy link

Which version are you using?

v0.23.3 (tested on all version up to v0.22.0 which did NOT have this issue)

Which operating system are you using?

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (please describe)

Describe the issue

If audio is encoded using particular configurations (opaque to me as a user), the RTSP server closes the stream as it complains of an invalid SDP. Specifically the issue seems to be something regarding the otherDataPresent configuration option not being supported (I presume by a new SDP parser/library/engine?). I encounter this issue when I encoded audio using the gstreamer avenc_aac plugin. If I use a seperate plugin, e.g mfaacenc then I do not get this issue. I pressume it is specific

Issue in v0.23.0+

2023/05/30 13:53:26 INF MediaMTX / rtsp-simple-server v0.23.3
2023/05/30 13:53:26 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2023/05/30 13:53:26 INF [API] listener opened on 127.0.0.1:9997
2023/05/30 13:53:30 INF [RTSP] [conn [::1]:63174] opened
2023/05/30 13:53:30 INF [RTSP] [session c709c40f] created by [::1]:63174
2023/05/30 13:53:30 INF [RTSP] [conn [::1]:63174] closed (invalid SDP: media 1 is invalid: invalid AAC config: otherDataPresent is not supported)

This issue could not be replicated with v0.22.0 (Note v0.22.XX for XX>0 exhibit a separate issue with regards to an invalid clock but I have not tested this thoroughly and may be unrelated. It is added here for completeness only)
Issue in v0.22.1+

2023/05/30 13:41:01 INF MediaMTX / rtsp-simple-server v0.22.2
2023/05/30 13:41:01 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2023/05/30 13:41:01 INF [RTMP] listener opened on :1935
2023/05/30 13:41:01 INF [HLS] listener opened on :8888
2023/05/30 13:41:01 INF [WebRTC] listener opened on :8889 (HTTP)
2023/05/30 13:41:04 INF [RTSP] [conn [::1]:52309] opened
2023/05/30 13:41:05 INF [RTSP] [session 6fd4e3d7] created by [::1]:52309
2023/05/30 13:41:05 INF [RTSP] [conn [::1]:52309] closed (invalid SDP: media 1 is invalid: invalid clock: 44100)

Describe how to replicate the issue

  1. Start the mediamtx server in its default configuration
  2. publish with the following gstreamer (v1.22.1) pipeline:
gst-launch-1.0 rtspclientsink name=s location=rtsp://127.0.0.1:8554/mystream audiotestsrc ! audioconvert ! avenc_aac  ! aacparse ! queue ! s.sink_0
  1. The server will report the error above and close the stream.

Did you attach the server logs?

Full debug log of the issue described above is attached below. Other than the error there doesn't seem to be any difference in the generated SDP (other than the obvious random bit like SSRC).

Non Working case:

Gstreamer Pipeline

gst-launch-1.0 rtspclientsink name=s location=rtsp://localhost:8554/mystream audiotestsrc ! audioconvert ! avenc_aac ! aacparse ! queue ! s.sink_0

Server Output

2023/05/30 17:29:26 INF MediaMTX / rtsp-simple-server v0.23.3
2023/05/30 17:29:26 DEB path manager created
2023/05/30 17:29:26 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2023/05/30 17:29:26 INF [RTMP] listener opened on :1935
2023/05/30 17:29:26 INF [HLS] listener opened on :8888
2023/05/30 17:29:26 INF [WebRTC] listener opened on :8889 (HTTP)
2023/05/30 17:29:29 INF [RTSP] [conn [::1]:61973] opened
2023/05/30 17:29:29 DEB [RTSP] [conn [::1]:61973] [c->s] OPTIONS rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 1
Date: Tue, 30 May 2023 21:29:29 GMT
User-Agent: GStreamer/1.22.1


2023/05/30 17:29:29 DEB [RTSP] [conn [::1]:61973] [s->c] RTSP/1.0 200 OK
CSeq: 1
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib


2023/05/30 17:29:29 DEB [RTSP] [conn [::1]:61973] [c->s] ANNOUNCE rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 2
Content-Length: 331
Content-Type: application/sdp
Date: Tue, 30 May 2023 21:29:29 GMT
User-Agent: GStreamer/1.22.1

v=0
o=- 3352577432 1 IN IP6 ::1
s=Session streamed with GStreamer
i=rtspclientsink
t=0 0
a=tool:GStreamer
m=audio 0 RTP/AVP 96
c=IN IP6 ::
a=rtpmap:96 MP4A-LATM/44100
a=fmtp:96 cpresent=0;config=40002410adca00
a=control:stream=0
a=ts-refclk:local
a=mediaclk:sender
a=ssrc:3467864562 cname:user117559148@host-223ffc21

2023/05/30 17:29:29 INF [RTSP] [session 177d01f1] created by [::1]:61973
2023/05/30 17:29:29 DEB [RTSP] [conn [::1]:61973] [s->c] RTSP/1.0 400 Bad Request
CSeq: 2
Server: gortsplib


2023/05/30 17:29:29 INF [RTSP] [conn [::1]:61973] closed (invalid SDP: media 1 is invalid: invalid AAC config: otherDataPresent is not supported)
2023/05/30 17:29:29 INF [RTSP] [session 177d01f1] destroyed (not in use)
2023/05/30 17:29:29 INF [RTSP] [conn [::1]:61974] opened
2023/05/30 17:29:29 INF [RTSP] [conn [::1]:61974] closed (EOF)
2023/05/30 17:29:41 INF shutting down gracefully
2023/05/30 17:29:41 INF [RTSP] listener is closing
2023/05/30 17:29:41 DEB path manager is shutting down
2023/05/30 17:29:41 INF [WebRTC] listener is closing
2023/05/30 17:29:41 INF [HLS] listener is closing
2023/05/30 17:29:41 INF [RTMP] listener is closing
2023/05/30 17:29:41 INF waiting for external commands

Working Case:

Gstreamer Pipeline

gst-launch-1.0 rtspclientsink name=s location=rtsp://localhost:8554/mystream audiotestsrc ! audioconvert ! mfaacenc ! aacparse ! queue ! s.sink_0

Server Output

2023/05/30 17:30:48 INF MediaMTX / rtsp-simple-server v0.23.3
2023/05/30 17:30:48 DEB path manager created
2023/05/30 17:30:48 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2023/05/30 17:30:48 INF [RTMP] listener opened on :1935
2023/05/30 17:30:48 INF [HLS] listener opened on :8888
2023/05/30 17:30:48 INF [WebRTC] listener opened on :8889 (HTTP)
2023/05/30 17:30:52 INF [RTSP] [conn [::1]:49409] opened
2023/05/30 17:30:52 DEB [RTSP] [conn [::1]:49409] [c->s] OPTIONS rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 1
Date: Tue, 30 May 2023 21:30:52 GMT
User-Agent: GStreamer/1.22.1


2023/05/30 17:30:52 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 1
Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN
Server: gortsplib


2023/05/30 17:30:52 DEB [RTSP] [conn [::1]:49409] [c->s] ANNOUNCE rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 2
Content-Length: 326
Content-Type: application/sdp
Date: Tue, 30 May 2023 21:30:52 GMT
User-Agent: GStreamer/1.22.1

v=0
o=- 1841233394 1 IN IP6 ::1
s=Session streamed with GStreamer
i=rtspclientsink
t=0 0
a=tool:GStreamer
m=audio 0 RTP/AVP 96
c=IN IP6 ::
a=rtpmap:96 MP4A-LATM/44100
a=fmtp:96 cpresent=0;config=40002410
a=control:stream=0
a=ts-refclk:local
a=mediaclk:sender
a=ssrc:1523807563 cname:user3561617388@host-9204de04

2023/05/30 17:30:52 INF [RTSP] [session 82c08cc7] created by [::1]:49409
2023/05/30 17:30:52 DEB [path mystream] created
2023/05/30 17:30:52 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 2
Server: gortsplib


2023/05/30 17:30:52 DEB [RTSP] [conn [::1]:49409] [c->s] SETUP rtsp://localhost:8554/mystream/stream=0 RTSP/1.0
CSeq: 3
Date: Tue, 30 May 2023 21:30:52 GMT
Transport: RTP/AVP/UDP;unicast;client_port=54114-54115;mode=RECORD
User-Agent: GStreamer/1.22.1


2023/05/30 17:30:53 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 3
Server: gortsplib
Session: a2ea1583a89748fc8959721255f22907
Transport: RTP/AVP;unicast;client_port=54114-54115;server_port=8000-8001


2023/05/30 17:30:53 DEB [RTSP] [conn [::1]:49409] [c->s] RECORD rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 4
Date: Tue, 30 May 2023 21:30:53 GMT
Session: a2ea1583a89748fc8959721255f22907
User-Agent: GStreamer/1.22.1


2023/05/30 17:30:53 INF [RTSP] [session 82c08cc7] is publishing to path 'mystream', with UDP, 1 track (MPEG4-audio-latm)
2023/05/30 17:30:53 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 4
Server: gortsplib
Session: a2ea1583a89748fc8959721255f22907


2023/05/30 17:30:58 DEB [RTSP] [conn [::1]:49409] [c->s] PAUSE rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 5
Date: Tue, 30 May 2023 21:30:58 GMT
Session: a2ea1583a89748fc8959721255f22907
User-Agent: GStreamer/1.22.1


2023/05/30 17:30:58 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 5
Server: gortsplib
Session: a2ea1583a89748fc8959721255f22907


2023/05/30 17:30:58 DEB [RTSP] [conn [::1]:49409] [c->s] TEARDOWN rtsp://localhost:8554/mystream RTSP/1.0
CSeq: 6
Date: Tue, 30 May 2023 21:30:58 GMT
Session: a2ea1583a89748fc8959721255f22907
User-Agent: GStreamer/1.22.1


2023/05/30 17:30:58 DEB [path mystream] destroyed (not in use)
2023/05/30 17:30:58 DEB [RTSP] [conn [::1]:49409] [s->c] RTSP/1.0 200 OK
CSeq: 6
Server: gortsplib


2023/05/30 17:30:58 INF [RTSP] [session 82c08cc7] destroyed (torn down by [::1]:49409)
2023/05/30 17:30:58 INF [RTSP] [conn [::1]:49409] closed (read tcp [::1]:8554->[::1]:49409: wsarecv: An existing connection was forcibly closed by the remote host.)
2023/05/30 17:30:59 INF shutting down gracefully
2023/05/30 17:30:59 INF [RTSP] listener is closing
2023/05/30 17:30:59 DEB path manager is shutting down
2023/05/30 17:30:59 INF [WebRTC] listener is closing
2023/05/30 17:30:59 INF [HLS] listener is closing
2023/05/30 17:30:59 INF [RTMP] listener is closing
2023/05/30 17:30:59 INF waiting for external commands

Did you attach a network dump?

no

@aler9
Copy link
Member

aler9 commented May 31, 2023

Thanks for reporting the issue and the log, this is fixed by bluenviron/mediacommon#18

aler9 added a commit to bluenviron/mediacommon that referenced this issue May 31, 2023
aler9 added a commit to bluenviron/mediacommon that referenced this issue May 31, 2023
@gpantazis
Copy link
Author

@aler9 Thank you for the great piece of software you have released! With that said, and hopefully without sounding ungrateful for the super fast fix, do you have any idea when the next release that incorporates this will be available (roughly obviously I am not looking for some hard commitment)? I am trying to coordinate something with a less tech-savvy end user so want to avoid building from source :)

Feel free to close this of course unless you want to keep it open until the next release can be tested!

@aler9
Copy link
Member

aler9 commented Jun 2, 2023

added in v0.23.4

@aler9 aler9 closed this as completed Jun 2, 2023
Copy link
Contributor

github-actions bot commented Dec 6, 2023

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 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working rtsp
Projects
None yet
Development

No branches or pull requests

2 participants