转载自:https://blog.csdn.net/luckydarcy/article/details/69666414
背景:最近在参与一个ARM平台的音视频传输的项目,同事说已经是高清视频了,但是显示模糊,显然不能达到高清要求,于是就想抓包分析一下。
Step 1:执行如下命令,在 ARM 平台上用 tcpdump 抓包并保存为 test.cap。
tcpdump –i eth0 –nn –w test.cap
- 1
然后启动我们的多媒体通信程序,抓取几秒的数据即可。
Step 2:用 WireShark 工具打开 test.cap 文件。
Step 3:右键点击 H264 的 UDP 包,选择“Decode as…”,选择 RTP,点击 OK 之后就解析成 RTP 包了。
Step 4:查看 RTP 包的 payload type,例如我们这里是102。
【Dynamic payload types which will be interpreted as H264; Values must be in the range 96 - 127】

Step 5:然后在 WireShark 工具栏中选择 Edit –> preferences –> protocols –> H264,把“H264 dynamic payload types”设成 102,点击 OK。

Step 6:为方便查看,在 Filter 中输入“h264”过滤出 H264 数据包,如下。

Step 7:选择 SPS(Sequence Parameter Set),展开 H.264 数据包,找到 pic_width_in_mbs_minus1
和 pic_height_in_map_units_minus1
。

Step 8:
这里需要特别提一下这两个参数:- pic_width_in_mbs_minus1 = 21
- pic_height_in_mbs_minus1 = 17
分别表示图像的宽和高,以宏块(16x16)为单位的值减1
因此可以算出实际分辨率,X = (21+1)*16 = 352,Y = (17+1)*16 = 288,显然并不是高清视频。