从 RTP 数据包或 Rtsp 服务器获取视频宽度高度
我必须获取流视频 [来自 rtsp 服务器] 的宽度和高度。
第三方服务器在 RTSP DESCRIBE REQUEST 中提供以下信息:
一个 RTSP 服务器提供宽度-高度
Server Response:
RTSP/1.0 200 OK
....
Content-Type: application/sdp
Content-Length: 376
a=x-dimensions:1280,1024 // GET WIDTH HEIGHT
....
a=x-尺寸:1280,1024
但是对方没有给我宽度/高度信息.... 看来它支持ONVIF...
Server Response:
RTSP/1.0 200 OK
x-Accept-Dynamic-Rate: 1
...
Content-Length: 625
...
m=video 0 RTP/AVP 96
i=Video channel in H264 VBR format
a=mpeg4-esid:201
a=control:trackID=0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640032;....
m=application 0 RTP/AVP 107
i=ONVIF metadata
a=control:events
a=sendonly
a=rtpmap:107 vnd.onvif.metadata/90000
无论如何/获取流宽度高度的方法?
I have to get stream video [which is from rtsp server] width and height.
Third party servers give the following info at RTSP DESCRIBE REQUEST:
One RTSP server give me width-height
Server Response:
RTSP/1.0 200 OK
....
Content-Type: application/sdp
Content-Length: 376
a=x-dimensions:1280,1024 // GET WIDTH HEIGHT
....
a=x-dimensions:1280,1024
But the other does not give me width/height info.... It seems that it supports ONVIF...
Server Response:
RTSP/1.0 200 OK
x-Accept-Dynamic-Rate: 1
...
Content-Length: 625
...
m=video 0 RTP/AVP 96
i=Video channel in H264 VBR format
a=mpeg4-esid:201
a=control:trackID=0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640032;....
m=application 0 RTP/AVP 107
i=ONVIF metadata
a=control:events
a=sendonly
a=rtpmap:107 vnd.onvif.metadata/90000
Anyway/method to get stream width-height?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
宽度和高度可以从 H.264 序列参数集中提取,该参数集通常是 DESCRIBE 响应中 SDP 的 fmtp 行的一部分。请参阅 cipi 发布的这篇很有帮助的帖子。
Width and height can be extracted from the H.264 sequence parameters set, which is usually part of the fmtp line of the SDP in the DESCRIBE response. See this helpful SO post by cipi.