1

在 Wireshark GUI 中,我们可以将 UPD 数据包解码为 RTP,同样可以在 tshark 中使用 d <layer type>==<selector>,<decode-as protocol>

我如何在 PyShark 中做同样的事情?我尝试执行以下操作

import pyshark

cap = pyshark.FileCapture("Test.pcap", display filter='udp', decode_as='rtp')
for pkt in cap:
   print(pkt)

但它显示以下错误

AttributeError: 'str' object has no attribute 'items'
4

1 回答 1

4

decode_as 参数应该是 dict 而不是 str 示例:

decode_as={'udp.port==1234':'rtp'}
于 2019-02-18T17:07:14.663 回答