Search code examples
udpwiresharkrtpmpeg

How can I use the value of mp2t.af.pcr as a Tshark field?


I have a wireshark capture that contains an RTP multicast stream (plus some other incidental data).

Using a Tshark command like the following, I can produce a CSV of the RTP timestamp compared with the packet capture time:

tshark.exe -r "capture.pcap" -Eseparator=, -Tfields -e rtp.timestamp -e frame.time_epoch -d udp.port==5000,rtp

This decodes the UDP packets as RTP, and successfully prints out the two fields as expected.

Now, my question: The payload of the RTP stream is an MPEG2 Transport Stream, and I also want to print the PCR value (if there is one) alongside the packet and RTP timestamps. In wireshark, I can see the PCR being decoded correctly, however using a command like the following:

tshark.exe -r "HBO HD CZ.pcap" -Eseparator=,-Tfields -e rtp.timestamp -e frame.time_epoch -e mp2t.af.pcr -d udp.port==5000,mp2t

...only prints out a "1" if there is a PCR oresent, not the actual value. I have also checked the .pcr_flag to confirm that these two are not exchanged, but still I see the same result.

The documentation seems to call mp2t.af.pcr a "Label", does this mean that Tshark is not able to use it as a field? Is there a way to generate a CSV with these values?


Solution

  • (What part of the documentation calls it a "Label"? That's a somewhat odd description of a named field.)

    The problem is that the value that Wireshark displays after "base(XXX)*300 + ext(YYY)" is calculated and displayed, but the field itself isn't given an integral type and is instead given a type that doesn't have a value. Arguably, it should be an FT_UINT64 field and should be given a value, so that you can filter on it and can print the value in TShark.

    Please file an enhancement request for this on the Wireshark Bugzilla.