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 media description 'metadata' #474

Closed
svk23 opened this issue Dec 1, 2023 · 5 comments · Fixed by #478
Closed

Invalid media description 'metadata' #474

svk23 opened this issue Dec 1, 2023 · 5 comments · Fixed by #478

Comments

@svk23
Copy link

svk23 commented Dec 1, 2023

We are trying to record a RTSP stream using Media-MTX, but an error is thrown due to an invalid media description field with the value: 'metadata':

2023/12/01 13:23:42 ERR [path test] [RTSP source] invalid SDP: sdp: invalid value `metadata`

The SDP response contains the following section:

m=metadata 0 RTP/AVP 98
c=IN IP4 0.0.0.0
b=AS:1000
a=rtpmap:98 METADATA/90000
a=control:track2
a=x-onvif-track:track2
a=x-bufferdelay:1.000000

The sdp.go only the values described in RFC 4566 are allowed and therefore the error is thrown and the stream is not valid. If we add the value metadata to sdp.go the stream is recorded as intended. Would it be possible to add this value, or if not: could you let us know if it is save to add the value even though its not specified in the RFC? Our change looks something like this:

// <media>
// Set according to currently registered with IANA
// https://tools.ietf.org/html/rfc4566#section-5.14
if fields[0] != "video" &&
	fields[0] != "audio" &&
	fields[0] != "application" &&
	fields[0] != "metadata" &&
	!strings.HasPrefix(fields[0], "application/") {
	return fmt.Errorf("%w `%v`", errSDPInvalidValue, fields[0])
}
@aler9
Copy link
Member

aler9 commented Dec 1, 2023

Hello, the SDP parser can be adjusted to support the text you provided, but can you write the manufacturer and the model of the device (camera or NVR) that is generating it?

@svk23
Copy link
Author

svk23 commented Dec 2, 2023

I believe this example came from an (older) UDP Technology dome camera, but I am unsure about the exact model.

@aler9
Copy link
Member

aler9 commented Dec 2, 2023

Fixed with #478

@svk23
Copy link
Author

svk23 commented Dec 4, 2023

Adapted Media-MTX to use gortsplib v4.6.1 and tested with the UDP technology cameras. The streams are accepted and recorded as expected. Thanks for the quick fix!

Copy link

github-actions bot commented Jun 7, 2024

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 Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants