SDP "a=control" 字段:streamID 还是 trackID?
SDP "a=control" field: streamID or trackID?
在 RTSP 中,SDP 用于描述可用流。如果有多个流,例如音频和视频流,可以使用a=control:<...>
来区分它们。
网上找到的例子中,常用的有两种形式:
a=control:streamid=Foo
a=control:trackID=Bar
我想弄清楚这些是如何工作的。我目前的假设是:
The RTSP server chooses what to use. The client must use the exact,
literal string that follows a=control:
as a relative URL for the
particular stream (relative to the base URL of the SDP).
The two common forms
are just conventions that people are copying from each other. Both are
allowed, as they're just special cases of valid relative URLs. An
RTSP client must support both, and in fact
a=control:A226DA96-BCC1-4563-89C0-927F1EAFE28E
is equally valid.
这个假设在形式上是否正确,在实践中是否可行?或者是否有常见的 RTSP 客户端对允许的内容有更狭隘的认识?
你的假设大部分是正确的。 "a=control:" 之后的所有内容都必须是相对 URI 或绝对 URI(您喜欢哪个)。客户端应该进行调整,具体取决于它是否在 URI 的开头找到 RTSP 模式(绝对)或没有(相对)。
此外,当使用相对 URI(如您的两个示例)时,客户端应该能够在 "a=control:" 之后接收任何内容,只要它仅包含 RTSP URI 的有效字符即可。 "streamid" 和 "trackID" 对客户端没有意义。它应该采用整个字符串("streamid=Foo" 或 "trackID=Bar")并将其附加到基本 RTSP URI。 "A226DA96-BCC1-4563-89C0-927F1EAFE28E" 也适用于任何标准 RTSP 客户端。
您可以在 RTSP 的 RFC 中找到更多详细信息:https://www.ietf.org/rfc/rfc2326.txt(第 C.1.1 节)
在 RTSP 中,SDP 用于描述可用流。如果有多个流,例如音频和视频流,可以使用a=control:<...>
来区分它们。
网上找到的例子中,常用的有两种形式:
a=control:streamid=Foo
a=control:trackID=Bar
我想弄清楚这些是如何工作的。我目前的假设是:
The RTSP server chooses what to use. The client must use the exact, literal string that follows
a=control:
as a relative URL for the particular stream (relative to the base URL of the SDP).The two common forms are just conventions that people are copying from each other. Both are allowed, as they're just special cases of valid relative URLs. An RTSP client must support both, and in fact
a=control:A226DA96-BCC1-4563-89C0-927F1EAFE28E
is equally valid.
这个假设在形式上是否正确,在实践中是否可行?或者是否有常见的 RTSP 客户端对允许的内容有更狭隘的认识?
你的假设大部分是正确的。 "a=control:" 之后的所有内容都必须是相对 URI 或绝对 URI(您喜欢哪个)。客户端应该进行调整,具体取决于它是否在 URI 的开头找到 RTSP 模式(绝对)或没有(相对)。
此外,当使用相对 URI(如您的两个示例)时,客户端应该能够在 "a=control:" 之后接收任何内容,只要它仅包含 RTSP URI 的有效字符即可。 "streamid" 和 "trackID" 对客户端没有意义。它应该采用整个字符串("streamid=Foo" 或 "trackID=Bar")并将其附加到基本 RTSP URI。 "A226DA96-BCC1-4563-89C0-927F1EAFE28E" 也适用于任何标准 RTSP 客户端。
您可以在 RTSP 的 RFC 中找到更多详细信息:https://www.ietf.org/rfc/rfc2326.txt(第 C.1.1 节)