sprop-parameter-sets或profile-level-id是解码H264所需的SDP参数吗? [英] Is sprop-parameter-sets or profile-level-id the SDP parameter required to decode H264?

查看:763
本文介绍了sprop-parameter-sets或profile-level-id是解码H264所需的SDP参数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试理解SDP中的什么参数,以便能够从RTP数据包中解码H264.

这与此问题有关,因为该答案仅在少数情况下有效. /p>

示例

我正在使用以下命令从VLC流式传输.

vlc -vvv sample_video/big_buck_bunny_480p_h264.mov --sout '#transcode{vcodec=h264,vb=700,fps=20,scale=0.25,acodec=none}:rtp{dst=10.5.110.117,port=5004,ttl=1}'

这会将视频转码为:

  • 比特率:700kbps
  • 帧频:每秒20
  • 分辨率:原始分辨率的25%

接收器正确地接受和解释具有以下SDP文件的流(删除第一行,只是名称).

//test.sdp
c=IN IP4 10.5.110.117
m=video 5004 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=640014;sprop-parameter-sets=Z2QAFKzZQ0R+f/zBfMMAQAAAAwBAAAAKI8UKZYA=,aOvssiw=;

要运行的命令:vlc test.sdp

此处可用的文档,在第7.2章中称为 SIP视频配置文件最佳做法.对于配置文件级别ID状态:

个人资料级别ID

尽管在RFC 6184中被指定为可选(所有参数一样),但 "profile-level-id"参数是编解码器设置的基础, 并且对于指定任何其他参数也是必需的.因此 所有实现都应在其SDP中包含此参数,并且 收到时应解释它.如果不包括在内,则默认 值是RFC 6184中指定的420010.

同一文档针对 sprop-parameter-sets 设置了以下内容:

属性参数集

H.264允许序列和图片信息都在带内发送, 和带外. SIP视频实施应发出信号 带内信息,符合H.323和 绝大多数现有的SIP视频实现,以及 因此不应包含此参数.

问题1

即使删除profile-level-id,视频也可以在接收器上正确解释.

//test.sdp
c=IN IP4 10.5.110.117
m=video 5004 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 sprop-parameter-sets=Z2QAFKzZQ0R+f/zBfMMAQAAAAwBAAAAKI8UKZYA=,aOvssiw=;

在没有sprop-parameter-sets的情况下 无效.

问题2

我一直在绕线不同的RTCP,SIP和SAP,并且SDP 通常包含sprop-parameter-sets.

问题

  • 请解释两个参数的含义和区别
  • 根据上述问题的答案,解释问题中发生的对比

解决方案

含义和主要区别:

如您在profile-level-id的定义中所见,它具有默认值,因此可以在信令协商中省略.此参数中包含的字符串为十六进制格式,并且具有3个字节解码器有关配置文件,约束和级别,将用于发送数据.此设置定义了几个参数,例如比特率,分辨率,数据包类型...

参数sprop-parameter-sets可以看作是对将要发送的数据进行解码的键.它包含一些字节,这些字节将用于编码数据,因此您可以与接收器共享它以便解码视频数据包.也可以从信令中省略它,但是它们对于解码器是必需的,因此它们也可以带内发送.因此,如果您在sdp中省略它们,则需要在数据包中发送它们.接收者只有在收到此信息后才能对数据进行解码.

问题1:

如前所述,profile-level-id可以省略,并且仍然有效,因为将使用默认的420010.唯一的区别是设置将有所不同,并且可能会影响视频质量.例如,默认情况下42表示约束基线配置文件(CBP),而SDP中初始值中的64表示引用高级配置文件(HiP).

缺少sprop-parameter-sets时,视频无法正常播放,可能是因为vlc不支持在带内发送该数据,并且如上所述,这是强制性的.

问题2:

许多SIP实现都支持在带内发送sprop-parameter-sets,这就是您要捕获的内容.在Wireshark中检查h264数据包,您将在某些数据包中看到此值的说明.

I'm trying to understand what is the required parameter in SDP to be able to decode H264 from RTP packets.

This is an related to this question, for the answer to that one works only in small number of cases.

Example

I am streaming from VLC with the following command.

vlc -vvv sample_video/big_buck_bunny_480p_h264.mov --sout '#transcode{vcodec=h264,vb=700,fps=20,scale=0.25,acodec=none}:rtp{dst=10.5.110.117,port=5004,ttl=1}'

This transcodes the video to:

  • Bitrate: 700kbps
  • Frame rate: 20 per second
  • Resolution: 25% of the original

The receiver correctly accepts and interprets the stream with the following SDP file (remove the first line, its just a name).

//test.sdp
c=IN IP4 10.5.110.117
m=video 5004 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=640014;sprop-parameter-sets=Z2QAFKzZQ0R+f/zBfMMAQAAAAwBAAAAKI8UKZYA=,aOvssiw=;

Command to run: vlc test.sdp

The document available here, named SIP Video Profile Best Practices in chapter 7.2 for profile-level-id states:

profile-level-id

While specified as optional (as are all parameters) in RFC 6184, the 'profile-level-id' parameter is fundamental to the setup of the codec, and is also required for any further parameters to be specified. Hence all implementations should include this parameter in their SDPs, and should interpret it when receiving it. If not included, the default value is 420010, as specified in RFC 6184.

The same document states the following for sprop-parameter-sets:

sprop-parameter-sets

H.264 allows sequence and picture information to be sent both in-band, and out-of-band. SIP video implementations should signal this information in-band, conforming to the model prevalent in H.323 and in the overwhelming majority of existing SIP video implementations, and hence this parameter should not be included.

Problem 1

The video is correctly interpreted on the receiver even when profile-level-id is removed.

//test.sdp
c=IN IP4 10.5.110.117
m=video 5004 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 sprop-parameter-sets=Z2QAFKzZQ0R+f/zBfMMAQAAAAwBAAAAKI8UKZYA=,aOvssiw=;

It doesn't work without the sprop-parameter-sets.

Problem 2

I've been wire-sharking different RTCPs,SIPs and SAPs and often the SDP doesn't contain the sprop-parameter-sets.

Questions

  • Please explain the meanings and differences between the two paramters
  • Based on the answer to the question above, explain the contrast that occurs in the problems

解决方案

Meanings and main differences:

As you can see in your definition of profile-level-id, it has a default and so it can be omitted in the signalling negotiation. The string contained in this parameter is in hexadecimal format and it has 3 bytes that inform the decoder about the profile, the constraints and the level that will be used to send data. This settings define several parameters like the bitrate, the resolution, the type of packets...

The parameter sprop-parameter-sets can be seen as the key to decode the data that you will be sending. It contains some bytes that will be used to encode the data, and so you share it with the receiver so that it can decode the video packets. It can also be omitted from the signalling, but they are mandatory for the decoder, so they can also be sent in-band. So if you omit them in the sdp, they need to be sent in the packets. The receiver can only decode the data after receiving this information.

Problem 1:

As stated before, profile-level-id can be omitted and it still works because the default 420010 will be used. The only difference is that the settings will be different, and probably, the video quality will be affected. For example, 42 in the default is referencing the Constrained Baseline Profile (CBP) and the 64 in your initial value in SDP is referencing High Profile (HiP).

The video is not working when sprop-parameter-sets is missing probably because vlc does not support sending that data in-band, and as I explained above, it is mandatory.

Problem 2:

Many SIP implementations has support to send sprop-parameter-sets in-band, and that's what you are capturing. Check the h264 packets in Wireshark, and you will see the description for this values in some packets.

这篇关于sprop-parameter-sets或profile-level-id是解码H264所需的SDP参数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆