Getting video width height from RTP Packets or Rtsp Server

醉酒当歌 提交于 2019-12-07 13:44:56

问题


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?Suggestions...

Best Wishes


回答1:


Width and height can be extracted from the H.264 sequence parameters set, which is is usually part of the fmtp line of the SDP in the DESCRIBE response. See this helpful SO post by cipi.



来源:https://stackoverflow.com/questions/7891517/getting-video-width-height-from-rtp-packets-or-rtsp-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!