3

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?

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Novalis
  • 2,265
  • 6
  • 39
  • 63

1 Answers1

3

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.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Ralf
  • 9,405
  • 2
  • 28
  • 46
  • 1
    I think that in more often resolution/dimensions are not available via X-Dimensions, however they are available with parameter sets provided with SDP. Still, the most reliable source of the information, and sometimes it is the only source, is the bitstream itself and parameter sets embedded there. BTW there is nothing actually preventing RTSP source to change resolution right on the fly. – Roman R. Oct 25 '11 at 19:47