1

In Wireshark GUI, we can decode a UPD packet as RTP, and the same can be done in tshark using d <layer type>==<selector>,<decode-as protocol>

How can i do the same in PyShark ? I tried doing the following

import pyshark

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

But it shows the following error

AttributeError: 'str' object has no attribute 'items'
dvs
  • 511
  • 1
  • 10
  • 27

1 Answers1

5

decode_as argument should be a dict and not str Example:

decode_as={'udp.port==1234':'rtp'}
balderman
  • 22,927
  • 7
  • 34
  • 52