如何获得h264视频流的分辨率

时间:2018-01-25 08:51:41

标签: video-streaming sip h.264 sdp

我正在做SIP客户端并遇到一些问题。 我通过SIP服务器邀请用户,并从中获取SDP参数。 但是,用户客户端(MicroSip)未在SDP中发送sdprop-params。 此外,它也没有在RTP流中发送SPS / PPS切片。

如何以这种方式获取图片参数?

Wireshark转储

        Session Description Protocol
            Session Description Protocol Version (v): 0
            Owner/Creator, Session Id (o): - 1516869540 1516869540 IN IP4 172.16.50.175
            Session Name (s): mss
            Connection Information (c): IN IP4 172.16.50.175
            Time Description, active time (t): 0 0
            Media Description, name and address (m): audio 4000 RTP/AVP 97 100
            Connection Information (c): IN IP4 172.16.50.175
            Media Attribute (a): rtcp:4001 IN IP4 172.16.50.175
                Media Attribute Fieldname: rtcp
                Media Attribute Value: 4001 IN IP4 172.16.50.175
            Media Attribute (a): sendrecv
            Media Attribute (a): rtpmap:97 opus/48000/2
                Media Attribute Fieldname: rtpmap
                Media Format: 97
                MIME Type: opus
                Sample Rate: 48000
            Media Attribute (a): fmtp:97 maxplaybackrate=24000
                Media Attribute Fieldname: fmtp
                Media Format: 97 [opus]
                Media format specific parameters: maxplaybackrate=24000
            Media Attribute (a): rtpmap:100 telephone-event/8000
                Media Attribute Fieldname: rtpmap
                Media Format: 100
                MIME Type: telephone-event
                Sample Rate: 8000
            Media Attribute (a): fmtp:100 0-16
                Media Attribute Fieldname: fmtp
                Media Format: 100 [telephone-event]
                Media format specific parameters: 0-16
            Media Description, name and address (m): video 4002 RTP/AVP 97
            Connection Information (c): IN IP4 172.16.50.175
            Media Attribute (a): rtcp:4003 IN IP4 172.16.50.175
                Media Attribute Fieldname: rtcp
                Media Attribute Value: 4003 IN IP4 172.16.50.175
            Media Attribute (a): sendrecv
            Media Attribute (a): rtpmap:97 H264/90000
                Media Attribute Fieldname: rtpmap
                Media Format: 97
                MIME Type: H264
                Sample Rate: 90000
            Media Attribute (a): fmtp:97 profile-level-id=42801e; packetization-mode=0
                Media Attribute Fieldname: fmtp
                Media Format: 97 [H264]
                Media format specific parameters: profile-level-id=42801e
                    Profile: 42801e
                Media format specific parameters: packetization-mode=0
                    [Packetization mode: Single NAL mode (0)]

2 个答案:

答案 0 :(得分:0)

Сlient每1秒发送一次SPS / PPS slicec,你必须等待。

答案 1 :(得分:0)

SPS / PPS只能在启动时发送,而不能再依赖于视频发送方。例如Polycom VVX视频电话

从SDP中,您只能根据Profile值找到最大比特率,这将限制可以接收的内容。请注意我说

42801e的配置文件值为:

因此,这将定义最大比特率和基于该比特率的可能分辨率作为级别的支持以及配置文件(CBP)支持的H264功能。

要强制向您发送SPS / PPS,可以按照RFC5168向视频发件人发送媒体控制命令。当您检测到丢弃的数据包或用户请求它时,您应该发送其中一个(例如,用户看到损坏的图片并指示他们想要刷新)。如果你愿意,你可以定期发送它们。